AWS Certified Developer Associate DVA-C02 Practice Question
A developer needs to enable an application hosted on Elastic Compute Cloud (EC2) instances to retrieve objects from a storage service that is managed under a separate organizational unit. What measure should be implemented to securely grant the necessary access without storing long-term credentials within the application’s codebase?
Assign an Inline policy directly to the storage bucket that permits access to the EC2 instances based on their security group IDs.
Establish a cross-account IAM role with the required permissions to interact with the storage service and configure the EC2 instances to assume this role when accessing the resources.
Embed a generated access and secret key of an IAM user with the necessary permissions into the application's environment variables for resource interaction.
Modify the access control configuration on the storage buckets to include the application host instances as explicit grantees for object retrieval.
The correct way to grant an application hosted on EC2 instances access to resources in another account without embedding static credentials is by having the application assume an IAM role that has the necessary permissions to access the storage service, and establishing trust between the accounts. The role's trust policy will allow EC2 instances from the application host's account to assume it. This practice aligns with AWS security best practices by avoiding static credential storage within the application and ensuring the principle of least privilege. Directly attaching IAM policies to the resources or using ACLs does not address the requirement for cross-account access. IAM users with static credentials should be avoided as it contradicts best practices of using dynamic, short-lived credentials provided by IAM roles.
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.
How do IAM roles enable secure cross-account access?
Open an interactive chat with Bash
What is the advantage of using IAM roles over static credentials?
Open an interactive chat with Bash
How does the EC2 instance assume an IAM role?
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 .