AWS CLI Cheat Sheet: Difference between revisions

From PUBLIC-WIKI
Jump to navigation Jump to search
Eyales (talk | contribs)
No edit summary
Eyales (talk | contribs)
No edit summary
Line 1: Line 1:
* Configuring the AWS cli environment (using IAM roles and access/secret keys):
* Configuring the AWS cli environment (using IAM roles and access/secret keys):
: '''aws configure'''''Italic text''
: '''''aws configure'''''
* Configure a profile for additional AWS IAM account:
* Configure a profile for additional AWS IAM account:
: '''aws configure --profile [profile_name]'''''Italic text''
: '''aws configure --profile [profile_name]'''
* Create a new S3 bucket:
* Create a new S3 bucket:
: '''aws s3 mb <BucketName>'''''Italic text''
: '''aws s3 mb <BucketName>'''
* Remove S3 bucket:
* Remove S3 bucket:
: '''aws s3 rb s3://<BucketName> --force'''''Italic text''
: '''aws s3 rb s3://<BucketName> --force'''
* List all S3 buckets:
* List all S3 buckets:
: '''aws s3 ls'''''Italic text''
: '''aws s3 ls'''
* List of S3 buckets using additional AWS IAM account:
* List of S3 buckets using additional AWS IAM account:
: '''aws s3 ls --profile [profile_name]'''''Italic text''
: '''aws s3 ls --profile [profile_name]'''
* List the content of specific S3 bucket:
* List the content of specific S3 bucket:
: '''aws s3 ls s3://<BucketName>'''''Italic text''
: '''aws s3 ls s3://<BucketName>'''
* Copy file from S3 bucket to local directory:
* Copy file from S3 bucket to local directory:
: '''aws s3 cp s3://<BucketName>/<FileName> /<LocalFolderName>'''''Italic text''
: '''aws s3 cp s3://<BucketName>/<FileName> /<LocalFolderName>'''

Revision as of 11:40, 12 March 2018

  • Configuring the AWS cli environment (using IAM roles and access/secret keys):
aws configure
  • Configure a profile for additional AWS IAM account:
aws configure --profile [profile_name]
  • Create a new S3 bucket:
aws s3 mb <BucketName>
  • Remove S3 bucket:
aws s3 rb s3://<BucketName> --force
  • List all S3 buckets:
aws s3 ls
  • List of S3 buckets using additional AWS IAM account:
aws s3 ls --profile [profile_name]
  • List the content of specific S3 bucket:
aws s3 ls s3://<BucketName>
  • Copy file from S3 bucket to local directory:
aws s3 cp s3://<BucketName>/<FileName> /<LocalFolderName>