AWS Certified Data Engineer Associate DEA-C01 Practice Question
An AWS Lambda function ingests CSV files from an S3 bucket and then issues SQL statements to an Amazon Redshift data warehouse through the Redshift Data API. You create a new IAM role that includes only s3:GetObject and redshift-data:ExecuteStatement permissions to satisfy least-privilege requirements. What must you do so that the Lambda function can use this role during execution?
Add the Lambda service principal (lambda.amazonaws.com) to the role's trust policy and attach the role as the function's execution role.
Attach the AWSLambdaBasicExecutionRole managed policy to the role so that Lambda can assume it automatically.
Store temporary Redshift credentials in AWS Secrets Manager and reference the secret in the function's environment variables.
Add the role's ARN to the Lambda function's resource-based policy with Action sts:AssumeRole.
Lambda automatically assumes the execution role that is attached to the function. For Lambda to assume a role, the role's trust policy must list the Lambda service principal (lambda.amazonaws.com) and the role must be configured as the function's execution role. This gives the function temporary credentials scoped to the permissions in that role.
Secrets Manager can securely store credentials but does not enable a function to assume an IAM role. A resource-based policy on the function governs who can invoke the function, not which role the function uses. Adding the AWSLambdaBasicExecutionRole managed policy only supplies CloudWatch logging permissions; it does not make the role assumable without the correct trust relationship.
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 a trust policy in AWS IAM?
Open an interactive chat with Bash
How does Lambda use an execution role?
Open an interactive chat with Bash
What are the least-privilege principles in IAM roles?
Open an interactive chat with Bash
What is a trust policy in AWS IAM?
Open an interactive chat with Bash
What does it mean for Lambda to use an execution role?
Open an interactive chat with Bash
Why can’t Secrets Manager be used to enable Lambda to assume a role?
Open an interactive chat with Bash
AWS Certified Data Engineer Associate DEA-C01
Data Security and Governance
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 .