1.01 AWS CLI for Terraform Flashcards

(8 cards)

1
Q
  1. When you run aws configure command without --profile, it saves credentials under the _ profile.
  2. When you run aws configure --profile dev-account, it saves credentials under _ profile.
A
  1. default
  2. dev-account
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Run command aws s3 ls but for the “dev-account” profile.

A
aws s3 ls --profile dev-account
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You want all aws commands in your current shell session to use a specific profile: “dev-account”. How will you set the environment variable temporarily and later unset?

A

To set:

export AWS_PROFILE=dev-account

To unset:

unset AWS_PROFILE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to check which profile is active?

A
echo $AWS_PROFILE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to configure aws cli with credentials?

A
aws configure

This stores your credentials (aws_access_key_id & aws_secret_access_key) profile-wise in ~/.aws/credentials and your region & output settings profile-wise in ~/.aws/config.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to check/confirm that your CLI is correctly authenticated (without opening the AWS Management Console)?

A
aws sts get-caller-identity

it returns a JSON object with your Account and ARN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

State File Integrity: Terraform uses a _ file to map your code to real-world AWS resources. If two people change the code at once without a shared state, the file becomes corrupted, leading to resource _ .
.

A
  1. terraform.tfstate
  2. corruption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly