Question

Difficulty: MediumAWS Elastic Beanstalk

A developer is preparing to deploy a Node.js web application to an AWS Elastic Beanstalk environment. The deployment has two new requirements: it must securely retrieve a database password that is configured to rotate automatically, and it must install a custom security daemon package on the underlying Amazon EC2 instances during environment provisioning.

Which two actions should the developer take to meet these requirements?

  1. Store the database password in AWS Secrets Manager, and retrieve the secret programmatically in the application code.Answer
  2. Create a configuration file containing the package installation instructions and place it inside a directory named `.ebextensions` at the root of the application source bundle.Answer
  3. C
    Store the database password in AWS Systems Manager Parameter Store and configure Parameter Store to automatically rotate the value.
  4. D
    Create a configuration file containing the package installation instructions and place it inside a directory named `ebextensions` (without a leading period) at the root of the application source bundle.
  5. E
    Create a configuration file containing the package installation instructions and place it inside a directory named `.ebextensions` within the `/src` folder of the application source bundle.

Answer

Store the database password in AWS Secrets Manager to be retrieved programmatically by the application, and place the configuration file inside the `.ebextensions` directory at the root of the application source bundle.
To securely manage a database password that needs automatic rotation, AWS Secrets Manager is the correct choice because it natively integrates with rotation schedules. To customize the EC2 instances (such as installing packages), configuration files must be stored in the `.ebextensions` folder located at the root of the application source bundle. Therefore, storing the password in Secrets Manager and placing the configuration file in `.ebextensions` at the root are the correct actions.

Step-by-Step Solution

1
Evaluate secret storage and rotation requirements.
Identify AWS Secrets Manager as the appropriate service because it natively supports automatic rotation, unlike Systems Manager Parameter Store.
Secrets Manager provides out-of-the-box secret rotation using AWS Lambda.
2
Evaluate how to customize EC2 instances with packages during deployment.
Determine that an Elastic Beanstalk configuration file (.config) must be placed in a directory named `.ebextensions`.
Elastic Beanstalk searches for configuration files specifically in this folder to apply customizations.
3
Verify directory location and naming constraints.
Confirm that the `.ebextensions` directory must be at the root level of the application source bundle with a leading period.
Incorrect naming (like `ebextensions`) or incorrect placement (like inside a `/src` directory) will cause Elastic Beanstalk to ignore the configurations.

Key Concept

AWS Elastic Beanstalk environment customization using `.ebextensions` and secure secret management with Secrets Manager vs Parameter Store.
Estimated Time:1m 30s
Rate this question