Deployment
376 questions
A developer is preparing a Node.js web application for deployment on AWS Elastic Beanstalk. The application requires a public environment variable named `APP_COLOR` to be accessible across all instances. Additionally, the application must retrieve a highly sensitive database password that is rotated on a weekly basis. Which two actions should the developer take to meet these requirements?
Select all that apply
A developer is managing an application deployed via AWS CloudFormation. The application's database credentials are stored in AWS Secrets Manager and referenced in the CloudFormation template using the dynamic reference `{{resolve:secretsmanager:ProductionDBSecret:SecretString:Password}}` within the `UserData` property of an `AWS::EC2::LaunchTemplate` resource.
The database administrator rotates the database password in AWS Secrets Manager. Subsequently, the developer initiates a stack update to increase the `MaxSize` property of the `AWS::AutoScaling::AutoScalingGroup` resource that uses this launch template. The stack update completes successfully, but the newly launched EC2 instances fail to connect to the database, while existing instances continue to function until their cached credentials expire.
What is the cause of this issue, and how should the developer resolve it?
A developer needs to configure autoscaling thresholds and environment properties for a web application deployed via AWS Elastic Beanstalk. To ensure consistency across development, staging, and production environments, the developer wants these configurations to be version-controlled in the Git repository alongside the application source code. Which of the following approaches should the developer use to satisfy these requirements?
A developer is packaging a Node.js web application for deployment to an AWS Elastic Beanstalk environment running on an Amazon Linux platform. The developer needs to run a custom shell script that modifies application files after the application source bundle has been unpacked, but before the application version is started and traffic is routed to it. Which approach should the developer use to ensure the script executes at the correct stage of the deployment lifecycle?
A developer is configuring a deployment pipeline for a containerized application running on Amazon ECS (Fargate). The ECS service has a desired task count of . The deployment must comply with the following operational constraints:
- At least tasks must remain healthy and actively serve traffic at all times during the deployment to prevent service degradation.
- Due to strict account resource quotas in the target AWS Region, no more than tasks for this service can run concurrently at any point during the deployment.
- The system must automatically roll back to the previous stable version if the new container version fails to launch or fails to pass its container health checks.
Which deployment strategy and configuration should the developer implement to satisfy these requirements?
A developer is configuring a deployment strategy for a web application running on AWS Elastic Beanstalk. The application must maintain full capacity () throughout the deployment process to handle steady traffic, and the developer wants to avoid performing any DNS routing changes or CNAME swaps. Which two deployment policies satisfy these requirements? (Select TWO.)
Select all that apply
A development team is deploying a web application to an AWS Elastic Beanstalk environment running on an Amazon Linux 2023 platform. The application requires two configuration changes: First, a custom shell script must execute after the application source code has been extracted to the staging directory but before it is moved to the final path. Second, a custom system daemon (systemd service) must be configured to start automatically when each EC2 instance boots. Which combination of files and directory structures must the developer include in the application source bundle to satisfy these requirements? (Select TWO.)
Select all that apply
A developer is deploying a web application using AWS Elastic Beanstalk. The developer wants to include custom configuration files (with a `.config` extension) to install packages and define environment properties. In which directory at the root of the application source bundle must the developer place these files to ensure they are processed during deployment?
A developer is configuring a web application for deployment on AWS Elastic Beanstalk. The application requires a runtime environment variable named 'DATABASE_URL'. Additionally, the application requires an Amazon S3 bucket for storing user uploads, and this bucket's lifecycle must be tied directly to the Elastic Beanstalk environment. Which two configuration steps should the developer perform to satisfy these requirements? (Select TWO.)
Select all that apply
A developer is preparing a deployment package for a Python application to be deployed on AWS Elastic Beanstalk. The application requires a Linux system package to be installed on the hosting EC2 instances during deployment, and a custom database connection string environment variable to be configured. Which two configurations should the developer include in the application source bundle to meet these requirements?
Select all that apply
A developer manages a production environment deployed using an AWS CloudFormation stack. The stack contains an Amazon RDS DB instance, an Amazon EC2 instance, and an IAM role. A system administrator manually changed the security group of the RDS DB instance in the Amazon VPC Console to address a transient connection issue.
During a subsequent stack update to upgrade the database engine version and add policies to the IAM role, the update fails during the RDS DB instance modification. CloudFormation attempts to roll back the changes, but the rollback fails and remains stuck in the `UPDATE_ROLLBACK_FAILED` state because the manually modified security group configuration prevents the database rollback. The developer must complete the stack update, ensuring the new IAM policies are applied and the database is upgraded.
Which sequence of actions must the developer perform to resolve this issue?
A developer is deploying an update to a production web application hosted on AWS Elastic Beanstalk. The update must satisfy the following constraints:
* The application must maintain its full capacity of active instances throughout the deployment process to handle consistent user traffic.
* If the new version fails to deploy or pass health checks, the environment must roll back to the previous version automatically and as quickly as possible.
* The update must not require a DNS CNAME swap, as the domain name is mapped to a static resource external to the environment.
* The configuration must be managed programmatically as code inside the application source bundle.
Which configuration file path and content structure will satisfy these requirements?
yaml
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: RollingWithAdditionalBatch
yaml
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: Immutable
yaml
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: Immutable
yaml
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: AllAtOnce
A developer is writing an AWS CloudFormation template to deploy a web application. The application requires access to a database password that must be rotated automatically every 30 days.
Which approach should the developer use to reference this password in the CloudFormation template while meeting the security requirements?
A developer is deploying an updated version of a REST API to Amazon API Gateway. The developer must test the update by routing of production traffic to the new version. The remaining of traffic must continue to use the current version. The developer also needs the ability to instantly roll back the update if errors occur, or fully promote the update to production if it is successful. Which TWO configurations or actions must the developer perform to meet these requirements? (Select TWO.)
Select all that apply
A developer is using AWS SAM to deploy a serverless application consisting of an API Gateway endpoint that triggers a Lambda function, which writes data to a DynamoDB table. The template is defined as follows:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
ProcessTransactionFunction:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs18.x
CodeUri: ./src
Events:
PostTransaction:
Type: Api
Properties:
Path: /transaction
Method: post
Role: !GetAtt LambdaExecutionRole.Arn
LambdaExecutionRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- apigateway.amazonaws.com
Action:
- 'sts:AssumeRole'
Policies:
- PolicyName: DynamoDBWritePolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'dynamodb:PutItem'
Resource: !GetAtt TransactionTable.Arn
During the deployment process using the AWS SAM CLI, the deployment fails with a parser error indicating that the resource type `AWS::Serverless::Function` is invalid. Additionally, if the parsing error is resolved, the Lambda function will fail to execute due to execution role issues.
Which two modifications must the developer make to ensure the template parses successfully and the Lambda function can be successfully assumed and executed by the AWS Lambda service?
Select all that apply
A development team is deploying a worker application to an AWS Elastic Beanstalk Worker Tier environment. The application processes high-compute tasks received from an Amazon SQS queue, with each task taking approximately minutes ( seconds) to complete. During testing, the team notices that tasks are frequently reprocessed by different worker instances before the original instance completes them, and the worker daemon logs indicate timeout failures before the application returns an HTTP status code. Which two configuration steps must the developer perform to resolve these issues and support this long-running processing requirement?
Select all that apply
A developer is configuring a continuous delivery pipeline in AWS CodePipeline. During the pipeline execution, the pipeline fails at the transition to a deployment stage with an access denied error indicating that the pipeline cannot assume the service role. Which of the following is the most likely cause of this failure?
A developer is packaging a Node.js web application for deployment to AWS Elastic Beanstalk. The application requires the installation of an external system tool (git) and must define a custom environment variable named APP_STAGE set to production. The developer wants to manage these configurations as code within the application source bundle. Which two actions must the developer take to accomplish this? (Select TWO.)
Select all that apply
A developer is deploying a containerized microservice to Amazon ECS using the AWS Fargate launch type. The application requires sensitive database credentials to be injected into the container as environment variables at startup from AWS Systems Manager Parameter Store. Additionally, the application must send its container logs to Amazon CloudWatch Logs using the awslogs log driver. Which configuration steps must the developer perform to establish the required IAM roles and permissions for this deployment? (Select TWO.)
Select all that apply
A developer is deploying a serverless application using a local AWS Serverless Application Model (SAM) template file named `template.yaml`. The template contains the following definition:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
GetProductFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs20.x
CodeUri: ./src
Events:
GetProduct:
Type: Api
Properties:
Path: /products/{id}
Method: get
The developer attempts to deploy the application directly by executing the following AWS CLI command:
`aws cloudformation deploy --template-file template.yaml --stack-name product-service-dev --capabilities CAPABILITY_IAM`
However, the command fails, indicating that the `CodeUri` property of the `AWS::Serverless::Function` resource must point to an Amazon S3 location.
Which of the following statements identifies the root cause of this error and the correct action to resolve it?