Utilizzare CreateEnvironmentMembership con una CLI - Esempi di codice per SDK AWS

Sono disponibili altri esempi per SDK AWS nel repository GitHub della documentazione degli esempi per SDK AWS.

Utilizzare CreateEnvironmentMembership con una CLI

Gli esempi di codice seguenti mostrano come utilizzare CreateEnvironmentMembership.

CLI
AWS CLI

Come aggiungere un membro dell’ambiente a un ambiente di sviluppo AWS Cloud9

Questo esempio aggiunge il membro dell’ambiente specificato all’ambiente di sviluppo AWS Cloud9 specificato.

Comando:

aws cloud9 create-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser --permissions read-write

Output:

{ "membership": { "environmentId": "8a34f51ce1e04a08882f1e811bd706EX", "userId": "AIDAJ3LOROMOUXTBSU6EX", "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser", "permissions": "read-write" } }
PowerShell
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-write

Output:

EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX
  • Per informazioni dettagliate sull’API, consulta CreateEnvironmentMembership nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V4).

Strumenti per PowerShell V5

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-write

Output:

EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX
  • Per informazioni dettagliate sull’API, consulta CreateEnvironmentMembership nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V5).