Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan ModifySnapshotAttribute
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanModifySnapshotAttribute
.
- CLI
-
- AWS CLI
-
Contoh 1: Untuk memodifikasi atribut snapshot
modify-snapshot-attribute
Contoh berikut memperbaruicreateVolumePermission
atribut untuk snapshot yang ditentukan, menghapus izin volume untuk pengguna tertentu.aws ec2 modify-snapshot-attribute \ --snapshot-id
snap-1234567890abcdef0
\ --attributecreateVolumePermission
\ --operation-typeremove
\ --user-ids123456789012
Contoh 2: Untuk membuat snapshot publik
modify-snapshot-attribute
Contoh berikut membuat snapshot yang ditentukan publik.aws ec2 modify-snapshot-attribute \ --snapshot-id
snap-1234567890abcdef0
\ --attributecreateVolumePermission
\ --operation-typeadd
\ --group-namesall
-
Untuk detail API, lihat ModifySnapshotAttribute
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini membuat snapshot yang ditentukan publik dengan menyetel CreateVolumePermission atributnya.
Edit-EC2SnapshotAttribute -SnapshotId snap-12345678 -Attribute CreateVolumePermission -OperationType Add -GroupName all
-
Untuk detail API, lihat ModifySnapshotAttributedi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini membuat snapshot yang ditentukan publik dengan menyetel CreateVolumePermission atributnya.
Edit-EC2SnapshotAttribute -SnapshotId snap-12345678 -Attribute CreateVolumePermission -OperationType Add -GroupName all
-
Untuk detail API, lihat ModifySnapshotAttributedi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-