Amazon Web Services (AWS)

Table of Contents

1. Amazon Web Services (AWS)

1.1. Configure AWS client (e.g. the cli)

aws configure

###### OR

export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_DEFAULT_REGION=ca-central-1
export AWS_DEFAULT_OUTPUT=json

1.2. ECR - Elastic Container Registry

1.2.1. Login to AWS ECR

# using aws cli v1
aws ecr get-login-password --region region | \
 docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com

1.3. Upload a file to an S3 bucket with public access

# using aws cli v1
aws s3 cp --acl public-read FILENAME s3://BUCKET_NAME

Effects of trailing slash et al. :

  • Uploading index.html to s3://BUCKET_NAME will create a file index.html at the root of the bucket.
  • Uploading index.html to s3://BUCKET_NAME/path will create a file named path at the root of the bucket.
  • Uploading index.html to ~s3://BUCKET_NAME/path/ will create a file named index.html in the folder path.

Created: 2024-04-06 Sat 00:49