AWS Certified Developer – Associate — Question 273

A developer is building a serverless application that uses the AWS Cloud Development Kit (AWS CDK) to deploy application infrastructure. The developer is creating an AWS Lambda function that queries an HTTP API. The API needs all requests to include an access token for authentication and authorization. The developer needs to store the access token securely and to give the Lambda function access to the token.

Which solution will meet these requirements?

Answer options

Correct answer: D

Explanation

AWS Secrets Manager is the standard service for securely storing sensitive data like API access tokens, and manually setting the secret prevents it from being exposed in the AWS CDK code or deployment pipelines. Utilizing a CloudFormation stack policy ensures that subsequent CDK deployments do not overwrite the manually entered secret value. Other options are insecure because they either expose the token in plaintext via environment variables or store it in an unencrypted Systems Manager Parameter Store String parameter.