CLI, SDK and IAM Policies Flashcards

1
Q

In the AWS CLI, how to check if we have access for a spefic command?

A

Some command supports Dry Runs with the option –dry-run

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

How can you decode the error messages, what you got in CLI?

A

Use the sts-decode-authorization-message. NOTE: it needs some permission

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

How can an EC2 instance get information about themself?

A

With the EC2 Insntance Metadata.
It doesn’t need any IAM role
The url is http://169.254.169.254/latest/meta-data
But it can’t retrive the attached policies.

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

Can you use the MFA with CLI?

A

Yes, you must create a temp. session

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

How to use MFA with CLI?

A

To get a temporary session, use the sts get-session-token command with the –serial-number of the mfa device and the –token-code that was generated by the device.

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

What SDK is used for the AWS CLI?

A

The Python version of the AWS SDK.

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

What are the 2 limit types for AWS CLI / SDK?

A
  • API Rate Limit
  • Service Quotas
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is API Rate Limit for AWS

A
  • DescribeInstances API for EC2 has a limit of 100 calls per seconds
  • GetObject on S3 has a limit of 5500 GET per second per prefix
  • For Intermittent Errors: implement Exponential Backoff
  • For Consistent Errors: request an API throttling limit increase
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Service Quotas?

A
  • Running On-Demand Standard Instances: 1152 vCPU
  • You can request a service limit increase by opening a ticket
  • You can request a service quota increase by using the Service Quotas API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Exponential Backoff for any AWS Service?

A
  • If you get ThrottlingException intermittently, use exponential backoff
  • Must implement yourself if using the AWS API as-is or in specific cases
  • Must only implement the retries on 5xx server errors and throttling
  • Do not implement on the 4xx client errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the AWS CLI Credential Provider Chain order?

A
  1. CMD op
  2. Env. var.
  3. CLI cred file
  4. CLI config file
  5. Container cred
  6. Instance profile
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the AWS SDK Credential Provider Chain order?

A
  1. SDK sys prop
  2. Env. var.
  3. Defaul cred profiles
  4. Container cred
  5. Instance profile
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the auth method for AWS services on HTTP?

A

Signing request with SigV4.

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

How can you pass the SigV4 values?

A
  • In HTTP headers
  • In query string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly