Deployment
376 questions
A developer is configuring a backend worker application to run on Amazon ECS using the AWS Fargate launch type. The application code running inside the container needs to read and write items in an Amazon DynamoDB table. The container image is hosted in a private Amazon ECR repository located in a separate, central shared AWS account. Additionally, the task definition retrieves sensitive database credentials stored in encrypted AWS Systems Manager Parameter Store parameters and injects them as environment variables at task startup. Which of the following configuration steps are required to successfully deploy the task and run the application? (Select TWO.)
Select all that apply
A developer writes an AWS Serverless Application Model (SAM) template to deploy a Lambda function that reads objects from an Amazon S3 bucket. The template is configured as follows:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
ProcessUploadsFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src
Handler: index.handler
Runtime: nodejs18.x
Policies:
- S3ReadPolicy
When executing `sam deploy`, the deployment fails with a CloudFormation template validation or parsing error. Which of the following describes the root cause of this deployment failure and the correct resolution?
A developer is configuring the deployment settings for a critical production API hosted on AWS Elastic Beanstalk. The application currently runs on an Auto Scaling group of 8 instances and experiences a constant heavy workload. The deployment of the new application version must meet the following requirements:
- The environment must maintain its full capacity of 8 healthy instances running the current version during the deployment process.
- If the deployment fails, the rollback must be immediate and must not require redeploying the previous version to the instances, preventing any service disruption to the active environment.
- The new version must be deployed to new instances and pass health checks before any production traffic is routed to them.
Which Elastic Beanstalk deployment strategy satisfies these requirements?
A developer manages a web application deployed via an AWS CloudFormation stack. The stack contains an Amazon ECS service and an Amazon RDS database instance. During troubleshooting, a team member manually modifies the RDS security group rules in the AWS Management Console to allow temporary access. During a subsequent stack update to deploy a new ECS task definition, the update fails and the stack is left in the UPDATE_ROLLBACK_FAILED state. Additionally, the developer needs to store the database credentials securely and enable automatic rotation. Which approach should the developer take to resolve the stack's state and manage the credentials?
A company is evaluating AWS deployment strategies for its web application to ensure that any new version is deployed to brand new instances rather than updating the existing instances in-place. This approach is required to allow a clean separation of environments and a rapid rollback if issues are detected in production. Which two deployment strategies satisfy these requirements? (Select TWO.)
Select all that apply
A development team is preparing to deploy an application to Amazon ECS using the AWS Fargate launch type. The application container needs to pull its Docker image from a private Amazon ECR repository. Once the container is running, the application code needs to retrieve data from an Amazon S3 bucket.
Which IAM role configuration is required in the task definition to support this deployment?
A developer is managing a continuous delivery pipeline in AWS CodePipeline that consists of Source, Build, Test, and Production stages. The developer needs to temporarily stop code changes from being deployed to the Production stage while allowing developers to continue committing code and verifying builds in the Test stage. Additionally, the developer must configure the system to send email alerts to the operations team whenever any stage in the pipeline fails. Which combination of actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is updating a web application hosted on an AWS Elastic Beanstalk environment. The developer needs to deploy the new application version as quickly as possible. The application is for internal testing, so temporary downtime during the deployment is acceptable, and there is no budget for additional Amazon EC2 instances. Which Elastic Beanstalk deployment strategy meets these requirements?
A company is deploying a secure microservice to Amazon ECS using the AWS Fargate launch type. The application code inside the container must pull messages from an Amazon SQS queue and write processed records to an Amazon DynamoDB table. Additionally, when the container is initialized, the Amazon ECS agent must retrieve database credentials from AWS Secrets Manager using the container definition secrets parameter and inject them as environment variables. The secret is encrypted using an AWS KMS customer managed key (CMK). During deployment, the tasks fail to transition to the RUNNING state, and the developer receives an error indicating that the container helper was unable to retrieve the Secrets Manager secret. How should the developer configure the IAM roles to resolve this issue and adhere to the principle of least privilege?
A developer is deploying a microservices application to Amazon ECS using the AWS Fargate launch type in AWS Account A. The container image is stored in a private Amazon Elastic Container Registry (Amazon ECR) repository located in AWS Account B. During deployment, the ECS tasks fail to transition to the RUNNING state, and the task status shows an error indicating that the container image cannot be pulled from the remote registry. Which combination of steps should the developer perform to resolve this authentication and access issue? (Select TWO.)
Select all that apply
A developer is writing an appspec.yaml file to deploy updates to an AWS Lambda function using AWS CodeDeploy. Which of the following sections or hooks are valid for an AWS Lambda deployment? (Select TWO.)
Select all that apply
A developer is configuring an AWS CodeBuild project that runs inside a private subnet of a VPC to perform integration tests against an internal Amazon RDS database. The build process must retrieve a database password stored as a SecureString parameter in Systems Manager Parameter Store. The developer stores the build commands in a custom file named `build_config.yml` inside a subdirectory named `specs/` in the source repository.
During the initial run, the build fails with an error indicating that the build specification cannot be found.
Which combination of actions will resolve the buildspec finding error and allow the build to retrieve the parameter?
A developer is deploying a new version of a critical web application to AWS Elastic Beanstalk. The application must maintain availability (no downtime) and full capacity during the deployment. If a failure occurs, the deployment must support a rapid rollback to the previous version. The developer has no budget constraints. Which two deployment strategies meet these requirements? (Select TWO.)
Select all that apply
A developer is configuring a deployment for a web application running on an Auto Scaling group of four Amazon EC2 instances using AWS CodeDeploy. The deployment must meet the following constraints:
- The application must experience zero downtime, meaning at least some instances must remain online and healthy to serve traffic at all times.
- Due to strict budget limitations, no additional EC2 instances can be provisioned during the deployment.
Which two AWS CodeDeploy default deployment configurations satisfy these requirements? (Select two.)
Select all that apply
A developer is deploying a serverless application using the AWS Serverless Application Model (SAM). The template defines an AWS::Serverless::Api resource with an OpenAPI specification in the DefinitionBody property. The template also defines an AWS::Serverless::Function resource.
Within the OpenAPI specification, the developer configures the integration for a POST route as follows:
yaml
paths:
/orders:
post:
x-amazon-apigateway-integration:
type: "aws"
httpMethod: "POST"
uri:
Fn::Sub: "arn:aws:apigateway:{OrderFunction.Arn}/invocations"
The Lambda function handler is implemented to return the following structure:
{
"statusCode": 201,
"body": "{\"message\": \"Order created successfully\"}",
"headers": {
"Content-Type": "application/json"
}
}
When the client sends a POST request to /orders, it receives an HTTP status code of 200 OK with the following response body:
{
"statusCode": 201,
"body": "{\"message\": \"Order created successfully\"}",
"headers": {
"Content-Type": "application/json"
}
}
Which configuration change should the developer make to ensure the client receives an HTTP status code of 201 Created with the message body '{"message": "Order created successfully"}'?
A developer is configuring the AppSpec file for an AWS CodeDeploy deployment to Amazon ECS. The developer wants to run a validation test before production traffic is routed to the newly deployed task set. Which lifecycle hook should the developer use in the AppSpec file?
A developer is configuring a blue/green deployment for a microservice hosted on Amazon Elastic Container Service (Amazon ECS) using AWS CodeDeploy. The deployment must meet the following operational requirements:
* Traffic must be shifted in two increments: of traffic must be routed to the new task set immediately, followed by the remaining after a -minute evaluation period.
* The original task set must remain active for exactly hour ( minutes) after traffic is fully routed to the new task set to allow for manual rollback if issues arise, after which the original task set should be automatically terminated.
Which two configurations will satisfy these requirements? (Select TWO.)
Select all that apply
A software engineer is configuring an Amazon ECS task definition to deploy a containerized application to AWS Fargate. To simplify log management, the engineer configures the container to use the `awslogs` log driver and sets the `awslogs-create-group` option to `true` in the log configuration. The task definition specifies a custom IAM role for the task execution role. When the engineer attempts to launch the task, the task fails to start and remains in the `STOPPED` state, citing an authorization error related to CloudWatch Logs.
Which configuration change will resolve this deployment issue?
A developer is configuring a custom stage action in AWS CodePipeline that invokes an AWS Lambda function to perform integration testing. Arrange the following events in the correct chronological order, from the moment the Lambda action is initiated by the pipeline to the transition of the pipeline to the next stage.
Drag items to arrange them in the correct order
A developer is writing an AWS CloudFormation template to deploy an Amazon EC2 instance that runs a web application. The developer uses the AWS::CloudFormation::Init metadata key to install several software packages and configure application files during startup. However, when deploying the stack, CloudFormation marks the EC2 instance status as CREATE_COMPLETE immediately after the instance is provisioned, but before the software installation and configuration tasks have finished running. Which configuration should the developer implement to ensure the stack creation waits until the software setup on the instance is fully complete?