โ† All AWS Flashcard Decks

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
  1. A bash script running in CodeBuild needs to exit immediately when any command fails. Which bash option enables this behavior?

    Answer: set -e

    set -e causes the shell to exit immediately when any command returns a non-zero exit status, preventing silent failures from propagating.

  2. Which feature of AWS CodePipeline allows a pipeline to pause and wait for a human to review an artifact before proceeding to the next stage?

    Answer: Approval action in the pipeline stage

    A manual approval action pauses the pipeline and sends an optional SNS notification; the pipeline resumes only after an authorized reviewer approves or rejects.

  3. A team uses AWS SAM CLI to test a Lambda function locally before deploying. Which command invokes the function locally using a sample event JSON file?

    Answer: sam local invoke -e event.json FunctionName

    sam local invoke -e event.json FunctionName runs the specified Lambda function locally using the provided event JSON file for testing before deployment.

  4. In a CloudFormation template, a developer uses !Sub to construct an ARN string. Which syntax correctly substitutes the AWS account ID into a string?

    Answer: !Sub 'arn:aws:s3:::${AWS::AccountId}-bucket'

    !Sub uses ${AWS::AccountId} with the pseudo parameter AWS::AccountId to dynamically substitute the current account ID into the string.

  5. A Lambda function triggered by S3 events needs to process files only from a specific prefix path. Where is this filter configured?

    Answer: In the S3 event notification filter rules with prefix and suffix conditions

    S3 event notifications support filter rules on key prefix and suffix, so only objects matching the pattern trigger the Lambda function.

  6. Which AWS CodeBuild environment variable automatically contains the full URI of the ECR repository, available without manual configuration in standard CodeBuild projects?

    Answer: There is no built-in ECR URI variable; it must be set manually

    CodeBuild does not provide a built-in ECR URI variable; teams must define it as a custom environment variable or construct it from $AWS_ACCOUNT_ID and $AWS_DEFAULT_REGION.

  7. A script uses the AWS CLI to wait until a CloudFormation stack reaches CREATE_COMPLETE status before proceeding. Which command implements this blocking wait?

    Answer: aws cloudformation wait stack-create-complete --stack-name MyStack

    aws cloudformation wait stack-create-complete polls the stack status at 30-second intervals and returns only when the stack reaches CREATE_COMPLETE or fails.