Skip to main content

AWS Cheatsheet

Get current logged in user

$ aws sts get-caller-identity
{
    "UserId": "AIDA3C6FL2I6WTCTDQ5V7",
    "Account": "762233737789",
    "Arn": "arn:aws:iam::762233737789:user/logan.13668"
}

Add a profile to command line

vi ~/.aws/credentials

# add profile in the following format:
# [lda@aws@etinc.ca]
# aws_access_key_id = FDAFDASREWREAW
# aws_secret_access_key = FDAFAREWREWQRESAFDSAREWRQWEREAFADSRFEWQREWQ

List available profiles:

$ aws configure list-profiles

Switch profile:

$ aws configure --profile <profile-name>