AWS AWS DevOps and Developer Tools 4 — Questions and Answers
Question 1: Which AWS CodePipeline action type allows you to invoke an AWS Lambda function as a pipeline stage?
- Source
- Invoke (Correct answer)
- Deploy
- Test
Correct answer: Invoke
The 'Invoke' action type in CodePipeline lets you call a Lambda function, enabling custom logic within pipeline stages.
Question 2: In AWS CodeBuild, what does the buildspec.yml 'phases' section define?
- Environment variables for the build
- The sequence of commands executed during the build (Correct answer)
- IAM permissions for the build project
- Artifact output locations
Correct answer: The sequence of commands executed during the build
The 'phases' section in buildspec.yml defines the ordered sequence of commands (install, pre_build, build, post_build) that CodeBuild runs.
Question 3: What is the primary purpose of AWS CodeArtifact?
- Storing container images
- Managing software package repositories for dependencies (Correct answer)
- Deploying code to EC2 instances
- Running automated test suites
Correct answer: Managing software package repositories for dependencies
CodeArtifact is a managed artifact repository service for storing, publishing, and sharing software packages like npm, Maven, and PyPI.
Question 4: When using AWS CDK, what command synthesizes your CDK app into a CloudFormation template?
- cdk deploy
- cdk synth (Correct answer)
- cdk bootstrap
- cdk diff
Correct answer: cdk synth
'cdk synth' generates and prints the CloudFormation template from your CDK application code without deploying it.
Question 5: Which feature of AWS X-Ray helps you identify performance bottlenecks in a distributed application?
- Service Map (Correct answer)
- CloudWatch Alarms
- CloudTrail Logs
- Config Rules
Correct answer: Service Map
The X-Ray Service Map visualizes the components of your application and their connections, highlighting latency and error rates to pinpoint bottlenecks.
Question 6: In AWS CodeDeploy, what is the role of the AppSpec file during an EC2/on-premises deployment?
- It defines the CloudFormation stack
- It specifies lifecycle hooks and files to deploy on the instance (Correct answer)
- It stores environment variables
- It configures the load balancer routing
Correct answer: It specifies lifecycle hooks and files to deploy on the instance
The AppSpec file tells CodeDeploy which files to copy to the instance and which lifecycle event hook scripts to run during each deployment phase.
Question 7: Which AWS developer tool enables you to define infrastructure using familiar programming languages like Python, TypeScript, and Java?
- AWS CloudFormation
- AWS SAM
- AWS CDK (Correct answer)
- AWS Elastic Beanstalk
Correct answer: AWS CDK
The AWS Cloud Development Kit (CDK) lets you define cloud infrastructure as code using general-purpose programming languages instead of YAML/JSON templates.
Which AWS CodePipeline action type allows you to invoke an AWS Lambda function as a pipeline stage?