Free preview mode
Enjoy the free questions and consider upgrading to gain full access!
AWS Certified Developer - Associate DVA-C02
Free trial
Verified
Question 76
A developer at a company needs to create a small application that makes the same API call once each day at a designated time. The company does not have infrastructure in the AWS Cloud yet, but the company wants to implement this functionality on AWS.
Which solution meets these requirements in the MOST operationally efficient manner?
- A: Use a Kubernetes cron job that runs on Amazon Elastic Kubernetes Service (Amazon EKS).
- B: Use an Amazon Linux crontab scheduled job that runs on Amazon EC2.
- C: Use an AWS Lambda function that is invoked by an Amazon EventBridge scheduled event.
- D: Use an AWS Batch job that is submitted to an AWS Batch job queue.
Question 77
A developer is building a serverless application that is based on AWS Lambda. The developer initializes the AWS software development kit (SDK) outside of the Lambda handler function.
What is the PRIMARY benefit of this action?
- A: Improves legibility and stylistic convention
- B: Takes advantage of runtime environment reuse
- C: Provides better error handling
- D: Creates a new SDK instance for each invocation
Question 78
A company is using Amazon RDS as the backend database for its application. After a recent marketing campaign, a surge of read requests to the database increased the latency of data retrieval from the database. The company has decided to implement a caching layer in front of the database. The cached content must be encrypted and must be highly available.
Which solution will meet these requirements?
- A: Amazon CloudFront
- B: Amazon ElastiCache for Memcached
- C: Amazon ElastiCache for Redis in cluster mode
- D: Amazon DynamoDB Accelerator (DAX)
Question 79
For a deployment using AWS Code Deploy, what is the run order of the hooks for in-place deployments?
- A: BeforeInstall -> ApplicationStop -> ApplicationStart -> AfterInstall
- B: ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart
- C: BeforeInstall -> ApplicationStop -> ValidateService -> ApplicationStart
- D: ApplicationStop -> BeforeInstall -> ValidateService -> ApplicationStart
Question 80
A developer at a company recently created a serverless application to process and show data from business reports. The application’s user interface (UI) allows users to select and start processing the files. The UI displays a message when the result is available to view. The application uses AWS Step Functions with AWS Lambda functions to process the files. The developer used Amazon API Gateway and Lambda functions to create an API to support the UI.
The company’s UI team reports that the request to process a file is often returning timeout errors because of the size or complexity of the files. The UI team wants the API to provide an immediate response so that the UI can display a message while the files are being processed. The backend process that is invoked by the API needs to send an email message when the report processing is complete.
What should the developer do to configure the API to meet these requirements?
- A: Change the API Gateway route to add an X-Amz-Invocation-Type header with a static value of ‘Event’ in the integration request. Deploy the API Gateway stage to apply the changes.
- B: Change the configuration of the Lambda function that implements the request to process a file. Configure the maximum age of the event so that the Lambda function will run asynchronously.
- C: Change the API Gateway timeout value to match the Lambda function timeout value. Deploy the API Gateway stage to apply the changes.
- D: Change the API Gateway route to add an X-Amz-Target header with a static value of ‘Async’ in the integration request. Deploy the API Gateway stage to apply the changes.
Question 81
A developer has an application that is composed of many different AWS Lambda functions. The Lambda functions all use some of the same dependencies. To avoid security issues, the developer is constantly updating the dependencies of all of the Lambda functions. The result is duplicated effort for each function.
How can the developer keep the dependencies of the Lambda functions up to date with the LEAST additional complexity?
- A: Define a maintenance window for the Lambda functions to ensure that the functions get updated copies of the dependencies.
- B: Upgrade the Lambda functions to the most recent runtime version.
- C: Define a Lambda layer that contains all of the shared dependencies.
- D: Use an AWS CodeCommit repository to host the dependencies in a centralized location.
Question 82
A mobile app stores blog posts in an Amazon DynamoDB table. Millions of posts are added every day, and each post represents a single item in the table. The mobile app requires only recent posts. Any post that is older than 48 hours can be removed.
What is the MOST cost-effective way to delete posts that are older than 48 hours?
- A: For each item, add a new attribute of type String that has a timestamp that is set to the blog post creation time. Create a script to find old posts with a table scan and remove posts that are older than 48 hours by using the BatchWriteItem API operation. Schedule a cron job on an Amazon EC2 instance once an hour to start the script.
- B: For each item, add a new attribute of type String that has a timestamp that is set to the blog post creation time. Create a script to find old posts with a table scan and remove posts that are older than 48 hours by using the BatchWriteItem API operation. Place the script in a container image. Schedule an Amazon Elastic Container Service (Amazon ECS) task on AWS Fargate that invokes the container every 5 minutes.
- C: For each item, add a new attribute of type Date that has a timestamp that is set to 48 hours after the blog post creation time. Create a global secondary index (GSI) that uses the new attribute as a sort key. Create an AWS Lambda function that references the GSI and removes expired items by using the BatchWriteItem API operation. Schedule the function with an Amazon CloudWatch event every minute.
- D: For each item, add a new attribute of type Number that has a timestamp that is set to 48 hours after the blog post creation time. Configure the DynamoDB table with a TTL that references the new attribute.
Question 83
A developer is modifying an existing AWS Lambda function. While checking the code, the developer notices hardcoded parameter values for an Amazon RDS for SQL Server user name, password, database, host, and port. There are also hardcoded parameter values for an Amazon DynamoDB table, an Amazon S3 bucket, and an Amazon Simple Notification Service (Amazon SNS) topic.
The developer wants to securely store the parameter values outside the code in an encrypted format and wants to turn on rotation for the credentials. The developer also wants to be able to reuse the parameter values from other applications and to update the parameter values without modifying code.
Which solution will meet these requirements with the LEAST operational overhead?
- A: Create an RDS database secret in AWS Secrets Manager. Set the user name, password, database, host, and port. Turn on secret rotation. Create encrypted Lambda environment variables for the DynamoDB table, S3 bucket, and SNS topic.
- B: Create an RDS database secret in AWS Secrets Manager. Set the user name, password, database, host, and port. Turn on secret rotation. Create SecureString parameters in AWS Systems Manager Parameter Store for the DynamoDB table, S3 bucket, and SNS topic.
- C: Create RDS database parameters in AWS Systems Manager Parameter Store for the user name, password, database, host, and port. Create encrypted Lambda environment variables for the DynamoDB table, S3 bucket, and SNS topic. Create a Lambda function and set the logic for the credentials rotation task. Schedule the credentials rotation task in Amazon EventBridge.
- D: Create RDS database parameters in AWS Systems Manager Parameter Store for the user name, password, database, host, and port. Store the DynamoDB table, S3 bucket, and SNS topic in Amazon S3. Create a Lambda function and set the logic for the credentials rotation. Invoke the Lambda function on a schedule.
Question 84
A developer accesses AWS CodeCommit over SSH. The SSH keys configured to access AWS CodeCommit are tied to a user with the following permissions:
The developer needs to create/delete branches.
Which specific IAM permissions need to be added, based on the principle of least privilege?
- A: "codecommit:CreateBranch" "codecommit:DeleteBranch"
- B: "codecommit:Put*"
- C: "codecommit:Update*"
- D: "codecommit:*"
Question 85
An application that is deployed to Amazon EC2 is using Amazon DynamoDB. The application calls the DynamoDB REST API. Periodically, the application receives a ProvisionedThroughputExceededException error when the application writes to a DynamoDB table.
Which solutions will mitigate this error MOST cost-effectively? (Choose two.)
- A: Modify the application code to perform exponential backoff when the error is received.
- B: Modify the application to use the AWS SDKs for DynamoDB.
- C: Increase the read and write throughput of the DynamoDB table.
- D: Create a DynamoDB Accelerator (DAX) cluster for the DynamoDB table.
- E: Create a second DynamoDB table. Distribute the reads and writes between the two tables.
Question 86
When a developer tries to run an AWS CodeBuild project, it raises an error because the length of all environment variables exceeds the limit for the combined maximum of characters.
What is the recommended solution?
- A: Add the export LC_ALL="en_US.utf8" command to the pre_build section to ensure POSIX localization.
- B: Use Amazon Cognito to store key-value pairs for large numbers of environment variables.
- C: Update the settings for the build project to use an Amazon S3 bucket for large numbers of environment variables.
- D: Use AWS Systems Manager Parameter Store to store large numbers of environment variables.
Question 87
A company is expanding the compatibility of its photo-sharing mobile app to hundreds of additional devices with unique screen dimensions and resolutions. Photos are stored in Amazon S3 in their original format and resolution. The company uses an Amazon CloudFront distribution to serve the photos. The app includes the dimension and resolution of the display as GET parameters with every request.
A developer needs to implement a solution that optimizes the photos that are served to each device to reduce load time and increase photo quality.
Which solution will meet these requirements MOST cost-effectively?
- A: Use S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a dynamic CloudFront origin that automatically maps the request of each device to the corresponding photo variant.
- B: Use S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a Lambda@Edge function to route requests to the corresponding photo variant by using request headers.
- C: Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. Change the CloudFront TTL cache policy to the maximum value possible.
- D: Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. In the same function, store a copy of the processed photos on Amazon S3 for subsequent requests.
Question 88
A company is building an application for stock trading. The application needs sub-millisecond latency for processing trade requests. The company uses Amazon DynamoDB to store all the trading data that is used to process each trading request.
A development team performs load testing on the application and finds that the data retrieval time is higher than expected. The development team needs a solution that reduces the data retrieval time with the least possible effort.
Which solution meets these requirements?
- A: Add local secondary indexes (LSIs) for the trading data.
- B: Store the trading data in Amazon S3, and use S3 Transfer Acceleration.
- C: Add retries with exponential backoff for DynamoDB queries.
- D: Use DynamoDB Accelerator (DAX) to cache the trading data.
Question 89
A developer is working on a Python application that runs on Amazon EC2 instances. The developer wants to enable tracing of application requests to debug performance issues in the code.
Which combination of actions should the developer take to achieve this goal? (Choose two.)
- A: Install the Amazon CloudWatch agent on the EC2 instances.
- B: Install the AWS X-Ray daemon on the EC2 instances.
- C: Configure the application to write JSON-formatted logs to /var/log/cloudwatch.
- D: Configure the application to write trace data to /var/log/xray.
- E: Install and configure the AWS X-Ray SDK for Python in the application.
Question 90
A company is building a serverless application on AWS. The application uses an AWS Lambda function to process customer orders 24 hours a day, 7 days a week. The Lambda function calls an external vendor's HTTP API to process payments.
During load tests, a developer discovers that the external vendor payment processing API occasionally times out and returns errors. The company expects that some payment processing API calls will return errors.
The company wants the support team to receive notifications in near real time only when the payment processing external API error rate exceed 5% of the total number of transactions in an hour. Developers need to use an existing Amazon Simple Notification Service (Amazon SNS) topic that is configured to notify the support team.
Which solution will meet these requirements?
- A: Write the results of payment processing API calls to Amazon CloudWatch. Use Amazon CloudWatch Logs Insights to query the CloudWatch logs. Schedule the Lambda function to check the CloudWatch logs and notify the existing SNS topic.
- B: Publish custom metrics to CloudWatch that record the failures of the external payment processing API calls. Configure a CloudWatch alarm to notify the existing SNS topic when error rate exceeds the specified rate.
- C: Publish the results of the external payment processing API calls to a new Amazon SNS topic. Subscribe the support team members to the new SNS topic.
- D: Write the results of the external payment processing API calls to Amazon S3. Schedule an Amazon Athena query to run at regular intervals. Configure Athena to send notifications to the existing SNS topic when the error rate exceeds the specified rate.
Question 91
A company has an application that runs as a series of AWS Lambda functions. Each Lambda function receives data from an Amazon Simple Notification Service (Amazon SNS) topic and writes the data to an Amazon Aurora DB instance.
To comply with an information security policy, the company must ensure that the Lambda functions all use a single securely encrypted database connection string to access Aurora.
Which solution will meet these requirements?
- A: Use IAM database authentication for Aurora to enable secure database connections for all the Lambda functions.
- B: Store the credentials and read the credentials from an encrypted Amazon RDS DB instance.
- C: Store the credentials in AWS Systems Manager Parameter Store as a secure string parameter.
- D: Use Lambda environment variables with a shared AWS Key Management Service (AWS KMS) key for encryption.
Question 92
A developer is troubleshooting an Amazon API Gateway API. Clients are receiving HTTP 400 response errors when the clients try to access an endpoint of the API.
How can the developer determine the cause of these errors?
- A: Create an Amazon Kinesis Data Firehose delivery stream to receive API call logs from API Gateway. Configure Amazon CloudWatch Logs as the delivery stream’s destination.
- B: Turn on AWS CloudTrail Insights and create a trail. Specify the Amazon Resource Name (ARN) of the trail for the stage of the API.
- C: Turn on AWS X-Ray for the API stage. Create an Amazon CloudWatch Logs log group. Specify the Amazon Resource Name (ARN) of the log group for the API stage.
- D: Turn on execution logging and access logging in Amazon CloudWatch Logs for the API stage. Create a CloudWatch Logs log group. Specify the Amazon Resource Name (ARN) of the log group for the API stage.
Question 93
A company developed an API application on AWS by using Amazon CloudFront, Amazon API Gateway, and AWS Lambda. The API has a minimum of four requests every second. A developer notices that many API users run the same query by using the POST method. The developer wants to cache the POST request to optimize the API resources.
Which solution will meet these requirements?
- A: Configure the CloudFront cache. Update the application to return cached content based upon the default request headers.
- B: Override the cache method in the selected stage of API Gateway. Select the POST method.
- C: Save the latest request response in Lambda /tmp directory. Update the Lambda function to check the /tmp directory.
- D: Save the latest request in AWS Systems Manager Parameter Store. Modify the Lambda function to take the latest request response from Parameter Store.
Question 94
A company is building a microservices application that consists of many AWS Lambda functions. The development team wants to use AWS Serverless Application Model (AWS SAM) templates to automatically test the Lambda functions. The development team plans to test a small percentage of traffic that is directed to new updates before the team commits to a full deployment of the application.
Which combination of steps will meet these requirements in the MOST operationally efficient way? (Choose two.)
- A: Use AWS SAM CLI commands in AWS CodeDeploy to invoke the Lambda functions to test the deployment.
- B: Declare the EventInvokeConfig on the Lambda functions in the AWS SAM templates with OnSuccess and OnFailure configurations.
- C: Enable gradual deployments through AWS SAM templates.
- D: Set the deployment preference type to Canary10Percent30Minutes. Use hooks to test the deployment.
- E: Set the deployment preference type to Linear10PercentEvery10Minutes. Use hooks to test the deployment.
Question 95
A company is using AWS CloudFormation to deploy a two-tier application. The application will use Amazon RDS as its backend database. The company wants a solution that will randomly generate the database password during deployment. The solution also must automatically rotate the database password without requiring changes to the application.
What is the MOST operationally efficient solution that meets these requirements?
- A: Use an AWS Lambda function as a CloudFormation custom resource to generate and rotate the password.
- B: Use an AWS Systems Manager Parameter Store resource with the SecureString data type to generate and rotate the password.
- C: Use a cron daemon on the application’s host to generate and rotate the password.
- D: Use an AWS Secrets Manager resource to generate and rotate the password.
Question 96
A developer has been asked to create an AWS Lambda function that is invoked any time updates are made to items in an Amazon DynamoDB table. The function has been created, and appropriate permissions have been added to the Lambda execution role. Amazon DynamoDB streams have been enabled for the table, but the function is still not being invoked.
Which option would enable DynamoDB table updates to invoke the Lambda function?
- A: Change the StreamViewType parameter value to NEW_AND_OLD_IMAGES for the DynamoDB table.
- B: Configure event source mapping for the Lambda function.
- C: Map an Amazon Simple Notification Service (Amazon SNS) topic to the DynamoDB streams.
- D: Increase the maximum runtime (timeout) setting of the Lambda function.
Question 97
A developer needs to deploy an application running on AWS Fargate using Amazon ECS. The application has environment variables that must be passed to a container for the application to initialize.
How should the environment variables be passed to the container?
- A: Define an array that includes the environment variables under the environment parameter within the service definition.
- B: Define an array that includes the environment variables under the environment parameter within the task definition.
- C: Define an array that includes the environment variables under the entryPoint parameter within the task definition.
- D: Define an array that includes the environment variables under the entryPoint parameter within the service definition.
Question 98
A development team maintains a web application by using a single AWS RDS, template. The template defines web servers and an Amazon RDS database. The team uses the CloudFormation template to deploy the CloudFormation stack to different environments.
During a recent application deployment, a developer caused the primary development database to be dropped and recreated. The result of this incident was a loss of data. The team needs to avoid accidental database deletion in the future.
Which solutions will meet these requirements? (Choose two.)
- A: Add a CloudFormation DeletionPolicy attribute with the Retain value to the database resource.
- B: Update the CloudFormation stack policy to prevent updates to the database.
- C: Modify the database to use a Multi-AZ deployment.
- D: Create a CloudFormation stack set for the web application and database deployments.
- E: Add a CloudFormation DeletionPolicy attribute with the Retain value to the stack.
Question 99
A developer is storing sensitive data generated by an application in Amazon S3. The developer wants to encrypt the data at rest. A company policy requires an audit trail of when the AWS Key Management Service (AWS KMS) key was used and by whom.
Which encryption option will meet these requirements?
- A: Server-side encryption with Amazon S3 managed keys (SSE-S3)
- B: Server-side encryption with AWS KMS managed keys (SSE-KMS)
- C: Server-side encryption with customer-provided keys (SSE-C)
- D: Server-side encryption with self-managed keys
Question 100
A company has an ecommerce application. To track product reviews, the company’s development team uses an Amazon DynamoDB table.
Every record includes the following:
• A Review ID, a 16-digit universally unique identifier (UUID)
• A Product ID and User ID, 16-digit UUIDs that reference other tables
• A Product Rating on a scale of 1-5
• An optional comment from the user
The table partition key is the Review ID. The most performed query against the table is to find the 10 reviews with the highest rating for a given product.
Which index will provide the FASTEST response for this query?
- A: A global secondary index (GSI) with Product ID as the partition key and Product Rating as the sort key
- B: A global secondary index (GSI) with Product ID as the partition key and Review ID as the sort key
- C: A local secondary index (LSI) with Product ID as the partition key and Product Rating as the sort key
- D: A local secondary index (LSI) with Review ID as the partition key and Product ID as the sort key
Free preview mode
Enjoy the free questions and consider upgrading to gain full access!