Soru

Zorluk: OrtaAWS Elastic Beanstalk

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?

  1. 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.Cevap
  2. B
    Create 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.
  3. 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.Cevap
  4. D
    Attach an IAM policy with `ssm:GetParameters` permissions to the Elastic Beanstalk service role (`aws-elasticbeanstalk-service-role`).
  5. E
    Hardcode a temporary set of AWS access keys with access to AWS Systems Manager in the application source code configuration.

Cevap

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.

Adım Adım Çözüm

1
Configure instance initialization using Beanstalk configuration files.
Create a directory named `.ebextensions` at the root of the source bundle and place configuration files (e.g., `.config`) inside it.
Elastic Beanstalk platform engine detects and processes configuration files only when they are placed in a folder named `.ebextensions` with a leading dot at the root level of the application zip archive.
2
Establish secure permissions for Parameter Store access.
Add `ssm:GetParameters` permissions to the EC2 instance profile role used by the environment.
Since the application code running on the EC2 instances needs to call the Systems Manager API, the instance profile role provides the necessary temporary credentials via the EC2 Instance Metadata Service.

Anahtar Kavram

AWS Elastic Beanstalk environment customization and application permissions using instance profiles.
Bu soruyu puanla