AWS Certified Developer Associate DVA-C02 Practice Question
A developer is launching an Amazon EC2 instance that runs a batch application needing read access to several Amazon S3 buckets in the same AWS account. The solution must follow AWS best practices by eliminating long-lived credentials, minimizing operational overhead, and granting only the permissions the application requires. Which approach should the developer use to meet these requirements?
Attach an IAM role with the required S3 permissions to the EC2 instance profile.
Create a dedicated IAM user, store its access key on the instance, and rotate the key manually.
Generate access keys for the AWS account root user and save them as encrypted environment variables.
Configure the application to authenticate with Amazon Cognito user pools and exchange the tokens for AWS credentials.
Attaching an IAM role to the EC2 instance profile supplies automatically rotated, temporary credentials scoped by the role's permissions policy. This removes the need to distribute or manage static access keys and aligns with the principle of least privilege. Creating an IAM user would require storing long-term credentials. Generating root-account keys is insecure and strongly discouraged. Amazon Cognito user pools manage end-user identities and are not intended for granting an EC2 instance access to AWS services.
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 in AWS?
Open an interactive chat with Bash
What is an EC2 instance profile?
Open an interactive chat with Bash
What is the principle of least privilege in AWS?
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
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .