AWS Certified Developer Associate DVA-C02 Practice Question
Your application, hosted on multiple Amazon EC2 instances, needs to perform periodic data processing tasks on an Amazon S3 bucket. The tasks require the application to have read, write, and list permissions on the bucket. To align with security best practices, which action should you take to grant these S3 permissions to the application?
You selected this option
Configure a resource-based policy on the S3 bucket to grant the EC2 instances the required permissions.
You selected this option
Create an IAM user for each EC2 instance with permissions to access the S3 bucket and store the credentials in a configuration file on each instance.
You selected this option
Create an IAM role with the specified S3 permissions and attach it to the EC2 instances using an instance profile.
You selected this option
Attach an IAM managed policy with the required S3 permissions directly to the EC2 instances.
Attaching an instance profile that contains an IAM role with the necessary S3 permissions to your EC2 instances is the recommended solution for this scenario. This allows the application to assume the IAM role and obtain temporary credentials, which can be used to access the S3 bucket. The use of an instance profile ensures that the EC2 instance can securely make API calls to AWS services on behalf of the user that assumed the role. Unlike static credentials, these permissions are automatically rotated and managed by AWS. Creating individual IAM users is not scalable for multiple instances, and hard-coding credentials is a security risk and violates the AWS recommended practice of not embedding secrets in code. Using a resource-based policy on the S3 bucket is not possible, as it cannot grant the necessary EC2 instance permissions to assume a role.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an IAM role and why is it used with EC2 instances?
Open an interactive chat with Bash
What is the difference between an IAM user and an IAM role?
Open an interactive chat with Bash
What is an instance profile in the context of EC2 and IAM roles?
Open an interactive chat with Bash
AWS Certified Developer Associate DVA-C02
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Oh snap!
Loading...
Loading...
Loading...
Information Technology Package Join Premium for Full Access