AWS Certified Developer Associate DVA-C02 Practice Question
A developer is deploying an application on an Amazon EC2 instance. The application requires permissions to programmatically interact with other AWS services. To adhere to security best practices, the application must not use long-term static credentials. What is the most secure method to grant the necessary permissions to the application?
Store static IAM user credentials in the application's source code and commit it to a version control system.
Configure the application to use the AWS account's root user credentials for all API calls.
Attach an IAM role to the EC2 instance with policies that grant the required permissions.
Embed a static IAM user's access keys in the environment variables of the EC2 instance.
Attaching an IAM role to the EC2 instance is the recommended security best practice for applications running on AWS. This method provides temporary credentials that are automatically rotated by AWS and managed through the instance metadata service. This avoids the need to embed static long-term credentials in the application's code or configuration, which is a significant security risk. Using the root account or static IAM user credentials violates the principle of least privilege and increases the risk of credential compromise.
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
How does the Instance Metadata Service provide credentials to an EC2 instance?
Open an interactive chat with Bash
Why is using static IAM credentials considered insecure?
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 .