DevOps Automation Tools & Scripting Techniques Flashcards
7 cards from real AWS practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 DevOps Automation Tools & Scripting Techniques flashcards as text
A DevOps engineer needs to run a shell script as a post-deploy hook in AWS CodeDeploy. Which AppSpec file section should contain this script reference?
Answer: ApplicationStart
The ApplicationStart lifecycle hook runs scripts after the application files have been installed, making it the correct place for post-deploy startup logic.
Which AWS CLI command lists all available parameter names stored in AWS Systems Manager Parameter Store under a specific path prefix?
Answer: aws ssm get-parameters-by-path --path /myapp/
aws ssm get-parameters-by-path retrieves all parameters within a specified path hierarchy, making it ideal for prefix-based lookups.
In a Jenkins pipeline, a developer wants to skip a stage if a specific environment variable is not set. Which Jenkinsfile construct achieves this?
Answer: when { environment name: 'VAR', value: 'true' }
The 'when' directive with 'environment' condition evaluates the stage conditionally based on whether the named environment variable matches the given value.
A team uses AWS Systems Manager Run Command to execute scripts across 50 EC2 instances simultaneously. What is the recommended way to avoid overwhelming all instances at once?
Answer: Use --max-concurrency and --max-errors parameters
--max-concurrency limits how many instances execute simultaneously while --max-errors defines the failure threshold before the command halts.
Which Python boto3 pattern is considered best practice for handling AWS API throttling in automation scripts?
Answer: Use exponential backoff with jitter on ThrottlingException
Exponential backoff with jitter spreads retry attempts over time, reducing contention and preventing thundering herd problems when AWS throttles API calls.
A CloudFormation custom resource needs to signal success or failure back to the stack. What mechanism does the Lambda function use to communicate this?
Answer: Send a PUT request to the pre-signed S3 URL in the ResponseURL event field
CloudFormation custom resources require the Lambda function to PUT a JSON response to the ResponseURL pre-signed S3 URL provided in the event, signaling SUCCESS or FAILED.
When writing an AWS CDK app in Python, which command synthesizes the CloudFormation template without deploying it?
Answer: cdk synth
cdk synth generates and prints the CloudFormation template for the CDK app without making any changes to the AWS environment.