AWS - AWS CLI commands
AWS CLI commands
see the account number and your user ID:
1
2
3
4
5
6
$ aws sts get-caller-identity
{
"Account": "12345678",
"UserId": "AROAXYHPXEBY7QBCBKPP2:user762073=user@example.com",
"Arn": "arn:aws:sts::12345678:assumed-role/voclabs/user762073=user@example.com"
}
have any EC2 instances running in the sandbox, running this command would provide information about them:
1
2
3
4
$ aws ec2 describe-instances
{
"Reservations": []
}
Using the AWS SDK for Python
The terminal also has Python 3 installed with the boto 3 library available.
to run AWS Python SDK code
1
2
3
4
5
6
$ python3
>>> import boto3
>>> ec2 = boto3.client('ec2', region_name='us-east-1')
>>> ec2.describe_regions()
>>> exit()
$
.
This post is licensed under CC BY 4.0 by the author.
Comments powered by Disqus.