Names (API, CLI, etc.) Flashcards
When requesting SSE-S3 encryption for objects sent so S3, what key-value pair must be present in the header?
“x-amz-server-side-encryption”: “AES256”
When requesting SSE-KMS encryption for objects sent to S3, what key-value pair must be present in the header?
“x-amz-server-side-encryption”: ”aws:kms”
What CLI option/flag should be used to simulate an AWS API call without using resources?
(Note: this option is not available on all API calls)
–dry-run
You may get long error messages from failed AWS API calls. Which command is used to decode these error messages?
sts decode-authorization-message
If you want detailed information on an EC2 instance, which URL should you query from that instance?
http://169.254.169.254/latest/meta-data
If you want detailed information on the launch script of an EC2 instance, which URL should you query from that instance?
http://169.254.169.254/latest/user-data
To use MFA with the CLI, which API call is used?
STS GetSessionToken
To use MFA with the CLI, what CLI command is used?
aws sts get-session-token –serial-number arn-of-the-mfa-device –tokencode code-from-token –duration-seconds 3600
When you upload objects to an S3 bucket encrypted with SSE-KMS, which KMS API call is used?
GenerateDataKey
When you download objects from an S3 bucket encrypted with SSE-KMS, which KMS API call is used?
Decrypt
If you want to invalidate part of your CloudFront cache, which API call can you use?
CreateInvalidation
If you want to place ECS tasks on EC2 machines with the least available amount of memory (to minimize # of EC2 instances and save costs), fill in the Xs.
“placementStrategy”: [
{
“type”: X1,
“field”: X2
}
]
X1 = “binpack”
X2 = “memory”
If you want to place ECS tasks on EC2 machines randomly, fill in the X.
“placementStrategy”: [
{
“type”: X
}
]
X = “random”
If you want to place ECS tasks on EC2 machines distributed evenly across the ECS availability zone, fill in the X.
“placementStrategy”: [
{
“type”: X,
“field”: “attribute:ecs.availability-zone”
}
]
X = “spread”
If you want to place ECS tasks on their own EC2 instances, fill in the X.
“placementStrategy”: [
{
“type”: X
}
]
X = “distinctInstance”
If you want to place ECS tasks on EC2 only in us-east-1a and us-west-2b, fill in the X.
“placementStrategy”: [
{
“type”: X,
“expression”: “attribute:ecs.availability-zone in [us-east-1a, us-east-2b]”
}
]
X = “memberOf”
To login to ECR using AWS CLI v2, what CLI command is used?
aws ecr get-login-password –region region | docker login –username AWS –password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
To push to Amazon ECR, what CLI command is used?
docker push aws_account_id.dkr.ecr.region.amazonaws.com/demo:latest
To pull from Amazon ECR using the CLI, what CLI command is used?
docker pull aws_account_id.dkr.ecr.region.amazonaws.com/demo:latest
The directory at the root of your EB project that contains all your .config files has what directory name?
.ebextensions/
EB Single Docker requires one of two files in order to get the container up and running. What are the names of those two files?
(Bonus points, what’s the difference between the two?)
Dockerfile : (EB will build and run the container)
Dockerrun.aws.json (v1) : (Describe where an already built container is)
An EB Multi Docker Container app requires a file with what filename to generate the ECS task definition?
(Bonus points: where should the file be located?)
Dockerrun.aws.json (v2)
(at the root of the source code)
You want to create an EB custom platform. The filename of the AMI must be what?
Platform.yaml
AWS CodeBuild reads build instructions from a file with what name?
buildspec.yml