AWS CloudFormation
57 questions
A developer manages an AWS CloudFormation stack for a production application. The stack defines an Amazon S3 bucket with the `DeletionPolicy` attribute set to `Retain`. To update the application's storage architecture, the developer modifies the CloudFormation template to change the name of the S3 bucket, which requires resource replacement. Before executing the stack update, the developer manually deletes the original S3 bucket out-of-band using the AWS CLI. During the stack update, a name collision error occurs for the new S3 bucket, causing the update to fail and begin rolling back. The rollback fails because the original S3 bucket no longer exists, and the parent stack becomes stuck in the `UPDATE_ROLLBACK_FAILED` state.
Which sequence of actions must the developer take to resolve this failure and successfully complete the name change?
A developer is managing a web application infrastructure using AWS CloudFormation. The developer needs to configure the stack to retrieve a database password securely and ensure that the deployed infrastructure remains consistent with the template definition. Which two actions should the developer take to meet these requirements?
Select all that apply
A developer is managing a web application infrastructure deployed via an AWS CloudFormation stack. The stack includes an Auto Scaling group of Amazon EC2 instances, which are configured using AWS::CloudFormation::Init metadata and helper scripts to install packages and start the application. During a stack update, the update fails and rolls back because the new instances do not signal success to the stack within the specified timeout. Additionally, the developer suspects that team members might have made manual configuration changes directly on the production EC2 instances. Which two actions should the developer take to troubleshoot the deployment failure and address the configuration drift? (Choose two.)
Select all that apply
A developer is maintaining a testing environment deployed via an AWS CloudFormation stack. To resolve a connectivity issue, the developer manually modifies the inbound port rules of an Amazon EC2 security group directly through the Amazon VPC Console. The developer now wants to identify the discrepancies between the live resource configurations and the definition in the original CloudFormation template. Which CloudFormation feature or action should the developer use to identify these configuration discrepancies?
A developer is deploying a web application with a database backend using an AWS CloudFormation stack. The developer wants to ensure that the database credentials are managed securely and that the stack resources do not become inconsistent due to manual configurations. Which of the following actions should the developer take to achieve this? (Select TWO.)
Select all that apply
A developer is managing a web application infrastructure deployed via an AWS CloudFormation stack. The stack includes an Amazon RDS DB instance and an Amazon ECS service. The developer needs to update the database master password to a new value and configure the ECS tasks to retrieve this password securely. During the update attempt, the stack update fails because another team member manually modified the database security group rules directly in the Amazon VPC console to debug a connection issue. Which combination of actions should the developer take to resolve the update failure and secure the password? (Select TWO.)
Select all that apply
A developer is managing a batch processing system deployed via an AWS CloudFormation stack. During an update of the stack, the deployment fails because of a resource configuration error, and CloudFormation automatically initiates a rollback. However, the rollback fails because an Amazon S3 bucket that was created by the stack has been manually deleted outside of CloudFormation. The stack is now stuck in the `UPDATE_ROLLBACK_FAILED` state. Which two actions must the developer take to resolve this issue and update the stack? (Choose two.)
Select all that apply
A developer is attempting to update an AWS CloudFormation stack that manages a microservices application. During a previous update attempt, a custom resource failed to stabilize, triggering a rollback. During the rollback, the stack became stuck in the `UPDATE_ROLLBACK_FAILED` state because an IAM role resource defined in the template had been manually deleted from the AWS account. The developer has created a new IAM role and needs to update the stack to use this new role.
How should the developer resolve this issue and successfully apply the update to the stack?
A developer is designing an AWS CloudFormation template to deploy an application that connects to an Amazon RDS database. The developer needs to store the database credentials securely and prevent the database from being accidentally deleted if the CloudFormation stack is deleted or updated. Which combination of actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is preparing to update an AWS CloudFormation stack that manages a production backend application. The update involves introducing a new external service API key that must be stored securely with support for automatic rotation. Additionally, the developer must ensure that any manual, out-of-band changes previously made to the stack's resources are identified and resolved before the update is performed to prevent deployment failures.
Which combination of actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is deploying a web application using AWS CloudFormation. The template configures an Amazon EC2 Auto Scaling group behind an Application Load Balancer. The EC2 instances must install application software packages and retrieve a database password from parameter storage during startup. The database password must be rotated automatically every 30 days. Currently, the stack deployment finishes and is marked complete before the application initialization script finishes on the EC2 instances, causing the application to fail to connect to the database. How should the developer configure the CloudFormation template and startup scripts to resolve these issues in a secure and reliable manner?
A developer is managing a production web application deployed via an AWS CloudFormation stack. The stack includes an Amazon RDS database and an Amazon ECS service. The database credentials must be rotated automatically every 30 days. To troubleshoot an urgent connectivity issue, a system administrator manually modified the database security group rules and the database master password directly in the AWS Management Console. When the developer subsequently attempts to update the stack to deploy a new ECS task definition, the stack update fails.
Which two actions should the developer take to resolve the update failure and align the infrastructure with AWS security best practices? (Select TWO.)
Select all that apply
A developer is writing an AWS CloudFormation template to deploy a web application. The application requires two configurations:
1. A database connection password that must be rotated automatically every 30 days.
2. A database connection port number, which is a non-sensitive configuration parameter.
To optimize operational efficiency, security, and cost, how should the developer store and reference these configurations in the CloudFormation template?
A developer is managing an AWS CloudFormation stack for a production backend application. During a stack update, the deployment fails, and the stack enters the UPDATE_ROLLBACK_FAILED state because an IAM role referenced by the template was manually deleted out-of-band. The developer has corrected the template and needs to apply the update to the stack. Which action should the developer take to resolve the stack state and successfully deploy the update?
A developer is designing an AWS CloudFormation template to deploy a microservice. The microservice requires access to a database password that must be automatically rotated every 30 days, as well as a non-sensitive API endpoint URL for an external service. Which two configuration strategies should the developer use to reference these values in the CloudFormation template to ensure security, rotation support, and cost-efficiency? (Select TWO.)
Select all that apply
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 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?
A developer is updating an AWS CloudFormation stack that manages a web application's network infrastructure. The update fails, and the stack begins to roll back. However, the rollback process fails and the stack is left in the UPDATE_ROLLBACK_FAILED state because one of the subnets was previously deleted manually via the AWS Console. How should the developer resolve this issue to return the stack to a stable state?
A developer is managing an infrastructure deployment consisting of two separate AWS CloudFormation stacks: a network stack that exports VPC resource identifiers, and an application stack that imports these identifiers using the `Fn::ImportValue` intrinsic function. The developer needs to update the network stack's outputs to support a new subnet configuration. Which of the following are valid constraints or required actions when modifying exported outputs that are referenced by other stacks? (Select TWO.)
Select all that apply
A software engineering team is using AWS CloudFormation to deploy a three-tier web application. The application requires a database password that must be rotated automatically every 30 days. Which approach should the developer use to securely reference the database password in the CloudFormation template?