// The following command lists any of your instances that have the tag Name=MyInstance.
$ aws ec2 describe-instances --filters "Name=tag:Name,Values=MyInstance"
// The following command lists your instances that were launched using any of the following AMIs: ami-x0123456, ami-y0123456, and ami-z0123456.
$ aws ec2 describe-instances --filters "Name=image-id,Values=ami-x0123456,ami-y0123456,ami-z0123456"
$ aws ec2 describe-vpcs
// Create a Bucket
$ aws s3 mb s3://bucket-name
// List Your Buckets
$ aws s3 ls
// The following command lists all objects and folders (referred to in S3 as 'prefixes') in a bucket.
$ aws s3 ls s3://bucket-name
// Delete a Bucket
$ aws s3 rb s3://bucket-name
// The following example copies an object into a bucket. It grants read permissions on the object to everyone and full permissions (read, readacl, and writeacl) to the account associated with user@example.com.
$ aws s3 cp file.txt s3://my-bucket/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=emailaddress=user@example.com
// Delete local file
$ rm ./MyFile1.txt
// Attempt sync without --delete option - nothing happens
$ aws s3 sync . s3://my-bucket/path
// Sync with deletion - object is deleted from bucket
$ aws s3 sync . s3://my-bucket/path --delete
delete: s3://my-bucket/path/MyFile1.txt
// Delete object from bucket
$ aws s3 rm s3://my-bucket/path/MySubdirectory/MyFile3.txt
delete: s3://my-bucket/path/MySubdirectory/MyFile3.txt
// Sync with deletion - local file is deleted
$ aws s3 sync s3://my-bucket/path . --delete
delete: MySubdirectory\MyFile3.txt
// Sync with Infrequent Access storage class
$ aws s3 sync . s3://my-bucket/path --storage-class STANDARD_IA
$ aws ec2 describe-instances --filters "Name=tag:Name,Values=MyInstance"
// The following command lists your instances that were launched using any of the following AMIs: ami-x0123456, ami-y0123456, and ami-z0123456.
$ aws ec2 describe-instances --filters "Name=image-id,Values=ami-x0123456,ami-y0123456,ami-z0123456"
$ aws ec2 describe-vpcs
// Create a Bucket
$ aws s3 mb s3://bucket-name
// List Your Buckets
$ aws s3 ls
// The following command lists all objects and folders (referred to in S3 as 'prefixes') in a bucket.
$ aws s3 ls s3://bucket-name
// Delete a Bucket
$ aws s3 rb s3://bucket-name
// The following example copies an object into a bucket. It grants read permissions on the object to everyone and full permissions (read, readacl, and writeacl) to the account associated with user@example.com.
$ aws s3 cp file.txt s3://my-bucket/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=emailaddress=user@example.com
// Delete local file
$ rm ./MyFile1.txt
// Attempt sync without --delete option - nothing happens
$ aws s3 sync . s3://my-bucket/path
// Sync with deletion - object is deleted from bucket
$ aws s3 sync . s3://my-bucket/path --delete
delete: s3://my-bucket/path/MyFile1.txt
// Delete object from bucket
$ aws s3 rm s3://my-bucket/path/MySubdirectory/MyFile3.txt
delete: s3://my-bucket/path/MySubdirectory/MyFile3.txt
// Sync with deletion - local file is deleted
$ aws s3 sync s3://my-bucket/path . --delete
delete: MySubdirectory\MyFile3.txt
// Sync with Infrequent Access storage class
$ aws s3 sync . s3://my-bucket/path --storage-class STANDARD_IA
Comments
Post a Comment