1. Introduction to AWS Flashcards

to be added later (38 cards)

1
Q

all the functionality of AWS is exposed through

A

APIs.

Every command in AWS is fundamentally an API request

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

Management Console helps manage resources manually. Programmatic management of AWS resource is possible through

A

AWS CLI or AWS SDK. These help automate the management of resources on cloud.

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

The AWS CLI and the SDK on the same server can share configuration settings (like credentials, region, profiles) through files like

A

~/.aws/config
~/.aws/credentials

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

In comparison to IAM user, root user has the permissions to

A
  • Change billing information
  • Close AWS account
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

an AWS managed policy that grants full access to all AWS services and resources.

A

Administrator Access
It essentially allows performing any action (“Action”: “”), on any resource (“Resource”: “”).
Its Amazon Resource Name (ARN) is arn:aws:iam::aws:policy/AdministratorAccess.

used by the initial administrator user created after setting up an AWS a

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

As a separator when there is no explicit region, ARNs of AWS-managed policies have _, while ARNs of customer-managed policies have _

A
  1. ::aws
  2. ::123456789012 (account ID)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In ARNs, when service is global (not region-specific), _ is used as separator in ARN.
When service is global (not region-specific) and is not account-specific, then _ is used as separator in ARN.

A
  1. double colon (::)
  2. triple colon (:::)

Example, AWS-managed IAM Policy apply globally (not region-specific). So, their ARNs include double colon as shown below:
arn:aws:iam::aws:policy/AdministratorAccess

Example, some global AWS services (like S3 or IAM) do not require a region or account ID, leading to extra colons. So, their ARNs include triple colon as shown below:
arn:aws:s3:::my-bucket-name
arn:aws:iam:::role/MyGlobalRole

Some AWS service-linked roles and global IAM roles may omit account id
* arn:aws:iam:::role/aws-service-role/organizations.amazonaws.com/AWSServiceRoleForOrganizations
* arn:aws:iam:::role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig

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

To log into the management console, an IAM user needs

A
  • Console Sign-in URL
  • User Name
  • Password
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Access Keys of an IAM user are generated by root user.
(T/F)

A

True.

Go to Users Menu in IAM, select Security Credentials tab, click “Create Access Key” button.

On the final page, you will be given a chance to copy two values: the Access Key, which you can always obtain, and the Secret Access Key, which you will not see again

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

The command “aws configure” initiates a series of prompts for 4 values. What are they?

A
  1. Access Key ID
  2. Secret Access Key
  3. Default Region Name
  4. Default Output Format (json)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CLI command to confirm which identity/user the AWS CLI is currently operating as

A

aws iam get-user

You can also get the details specifically for the IAM user with specific name:
aws iam get-user –user-name my-application-user

The command returns a JSON object containing the user’s details.

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

Command to configure CLI with named profiles

A

aws configure –profile developer

You will be prompted for the configuration values again. From then on, you may append –profile developer to any AWS CLI command to run it as this alternate user

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

AWS tool to launch a CLI terminal window in your web browser

A

Cloud Shell

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

CLI command format

A

CLI commands are invoked in the format aws service-name command, followed by any additional parameters or flags.

To see all services, use aws help and to see all commands for a service, use aws service-name help.

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

list details of all S3 buckets in your account

A

aws s3 ls

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

show details of all EC2 instances in your account

A

aws ec2 describe-instances

17
Q

What’s the purpose of signing the API request to AWS resource/service?

A

SDK/CLI signs any API request to add authentication information.

SDK/CLI uses your secret access key (which only you and AWS should know) to create a unique digital signature based on the entire request details (the action being called, parameters, timestamp, etc.)

This signature is sent along with your access key ID in the request

AWS receives the request, looks up the provided access key ID to find the associated secret key (which it stored when the key pair was created), and then independently calculates its own signature based on the request details it received.

Sign calculated by AWS must match sign sent with request to authenticate

18
Q

API request made through SDK/CLI uses _ for authentication and _ for authorization.

A
  1. signature
  2. IAM policy

Only after successful authentication does AWS proceed to the authorization step. AWS then checks the policies attached to that identity.

19
Q

if an api request from CLI/SDK has “access denied” error, then

A

the policy attached to the user does not authorize to perform action described in api request.

20
Q

Difference between “403 Forbidden” and “401 Unauthorized” response of an api request to AWS

A
  • 403 Forbidden: indicates that the server understood the request but refuses to authorize it. This is a perfect fit for an authorization failure – AWS knows who you are (authentication succeeded), but your identity does not have the necessary permissions (authorization failed)
  • 401 Unauthorized: indicates that authentication failed (the server doesn’t know who you are or your credentials were invalid).
21
Q

The SDK and CLI both automatically check several locations for configuration and credentials, when they are not explicitly provided in the code. These locations include

A
  • environment variables
  • programming language–specific parameter stores
  • local files
22
Q

Best Practice for managing credentials automatically for code running on an AWS compute environment like EC2 or Lambda

A

Assign an IAM role to the environment (EC2/Lambda).

This enables the SDK to load the credentials automatically from the role and to refresh the credentials as they are automatically rotated.

23
Q

IAM roles provide temporary credentials for access to AWS compute environments. Give 3 examples.

A
  1. EC2InstanceRole: Used for applications running on EC2 that need access to AWS services (e.g., S3, DynamoDB).
  2. LambdaExecutionRole: Required for Lambda functions to interact with services like S3, DynamoDB, or SNS
  3. ECSTaskRole: Allows ECS tasks to access AWS services securely
24
Q

temporary security credentials of an IAM role are issued by which AWS service?

A

AWS Security Token Service (STS)

25
List 3 kinds of identities in IAM
1. User 2. Group 3. Role
26
Every identity has a list of policies associated with it, each of which is used to _ api request made to AWS.
authorize | AWS evaluates policies associated with the identity making api request
27
users who need the same kind of permissions, can be associated to a group. Then the _ assigned to group define the permissions applied to each member of the group.
**policies** IAM users within an IAM group inherit permissions from the policies attached to their group, plus any permissions from policies that are associated directly with that IAM user | An individual IAM user can be a member of many IAM groups
28
# Clash of effects: In the case that multiple permissions policies apply to the same API action, any policy that has the effect _ will take precedence over any policy that has the effect _.
1. **deny** 2. **allow**
29
_ defines which AWS account, IAM role, or IAM user is trusted to assume a role. Think of it as a set of rules that specifies **who can assume a role** and under what conditions.
Trust Policy | A trust policy is associated with a particular role
30
_ is the entity (user, application, or service) that is allowed or denied access to a resource by a policy. It can be an AWS account, IAM user, IAM role, federated user, or an AWS service.
Principal
31
_ answers who can assume this role and _ answers what action this role can perform once assumed.
1. Trust Policy 2. Permissions Policy Example of Trust policy: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "ec2.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } ``` This policy means that the ec2.amazonaws.com service (i.e., EC2 instances) is trusted to assume this role. Example of Permissions policy: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "arn:aws:s3:::example-bucket/*" } ] } ``` This policy allows any principal assuming this role to perform any action (s3:*) on all objects within the example-bucket.
32
short-term security credentials obtained from AWS Security Token (AWS STS) service are composed of
1. access key ID 2. secret access key 3. session token 4. expiration date
33
While a user assumes a role, their permissions are limited to what the role can do; any permissions the user has directly attached or inherited from a group are _
not evaluated | you cannot nest IAM roles or add IAM roles to IAM groups
34
process of the SDK proactively requesting and replacing the expiring temporary credentials with new ones from the _ service is what is called as "automatic rotation"
**metadata** The SDK automatically manages the lifecycle of these temporary keys by requesting new ones from the environment's metadata service before the current ones expire. | The metadata service talks to STS in the background.
35
If a policy contains statement having "Action": "sts:AssumeRole", then the policy is
Trust policy
36
If a policy contains statement having a specific "Principal", a specific "Resource" and an "Action" of specific AWS service different from STS, then the policy is
Resource-based Policy
37
If a policy contains statement having no specific "Principal", then that policy is
IAM policy
38
CLI command to attach a resource-based policy to an S3 bucket ?
**ws s3api put-bucket-policy** ``` { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*" } ```