Amazon

DVA-C02 practice question 1

AWS Certified Developer - Associate (DVA-C02) · free question 1 of 20

Question

A company is implementing an application on Amazon EC2 instances. The application needs to process incoming transactions. When the application detects a transaction that is not valid, the application must send a chat message to the company's support team. To send the message, the application needs to retrieve the access token to authenticate by using the chat API. A developer needs to implement a solution to store the access token. The access token must be encrypted at rest and in transit. The access token must also be accessible from other AWS accounts. Which solution will meet these requirements with the LEAST management overhead?
  • A. Use an AWS Systems Manager Parameter Store SecureString parameter that uses an AWS Key Management Service (AWS KMS) AWS managed key to store the access token. Add a resource-based policy to the parameter to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Parameter Store. Retrieve the token from Parameter Store with the decrypt flag enabled. Use the decrypted access token to send the message to the chat.
  • B. Encrypt the access token by using an AWS Key Management Service (AWS KMS) customer managed key. Store the access token in an Amazon DynamoDB table. Update the IAM role of the EC2 instances with permissions to access DynamoDB and AWS KMS. Retrieve the token from DynamoDB. Decrypt the token by using AWS KMS on the EC2 instances. Use the decrypted access token to send the message to the chat.
  • C. Use AWS Secrets Manager with an AWS Key Management Service (AWS KMS) customer managed key to store the access token. Add a resource-based policy to the secret to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Secrets Manager. Retrieve the token from Secrets Manager. Use the decrypted access token to send the message to the chat. Correct
  • D. Encrypt the access token by using an AWS Key Management Service (AWS KMS) AWS managed key. Store the access token in an Amazon S3 bucket. Add a bucket policy to the S3 bucket to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Amazon S3 and AWS KMS. Retrieve the token from the S3 bucket. Decrypt the token by using AWS KMS on the EC2 instances. Use the decrypted access token to send the message to the chat.

Explanation

AWS Secrets Manager encrypts the secret at rest with an AWS KMS key and all API calls are made over TLS, so the token is protected at rest and in transit. Secrets Manager supports resource-based policies on a secret, and because the secret uses a customer managed KMS key, the key policy can also grant the other accounts permission to decrypt, giving cross-account access with almost no management effort. Option A does not work: a SecureString encrypted with an AWS managed key cannot be used by other accounts, because the key policy of an AWS managed key cannot be changed. Options B and D require the application to encrypt and decrypt the token itself and to manage the storage and its access, which is more overhead.

Need the theory? Learn it free in the DVA-C02 course on Godlike Academy

Practice the whole free set

Answer all 20 free DVA-C02 questions with instant feedback, or unlock all 557 questions with Learn and Exam modes.