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
The CodeDeploy Agent runs deployment instructions based on a file with what name?
appspec.yml
In CloudFormation templates, functions in are prefixed with Fn::
What is the .yml shorthand for function prefixes that’s used in place of Fn:: ?
!
In CloudFormation templates, what is the .yml function for referencing parameters and resources?
(Bonus points: What do Parameters and Resources return?)
!REF
Parameters returns the value of the parameter. Resources returns the physical ID of the underlying resource.
In CloudFormation templates, what is the .yml function for referencing the attributes of the resources you create? (ex: the AZ of an EC2 machine)
!GetAtt
In CloudFormation templates, what is the .yml function for accessing values from key-value pairs listed in the Mappings section of your template?
!FindInMap
In CloudFormation templates, what is the .yml function for importing values that are exported from your other CloudFormation templates?
!ImportValue
In CloudFormation templates, what .yml function should you use if you want to generate the following output based on the given input?
Input: “ :: ”, [“Hello”, “World”, “!”]
Output: “Hello :: World :: !”
!Join
In CloudFormation templates, what is the .yml function equivalent to the str.replace() method?
What is the syntax?
!Sub
!Sub
- String
- { Var1Name: Var1Value, Var2Name: Var2Value }
In CloudFormation templates, what are the 5 .yml condition functions?
!IF
!AND
!OR
!NOT
!EQUALS
To send custom metrics to CloudWatch, which API call is used?
PutMetricData
To modify metric resolution in CloudWatch, which API call is used?
(Bonus points: what are the logging frequencies for Standard and High Resolution?)
StorageResolution
( Standard: 60 sec
High Resolution: 1/5/10/30 sec )
To move log data from CloudWatch to S3, which API call is used?
(Bonus points: how long does the transfer take?)
CreateExportTask
(up to 12 hours)
To test CloudWatch alarms and notifications, what CLI command is used?
aws cloudwatch set-alarm-state –alarm-name “myalarm” –state-value ALARM –state-reason “testing purposes”
To upload segment documents to AWS X-Ray, which API call is used?
PutTraceSegments
The AWS X-Ray daemon uploads telemetry with which API call?
PutTelemetryRecords
To retrieve all sampling rules for X-Ray, which API call is used?
GetSamplingRules
Which 3 AWS X-Ray API calls are considered Write APIs?
PutTraceSegments
PutTelemetryRecords
GetSamplingRules
To get the main X-Ray service graph, which API call is used?
GetServiceGraph
To retrieve a list of traces specified by ID in X-Ray, which API call is used?
(Note: each trace is a collection of segment documents that originates from a single request)
BatchGetTraces
To retrieve IDs and annotations for X-Ray traces available for a specified time frame (using an optional filter), which API call is used?
(Note: to get the full traces, pass the trace IDs to BatchGetTraces)
GetTraceSummaries
To retrieve a service graph for one or more specific trace IDs, which API call should be used?
GetTraceGraph
Which 4 AWS X-Ray API calls are considered Read APIs?
GetServiceGraph
BatchGetTraces
GetTraceSummaries
GetTraceGraph
To run X-Ray with EB, you can either set the option in the console or with a configuration file in DIRECTORY/FILENAME
What are the missing strings?
DIRECTORY = .ebextensions/
FILENAME = xray-daemon.config
To allow cross account access to SQS queues for an AWS account with a principal of 111122223333, what key-value pair should be present in the IAM policy statement?
“Princical”: { “AWS”: [111122223333] }
What does this IAM policy enable?
This policy enables an S3 bucket with a specific source account to write to this SQS queue.
To change the message visibility timeout in SQS queues, which API call is used?
ChangeMessageVisibility
Which SQS parameter determines the number of retries before a message is sent to the queue’s DLQ (if configured)?
MaximumReceives
Which SQS parameter determines the number of seconds a message must stay in queue before it becomes visible to consumers?
DelaySeconds
SQS Long Polling can be enabled at the queue level or at the API level using which SQS parameter?
WaitTimeSeconds
List the 9 essential SQS API calls:
(Bonus points: which 3 have Batch APIs?)
CreateQueue, DeleteQueue
PurgeQueue,
SendMessage, ReceiveMessage, DeleteMessage
MaxNumberOfMessages
ReceiveMessageWaitTimeSeconds
ChangeMessageVisbility
To create an SQS queue, which API call is used?
(Bonus points: which argument can be used to set how long a message should be kept in queue before being discarded)
CreateQueue
(MessageRetentionPeriod)
To delete an SQS queue (and all messages inside), which API call is used?
DeleteQueue
To delete all the messages in an SQS queue but not the queue itself, which API call is used?
PurgeQueue
To send a message to an SQS queue, which API call is used?
(Bonus points: which argument is used to set the number of seconds of delay)
SendMessage
(DelaySeconds)