AWS Certified Developer – Associate (DVA-C02) — Question 77

A social media application uses the AWS SDK for JavaScript on the frontend to get user credentials from AWS Security Token Service (AWS STS). The application stores its assets in an Amazon S3 bucket. The application serves its content by using an Amazon CloudFront distribution with the origin set to the S3 bucket.

The credentials for the role that the application assumes to make the SDK calls are stored in plaintext in a JSON file within the application code. The developer needs to implement a solution that will allow the application to get user credentials without having any credentials hardcoded in the application code.

Which solution will meet these requirements?

Answer options

Correct answer: A

Explanation

Option A is correct because it utilizes a Lambda@Edge function, which can securely interact with AWS STS without exposing credentials in the front end. Options B, C, and D either use CloudFront functions, which have limited capabilities compared to Lambda@Edge, or incorrectly suggest moving the credentials into the function, which does not resolve the issue of hardcoding credentials.