Deployment
376 questions
A developer is writing an AWS CloudFormation template to deploy an Amazon EC2 instance that runs a web server. The developer wants to ensure that the EC2 instance is not marked as CREATE_COMPLETE until the web server application package is successfully installed and the service is started. If the installation fails or does not complete within 15 minutes, the stack creation should fail and rollback. Which TWO actions must the developer perform in the CloudFormation template and instance configuration to meet these requirements?
Select all that apply
A developer is configuring an AWS CodeBuild project to compile and package a Java application. The buildspec.yml file is placed in the root of the source repository and contains a valid artifacts section listing the target JAR file. The build execution completes with a status of SUCCEEDED, but no artifacts are uploaded to the destination Amazon S3 bucket. Which of the following is the most likely cause of this issue?
A developer is deploying a new version of a critical web application to AWS Elastic Beanstalk. The deployment must satisfy the following constraints:
- The application must maintain of its serving capacity throughout the deployment process to handle high user traffic without performance degradation.
- In the event of a deployment failure, the application must support an immediate rollback to the previous version without requiring a rolling update of the older version.
- The development team has approved a temporary increase in resource capacity to allow up to twice the normal instance count during the deployment.
Which deployment strategy will meet these requirements?
A developer is configuring a blue/green deployment for an Amazon ECS service using AWS CodeDeploy. The developer wants to run a validation script to perform smoke tests before production traffic is routed to the new task set. The developer creates the following `appspec.yaml` file:
yaml
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
TaskDefinition: "arn:aws:ecs:us-east-1:123456789012:task-definition/my-app:1"
LoadBalancerInfo:
ContainerName: "my-app-container"
ContainerPort: 8080
Hooks:
- BeforeAllowTraffic:
- location: scripts/run-smoke-tests.sh
timeout: 300
During deployment, the CodeDeploy agent fails to parse the AppSpec file. How should the developer modify the AppSpec file to resolve this issue?
A company is updating an infrastructure stack deployed via AWS CloudFormation. The template contains an Amazon DynamoDB table that needs to be modified. The planned modification requires CloudFormation to replace the DynamoDB resource. The developer wants to ensure that the database's existing data is preserved and the resource is not deleted during this replacement, as well as if the stack is deleted in the future. Which configuration should the developer apply to the DynamoDB resource in the template?
A developer is configuring a blue/green deployment for a containerized application on Amazon ECS using AWS CodeDeploy. The deployment configuration utilizes an Application Load Balancer with two target groups and a test listener. The developer wants to run automated integration tests against the replacement task set via the test listener to validate the new version of the application before shifting any production traffic.
Which AppSpec lifecycle hook should the developer use to run these integration tests?
A developer is using AWS Serverless Application Model (SAM) to deploy a database-backed API. The database password is saved as a SecureString in AWS Systems Manager Parameter Store. The developer attempts to reference this password in the SAM template's `Parameters` section as follows:
yaml
Parameters:
DbPassword:
Type: AWS::SSM::Parameter::Value<String>
Default: /prod/db/password
During the `sam deploy` process, AWS CloudFormation returns a validation error indicating that `AWS::SSM::Parameter::Value<String>` cannot reference SSM SecureString parameters.
How should the developer resolve this deployment failure while keeping the database password secure?
An engineer is deploying a serverless application using a template that defines a Lambda function triggered by an Amazon S3 event. The function needs to execute with a custom IAM role. During the deployment, the stack fails to create the resources successfully. The relevant section of the template is structured as follows:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
ProcessFileFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs20.x
Role: !GetAtt ProcessingRole.Arn
ProcessingRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal: Service: s3.amazonaws.com
Action: sts:AssumeRole
Which of the following modifications will resolve the deployment failure and allow the Lambda function to assume the role?
An organization runs a critical web application on a fleet of Amazon EC2 instances managed by an Auto Scaling group. The developer needs to configure a deployment strategy for application updates that guarantees the application maintains 100% of its capacity throughout the deployment process. Additionally, if the new version fails health checks, the system must support the fastest possible rollback to the previous version with minimal operational overhead. The organization accepts the temporary additional cost of provisioning duplicate resources during the deployment.
Which two deployment strategies meet these requirements?
Select all that apply
A developer is configuring a blue/green deployment for an Amazon ECS service using AWS CodeDeploy. The deployment must execute a validation AWS Lambda function to verify the health of the new task set before shifting production traffic. The validation function requires access to a database password that must be automatically rotated every 30 days. Additionally, the CodeDeploy service itself requires permissions to manage the ECS deployment. Which combination of configurations should the developer use to meet these requirements?
A developer is deploying a serverless application using the AWS Serverless Application Model (SAM). The template defines an AWS::Serverless::Function resource that needs to read and write items in an Amazon DynamoDB table defined in the same template. During initial testing, the function fails to access the table due to missing permissions. The developer wants to resolve this issue by applying the principle of least privilege using the most operationally efficient method that native AWS SAM features support. Which configuration should the developer add to the template to resolve the permission issue?
A development team needs to deploy an update to an Amazon ECS service running on an EC2-backed cluster. The service currently runs 4 tasks. Due to strict budget limits, the cluster has no additional EC2 instance capacity to run extra tasks during the deployment. However, the service must maintain at least 50% of its capacity at all times to handle the baseline request volume. Which ECS service deployment configuration should the developer specify to meet these requirements?
A developer is setting up an automated canary deployment for an AWS Lambda function using AWS CodeDeploy. The deployment is defined by the following `appspec.yml` template fragment:
yaml
version: 0.0
Resources:
- MyLambdaFunction:
Type: AWS::Lambda::Function
Properties:
Name: "MyLambdaFunction"
Alias: "live"
CurrentVersion: "1"
TargetVersion: "2"
The developer needs to modify this configuration to execute a validation Lambda function before traffic shifting begins, and must configure the CodeDeploy service role with the correct trust relationship and permissions.
Which two actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is updating a critical serverless application and needs to configure traffic shifting for a new version of an AWS Lambda function using AWS CodeDeploy. The deployment must meet the following requirements:
* Route exactly of traffic to the new version in the first increment.
* Allow at least minutes of monitoring for errors before shifting any additional traffic or completing the deployment.
Which two AWS CodeDeploy deployment configurations should the developer select to meet these requirements?
Select all that apply
A developer is configuring a blue/green deployment for an Amazon ECS service using AWS CodeDeploy. The deployment must execute an AWS Lambda function to run validation tests on the replacement task set after test traffic is routed, but before production traffic is shifted. The validation tests require a database password that must be rotated automatically every 30 days. Additionally, CodeDeploy requires an IAM service role to perform the deployment. Which configuration should the developer implement?
A developer is using AWS SAM to build and deploy a serverless application. The application consists of an Amazon API Gateway HTTP API that triggers an AWS Lambda function. During the initial deployment of the template using the AWS SAM CLI, the deployment fails with an error stating that the resource type 'AWS::Serverless::Function' is unrecognized. After addressing the deployment failure, the developer tests the API endpoint but receives a 502 Bad Gateway error, even though Amazon CloudWatch Logs show that the Lambda function executed successfully and returned the correct data. Which two actions must the developer take to resolve these issues?
Select all that apply
A development team is deploying an updated AWS Lambda function using AWS CodeDeploy with a linear traffic-shifting configuration. Before any production traffic is routed to the new function version, the deployment process must run a separate validation Lambda function to perform smoke tests.
Which lifecycle hook must be specified in the `Hooks` section of the `appspec.yml` file to execute the validation function?
A software team is designing a serverless microservice using the AWS Serverless Application Model (SAM). The architecture requires an API Gateway HTTP API that triggers a backend AWS Lambda function. The function must securely fetch database credentials at runtime and also publish messages to an Amazon SQS queue.
Which two configuration steps must be implemented to ensure the deployment succeeds and the function operates correctly?
Select all that apply
A developer is planning the deployment of a new version of a critical web application hosted on AWS Elastic Beanstalk. The application runs on a fleet of Amazon EC2 instances managed by an Auto Scaling group behind an Application Load Balancer. The deployment must satisfy the following constraints:
* The update must be rolled out with zero downtime.
* The application must maintain of its instance capacity to handle the current traffic load at all times during the deployment.
* In the event of a deployment failure, the application must support an immediate rollback to the previous version without requiring a full redeployment of the original code.
Which two deployment strategies meet these requirements? (Select two.)
Select all that apply
A developer is configuring AWS CodeDeploy to deploy a web application to a fleet of Amazon EC2 instances. The deployment must copy application files to the target instances and run a shell script (scripts/initialize.sh) that installs application dependencies. During execution, this script must download a configuration file from a secured Amazon S3 bucket.
Which two options must the developer configure to meet these requirements? (Select TWO.)
Select all that apply