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?
- Configure the `APP_COLOR` variable under the Environment properties section of the Elastic Beanstalk environment configuration.Answer
- Store the database password in AWS Secrets Manager and retrieve it programmatically using the AWS SDK during application startup.Answer
- CStore the database password in AWS Systems Manager Parameter Store as a Standard String parameter and enable native automatic rotation.
- DCreate a configuration file named `env_vars.config` inside a directory named `ebextensions` at the root of the application source bundle.
- EEmbed the database password directly as a plain-text configuration value within the application source code files.
Answer
Configure the public variable in the Elastic Beanstalk Environment properties, and store the sensitive database password in AWS Secrets Manager, retrieving it programmatically at runtime.
The correct options are to configure the environment properties directly in Elastic Beanstalk for non-sensitive values and to retrieve sensitive credentials programmatically from AWS Secrets Manager. Environment properties in Elastic Beanstalk are ideal for simple public configuration variables such as application color, as they are passed directly to the environment. AWS Secrets Manager is the designated service for storing sensitive secrets that require automatic rotation, such as database passwords, and can be queried securely via the AWS SDK at runtime.
Step-by-Step Solution
Key Concept
Configuring AWS Elastic Beanstalk applications with environment properties and managing secrets securely.