An organization is deploying a Node.js web application to a single-instance environment on AWS Elastic Beanstalk. The application must store local application log files in a custom directory on the host Amazon EC2 instance. Additionally, the application needs to retrieve database credentials dynamically at runtime from AWS Systems Manager Parameter Store.
Which two actions must a developer take to meet these requirements?
- Create a directory named `.ebextensions` at the root of the application source bundle, and place a configuration file inside it to create the custom log directory.Answer
- BCreate a directory named `ebextensions` (without the leading dot) at the root of the application source bundle, and place a configuration file inside it to create the custom log directory.
- Attach an IAM policy with `ssm:GetParameters` permissions to the IAM role associated with the Elastic Beanstalk EC2 instance profile, and retrieve the parameters using the application code.Answer
- DAttach an IAM policy with `ssm:GetParameters` permissions to the Elastic Beanstalk service role (`aws-elasticbeanstalk-service-role`).
- EHardcode a temporary set of AWS access keys with access to AWS Systems Manager in the application source code configuration.
Answer
Create a directory named `.ebextensions` at the root of the application source bundle to place the configuration file, and attach an IAM policy with `ssm:GetParameters` permissions to the IAM role associated with the EC2 instance profile.
The correct options are creating the `.ebextensions` directory at the root to contain the configuration file, and granting Systems Manager permissions to the EC2 instance profile role. The `.ebextensions` directory is the standard location for environment customization files, and the EC2 instance profile role provides permissions to the application code running on the EC2 instances.
Step-by-Step Solution
Key Concept
AWS Elastic Beanstalk environment customization and application permissions using instance profiles.