Amazon Web ServicesAssociate levelDVA-C02Page 3 of 4

DVA-C02 exam dumps: questions 201 to 300 of 398

Page 3 of the free DVA-C02 question bank for the AWS Certified Developer - Associate exam. Questions 201 to 300 are listed below, the first 5 in full with answers and explanations. Back to page 1 for the exam overview and FAQ.

Question bank last updated December 2024

Free DVA-C02 practice questions

Questions 201 to 205 of 398

Pick an answer before you open the explanation. Each question also has its own page with a permalink.

DVA-C02 Question 201

Single answer

You are deploying a Node.js application to AWS Elastic Beanstalk. The application requires a database connection string, which should not be hardcoded into the application's source code for security purposes. How can you inject the database connection string into the application in a secure and manageable way?

  1. A

    Define the database connection string as an environment variable in the Elastic Beanstalk environment configuration.

  2. B

    Include the database connection string in the application's source code and upload it to Elastic Beanstalk.

  3. C

    Store the database connection string in an AWS Secrets Manager secret and fetch it dynamically within the application.

  4. D

    Use an EC2 instance metadata endpoint to retrieve the database connection string at runtime.

Show answer and explanation

Correct answer: A

Explanation

Environment variables are a secure and manageable way to inject sensitive information, like database connection strings, into applications running on AWS Elastic Beanstalk. This keeps the sensitive data out of the application’s source code and allows for centralized management directly in the Elastic Beanstalk environment configuration.

  • A. Correct.

    This is the correct approach. Elastic Beanstalk allows you to define environment variables in its environment configuration, which can then be accessed by the application. This keeps sensitive information out of the source code while making it manageable.

  • B. Incorrect.

    This is insecure and not recommended because it exposes sensitive information to anyone with access to the source code.

  • C. Incorrect.

    While AWS Secrets Manager is a secure option for storing secrets, this approach would require additional setup and is not directly supported by Elastic Beanstalk's native environment variable configuration mechanism.

  • D. Incorrect.

    The EC2 instance metadata endpoint is not designed for securely retrieving application-specific secrets like database connection strings.

DVA-C02 Question 202

Single answer

You are developing a serverless application using AWS Lambda. The Lambda function needs to connect to an Amazon RDS database, and you must securely pass the database connection details (e.g., username, password, host) to the Lambda function. Which of the following is the BEST way to achieve this while adhering to security best practices?

  1. A

    Hardcode the database connection details directly in the Lambda function code.

  2. B

    Use environment variables in the Lambda function to store the database connection details, and encrypt them using AWS Key Management Service (KMS) keys.

  3. C

    Store the database connection details in an S3 bucket and allow the Lambda function to access the bucket.

  4. D

    Use AWS Secrets Manager to store the database connection details and retrieve them from the Lambda function at runtime.

Show answer and explanation

Correct answer: D

Explanation

The best practice for managing sensitive data such as database connection details in an AWS Lambda function is to use AWS Secrets Manager. Secrets Manager allows you to securely store and retrieve sensitive information while providing features like automatic credential rotation and fine-grained access control. Although environment variables with encryption or S3 storage can be used, Secrets Manager is specifically designed for securely managing secrets and is the recommended approach for this scenario.

  • A. Incorrect.

    Hardcoding sensitive data like database connection details directly in the Lambda function code is not secure and violates security best practices. It also makes it difficult to rotate credentials.

  • B. Incorrect.

    While environment variables can be encrypted using AWS KMS keys, they are not the most secure option for managing sensitive data like database credentials. AWS Secrets Manager offers additional features like automatic credential rotation and fine-grained access control.

  • C. Incorrect.

    Storing sensitive data in an S3 bucket is not recommended unless the data is encrypted and access is tightly controlled. Even then, it is not as secure or convenient as using AWS Secrets Manager.

  • D. Correct.

    AWS Secrets Manager is the best option for storing and managing sensitive data such as database connection details. It provides features like automatic credential rotation, fine-grained permissions, and secure retrieval, making it the most secure and scalable solution.

DVA-C02 Question 203

Single answer

You are developing a serverless application using AWS Lambda, and your function requires access to a database. The database credentials must not be hardcoded in the Lambda function's code. Which is the MOST appropriate way to securely provide the database credentials to the Lambda function?

  1. A

    Use environment variables in the Lambda function configuration to store the database credentials.

  2. B

    Hardcode the database credentials directly in the Lambda function's source code.

  3. C

    Use AWS Secrets Manager to store the database credentials and retrieve them within the Lambda function.

  4. D

    Store the database credentials in an S3 bucket and use the Lambda function to download them at runtime.

Show answer and explanation

Correct answer: C

Explanation

Using AWS Secrets Manager is the most secure and recommended approach for managing sensitive information like database credentials in AWS Lambda. While environment variables can be used, they are not the most secure option. Hardcoding credentials in the source code or storing them in an S3 bucket poses significant security risks. AWS Secrets Manager provides a secure way to store, rotate, and access secrets, making it the ideal choice for this scenario.

  • A. Incorrect.

    Environment variables are commonly used to store configuration data, but they are not the most secure way to manage sensitive information like database credentials. Encrypting the variables with KMS can add security, but AWS Secrets Manager is still better suited for managing sensitive secrets.

  • B. Incorrect.

    Hardcoding sensitive information, such as database credentials, directly in the source code is a poor security practice and should be avoided. This approach increases the risk of accidental exposure, especially in shared repositories.

  • C. Correct.

    AWS Secrets Manager is specifically designed to securely store and manage sensitive information, such as database credentials. You can retrieve the credentials at runtime using the AWS SDK, ensuring they are securely managed and rotated as needed.

  • D. Incorrect.

    Storing sensitive credentials in an S3 bucket is not a secure approach, even if the bucket is private. If the bucket's permissions are misconfigured or compromised, the credentials could be exposed.

DVA-C02 Question 204

Select 2

You are developing a serverless application using AWS Lambda. The Lambda function needs to connect to a database, and the database credentials must not be hardcoded in the function code for security reasons. Which of the following approaches can securely provide the Lambda function with the database credentials?

  1. A

    Store the database credentials as environment variables in the Lambda function configuration and encrypt them using AWS Key Management Service (KMS).

  2. B

    Include the database credentials directly in the Lambda function's code and obfuscate the values using base64 encoding.

  3. C

    Use AWS Secrets Manager to store the database credentials and access them programmatically within the Lambda function.

  4. D

    Pass the database credentials to the Lambda function via the event payload every time the function is invoked.

  5. E

    Store the database credentials in an Amazon S3 bucket and restrict access to the bucket using an IAM policy.

Show answer and explanation

Correct answers: A, C

Explanation

To securely provide sensitive information like database credentials to an AWS Lambda function, you should either use environment variables with KMS encryption or AWS Secrets Manager. Both methods ensure credentials are securely stored and only accessible to authorized entities. Hardcoding, using insecure encoding methods, or relying on less secure storage systems like S3 are not recommended practices.

  • A. Correct.

    This is a valid approach. Storing credentials as environment variables and encrypting them with AWS KMS ensures the credentials are securely stored and only accessible to authorized users or services.

  • B. Incorrect.

    This is not a secure approach. Simply obfuscating credentials using base64 encoding does not provide true security, as encoding can easily be reversed.

  • C. Correct.

    This is a valid approach. AWS Secrets Manager is specifically designed for storing and managing sensitive information like database credentials securely. The Lambda function can retrieve these credentials programmatically at runtime.

  • D. Incorrect.

    Passing sensitive information like database credentials through the event payload is not secure, as it could expose the credentials in logs or to unauthorized users.

  • E. Incorrect.

    Storing sensitive credentials in an Amazon S3 bucket is not recommended, even with IAM restrictions, as it is less secure compared to services like AWS Secrets Manager or Lambda environment variables with KMS encryption.

DVA-C02 Question 205

Single answer

You are developing a serverless application on AWS that requires database credentials to connect to an Amazon RDS instance. The application is deployed using AWS Lambda. To securely manage the database credentials and rotate them automatically, which solution should you implement?

  1. A

    Store the database credentials in AWS Secrets Manager and configure the Lambda function to retrieve them at runtime.

  2. B

    Embed the database credentials directly in the Lambda function's environment variables.

  3. C

    Use AWS Systems Manager Parameter Store with an encrypted parameter to store the database credentials and retrieve them at runtime.

  4. D

    Store the database credentials in an S3 bucket and grant the Lambda function access to the bucket.

Show answer and explanation

Correct answer: A

Explanation

The best practice for managing secrets like database credentials in AWS is to use AWS Secrets Manager. It is specifically designed for securely storing and managing secrets, supports automatic rotation, and integrates seamlessly with AWS Lambda. While AWS Systems Manager Parameter Store is an alternative for securely storing secrets, it does not offer the automatic rotation feature required in this scenario, making AWS Secrets Manager the more suitable choice.

  • A. Correct.

    This is the correct answer. AWS Secrets Manager is designed for securely managing secrets like database credentials, API keys, and tokens. It also supports automatic rotation of secrets and can be easily accessed by AWS Lambda at runtime using the AWS SDK or environment variables.

  • B. Incorrect.

    This is not a secure practice. Embedding credentials directly in the Lambda function's environment variables increases the risk of accidental exposure and does not support automatic rotation.

  • C. Incorrect.

    While AWS Systems Manager Parameter Store can securely store credentials using encrypted parameters, it does not natively provide automatic rotation of secrets, which is a crucial requirement in this scenario.

  • D. Incorrect.

    Storing credentials in an S3 bucket, even if encrypted, is not a recommended practice for secrets management. S3 is not designed for managing sensitive credentials and lacks features like automatic rotation.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam

DVA-C02 practice questions 201 to 300 of 398

Every question has a page with the answer and explanation. Numbers are stable, so you can bookmark or share them. The bank is split into 4 pages of up to 100 questions.

  1. 201.You are deploying a Node.js application to AWS Elastic Beanstalk. The application requires a database...
  2. 202.You are developing a serverless application using AWS Lambda. The Lambda function needs to connect to an...
  3. 203.You are developing a serverless application using AWS Lambda, and your function requires access to a...
  4. 204.You are developing a serverless application using AWS Lambda. The Lambda function needs to connect to a...
  5. 205.You are developing a serverless application on AWS that requires database credentials to connect to an Amazon...
  6. 206.You are developing a serverless application on AWS that uses an AWS Lambda function to connect to a MySQL...
  7. 207.A developer is building a serverless application on AWS that requires database credentials to connect to an...
  8. 208.You are developing a serverless application that runs on AWS Lambda and needs to access a database. The...
  9. 209.You are developing a serverless application on AWS using AWS Lambda. The function needs to access an Amazon...
  10. 210.You are developing a serverless application using AWS Lambda, which needs to interact with an Amazon S3...
  11. 211.You are developing a serverless application using AWS Lambda. The application requires access to an Amazon S3...
  12. 212.A developer is building a serverless application on AWS that requires access to an Amazon S3 bucket to store...
  13. 213.You are developing a serverless application using AWS Lambda and need to deploy the function to multiple...
  14. 214.You are deploying a serverless application using AWS SAM (Serverless Application Model). During the...
  15. 215.You are working on deploying a new version of your application hosted on AWS Elastic Beanstalk. Your team...
  16. 216.You are deploying a Node.js application using AWS Elastic Beanstalk. The application requires a specific...
  17. 217.You are developing a Node.js application that will be deployed to an Auto Scaling group of Amazon EC2...
  18. 218.You are preparing to deploy a Node.js application to AWS using AWS Elastic Beanstalk. The application...
  19. 219.You are tasked with preparing an application for deployment to AWS using AWS CodeDeploy. The application...
  20. 220.You are tasked with deploying a Python-based web application to AWS Elastic Beanstalk. The application...
  21. 221.A developer is working on an application that requires secure access to configuration data and sensitive...
  22. 222.A developer is building a microservices-based application that requires secure access to configuration data...
  23. 223.A developer is building a serverless application on AWS and needs to securely store and frequently retrieve...
  24. 224.A developer is working on a serverless application hosted on AWS Lambda. The application needs to fetch...
  25. 225.You are developing an AWS Lambda function that processes data from an S3 bucket. The function requires a...
  26. 226.You are developing an AWS Lambda function to process images uploaded to an S3 bucket. The function requires a...
  27. 227.You are developing an AWS Lambda function that requires access to a large, external library for data...
  28. 228.A developer is working on an AWS Lambda function that requires an external library not included in the...
  29. 229.You are developing a serverless application using AWS Lambda and API Gateway. Your team uses Git for version...
  30. 230.You are developing a serverless application using AWS Lambda and hosting the source code in a Git repository....
  31. 231.You are developing a serverless application using AWS Lambda and have integrated the codebase with a...
  32. 232.A developer is working on an AWS Lambda function that needs to pull code from a Git-based repository hosted...
  33. 233.You are developing a microservices-based application on AWS. The application consists of multiple...
  34. 234.You are developing a containerized application, and you need to store, manage, and deploy container images...
  35. 235.You are developing a microservices-based application and need to deploy your services as containers using...
  36. 236.You are a developer working on a containerized application. You need to store and manage your container...
  37. 237.You are developing a serverless application using AWS Lambda, and you want to test the application in a...
  38. 238.You are developing an application that uses AWS Lambda functions and interacts with an Amazon DynamoDB table....
  39. 239.You are testing an application in a development environment that interacts with an Amazon DynamoDB table. You...
  40. 240.You are developing a new serverless application using AWS Lambda. The application is currently in the...
  41. 241.A developer is building a serverless application that processes data in real-time using AWS Lambda. The...
  42. 242.A developer is working on an application that processes images uploaded to an Amazon S3 bucket. The...
  43. 243.A developer is building a serverless web application using AWS Lambda functions and Amazon API Gateway. The...
  44. 244.You are developing a serverless application using AWS Lambda. The application requires temporary access to an...
  45. 245.A developer wants to deploy an application to an Amazon ECS cluster with zero downtime. Which AWS service...
  46. 246.Your team is managing a microservices-based application and wants to automate the deployment process across...
  47. 247.You are developing a web application and need to automate the deployment process across multiple environments...
  48. 248.You are a developer tasked with deploying a new version of your application to an EC2-based environment. The...
  49. 249.You are developing a serverless application using AWS Lambda and API Gateway. To perform integration testing,...
  50. 250.You are developing a serverless application using AWS Lambda and API Gateway. To ensure reliable integration...
  51. 251.You are developing a serverless application using AWS Lambda and API Gateway. To validate the integration...
  52. 252.You are developing a serverless application using AWS Lambda and API Gateway. To perform integration testing...
  53. 253.You have deployed a Lambda function for an application using versioning. You want to provide your QA team...
  54. 254.You have developed a Lambda function that processes customer orders. To ensure safe deployments, you use...
  55. 255.You have a Lambda function that is actively in use and needs updates. To ensure that the changes do not...
  56. 256.You are developing an AWS Lambda function that processes data uploaded to an S3 bucket. You have multiple...
  57. 257.You are developing a CI/CD pipeline for your application using AWS CodePipeline. As part of your deployment...
  58. 258.You are working on an application that is deployed using AWS CodePipeline. As part of your deployment...
  59. 259.You are working on an application deployed using AWS CodePipeline. As part of automating deployment testing,...
  60. 260.Your development team is working on an application that is deployed using AWS CodePipeline. To ensure the...
  61. 261.A developer is building a serverless application using AWS Lambda. The application processes images uploaded...
  62. 262.You are developing a serverless application using AWS Lambda and need to securely store and retrieve...
  63. 263.A development team is designing a serverless application using AWS Lambda to process data uploaded to an S3...
  64. 264.You are developing a serverless application using AWS Lambda. One of your Lambda functions needs to access a...
  65. 265.A developer is deploying a new version of an API using Amazon API Gateway. The team wants to enable users to...
  66. 266.You are developing a REST API using Amazon API Gateway. Your team has created multiple stages to manage...
  67. 267.You are developing a serverless application using AWS API Gateway and Lambda. You want to create separate...
  68. 268.A developer is managing an API in Amazon API Gateway and wants to deploy it to different environments like...
  69. 269.You are managing a CI/CD pipeline in AWS CodePipeline for a web application. The pipeline has three stages:...
  70. 270.You are working on a CI/CD pipeline for an application hosted in AWS. The pipeline uses AWS CodePipeline and...
  71. 271.You are working on a CI/CD pipeline using AWS CodePipeline and AWS CodeBuild. Your team uses a GitHub...
  72. 272.You are working on a CI/CD pipeline using AWS CodePipeline to automate your application deployment. The...
  73. 273.A developer is building a serverless application using AWS Lambda and wants to implement unit tests to ensure...
  74. 274.You are developing an AWS Lambda function that interacts with an Amazon DynamoDB table to store user...
  75. 275.You are developing a serverless application using AWS Lambda. To ensure your code is robust and error-free,...
  76. 276.You are a developer working on an application using AWS services. You have a requirement to set up a CI/CD...
  77. 277.You are a developer responsible for deploying an application on AWS using CI/CD services. Your application is...
  78. 278.You are tasked with deploying a new version of your application to an Amazon ECS cluster using AWS...
  79. 279.You are a developer working on an e-commerce application and need to automate the deployment process of your...
  80. 280.You are developing a serverless application on AWS that processes data in real-time using AWS Lambda. The...
  81. 281.You are developing a serverless application using AWS Lambda and need to ensure that your function has access...
  82. 282.You are developing a serverless application using AWS Lambda and need to integrate it with an Amazon S3...
  83. 283.You are developing a serverless application using AWS Lambda and need to securely store sensitive...
  84. 284.You are working on an AWS Lambda-based application that uses a Git-based CI/CD pipeline for deployment. The...
  85. 285.You are working on an AWS Lambda function that is part of a serverless application. Your team uses Git as the...
  86. 286.You are developing a serverless application using AWS Lambda functions. The code for the application is...
  87. 287.A development team is using AWS CodePipeline to automate their CI/CD workflow. The team wants to integrate...
  88. 288.You are developing a CI/CD pipeline using AWS CodePipeline for deploying an application to a production...
  89. 289.You are developing a CI/CD pipeline using AWS CodePipeline for your application. The pipeline must include an...
  90. 290.You are developing a deployment pipeline for a web application using AWS CodePipeline. The pipeline includes...
  91. 291.You are configuring an AWS CodePipeline for an application deployment. The pipeline has multiple stages, and...
  92. 292.You are developing a serverless application on AWS that requires dynamic application configurations and...
  93. 293.You are developing a serverless application in AWS that requires dynamic configuration values and secure...
  94. 294.You are developing a serverless application in AWS Lambda that requires access to runtime configurations and...
  95. 295.Your company uses AWS AppConfig to manage feature flags and AWS Secrets Manager to store sensitive database...
  96. 296.You are a developer working on a CI/CD pipeline for deploying a serverless application built using AWS Lambda...
  97. 297.You are tasked with setting up a CI/CD pipeline for a serverless application using AWS services. The...
  98. 298.You are tasked with setting up a CI/CD pipeline for a serverless application that uses AWS Lambda, Amazon API...
  99. 299.Your development team is building a CI/CD pipeline for a microservices-based application hosted on AWS. The...
  100. 300.You are developing a serverless application that uses AWS Lambda and needs a secure way to manage and deploy...