È stata rilasciata la versione 5 (V5) di! AWS Strumenti per PowerShell
Per iniziare a utilizzare la nuova versione degli strumenti, consulta la Guida per l'AWS Strumenti per PowerShell utente (V5), in particolare l'argomento per la migrazione alla V5.
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
AWS Cloud9 esempi di utilizzo di Tools for V4 PowerShell
I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Strumenti per PowerShell V4 con. AWS Cloud9
Le operazioni sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le operazioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.
Ogni esempio include un collegamento al codice sorgente completo, in cui è possibile trovare istruzioni su come configurare ed eseguire il codice nel contesto.
Argomenti
Operazioni
Il seguente esempio di codice mostra come utilizzareGet-C9EnvironmentData.
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio ottiene informazioni sugli ambienti di sviluppo AWS Cloud9 specificati.
Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX,1980b80e5f584920801c09086667f0EXOutput:
Arn : arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX Description : Created from CodeStar. Id : 685f892f431b45c2b28cb69eadcdb0EX Lifecycle : Amazon.Cloud9.Model.EnvironmentLifecycle Name : my-demo-ec2-env OwnerArn : arn:aws:iam::123456789012:user/MyDemoUser Type : ec2 Arn : arn:aws:cloud9:us-east-1:123456789012:environment:1980b80e5f584920801c09086667f0EX Description : Id : 1980b80e5f584920801c09086667f0EX Lifecycle : Amazon.Cloud9.Model.EnvironmentLifecycle Name : my-demo-ssh-env OwnerArn : arn:aws:iam::123456789012:user/MyDemoUser Type : sshEsempio 2: Questo esempio ottiene informazioni sullo stato del ciclo di vita dell'ambiente di sviluppo Cloud9 specificato AWS .
(Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX).LifecycleOutput:
FailureResource Reason Status --------------- ------ ------ CREATED-
Per i dettagli sull'API, vedere DescribeEnvironmentsin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Get-C9EnvironmentList
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio ottiene un elenco di identificatori dell'ambiente di AWS sviluppo Cloud9 disponibili.
Get-C9EnvironmentListOutput:
685f892f431b45c2b28cb69eadcdb0EX 1980b80e5f584920801c09086667f0EX-
Per i dettagli sull'API, vedere ListEnvironmentsin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Get-C9EnvironmentMembershipList
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio ottiene informazioni sui membri dell'ambiente di sviluppo AWS Cloud9 specificato.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEXOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXEsempio 2: Questo esempio ottiene informazioni sul proprietario dell'ambiente di sviluppo AWS Cloud9 specificato.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission ownerOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXEsempio 3: Questo esempio ottiene informazioni sul membro dell'ambiente specificato per più ambienti di sviluppo AWS Cloud9.
Get-C9EnvironmentMembershipList -UserArn arn:aws:iam::123456789012:user/MyDemoUserOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/17/2018 7:48:14 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX EnvironmentId : 1980b80e5f584920801c09086667f0EX LastAccess : 1/16/2018 11:21:24 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX-
Per i dettagli sull'API, vedere DescribeEnvironmentMembershipsin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Get-C9EnvironmentStatus
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio ottiene informazioni sullo stato per l'ambiente di sviluppo AWS Cloud9 specificato.
Get-C9EnvironmentStatus -EnvironmentId 349c86d4579e4e7298d500ff57a6b2EXOutput:
Message Status ------- ------ Environment is ready to use ready-
Per i dettagli sull'API, vedere DescribeEnvironmentStatusin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. New-C9EnvironmentEC2
- Strumenti per PowerShell V4
-
Esempio 1: questo esempio crea un AWS ambiente di sviluppo Cloud9 con le impostazioni specificate, avvia un'istanza Amazon Elastic Compute Cloud ( EC2Amazon) e quindi si connette dall'istanza all'ambiente.
New-C9EnvironmentEC2 -Name my-demo-env -AutomaticStopTimeMinutes 60 -Description "My demonstration development environment." -InstanceType t2.micro -OwnerArn arn:aws:iam::123456789012:user/MyDemoUser -SubnetId subnet-d43a46EXOutput:
ffd88420d4824eeeaeaa8a04bfde8cEX-
Per i dettagli sull'API, consulta CreateEnvironmentEc2 in AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. New-C9EnvironmentMembership
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio aggiunge il membro dell'ambiente specificato all'ambiente di sviluppo AWS Cloud9 specificato.
New-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-writeOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX-
Per i dettagli sull'API, vedere CreateEnvironmentMembershipin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Remove-C9Environment
- Strumenti per PowerShell V4
-
Esempio 1: questo esempio elimina l'ambiente di sviluppo AWS Cloud9 specificato. Se un' EC2 istanza Amazon è connessa all'ambiente, termina anche l'istanza.
Remove-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX-
Per i dettagli sull'API, vedere DeleteEnvironmentin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Remove-C9EnvironmentMembership
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio elimina il membro dell'ambiente specificato dall'ambiente di sviluppo AWS Cloud9 specificato.
Remove-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX-
Per i dettagli sull'API, vedere DeleteEnvironmentMembershipin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Update-C9Environment
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio modifica le impostazioni specificate dell'ambiente di sviluppo AWS Cloud9 esistente specificato.
Update-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Description "My changed demonstration development environment." -Name my-changed-demo-env-
Per i dettagli sull'API, vedere UpdateEnvironmentin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
Il seguente esempio di codice mostra come utilizzare. Update-C9EnvironmentMembership
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio modifica le impostazioni del membro di ambiente esistente specificato per l'ambiente di sviluppo AWS Cloud9 specificato.
Update-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-onlyOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-only UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX-
Per i dettagli sull'API, vedere UpdateEnvironmentMembershipin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-