DVA-C01 : AWS Certified Developer Associate : Part 17
DVA-C01 : AWS Certified Developer Associate : Part 17
-
A developer has created a REST API using Amazon API Gateway. The developer wants to log who and how each caller accesses the API. The developer also wants to control how long the logs are kept.
What should the developer do to meet these requirements?
- Enable API Gateway execution logging. Delete old logs using API Gateway retention settings.
- Enable API Gateway access logs. Use Amazon CloudWatch retention settings to delete old logs.
- Enable detailed Amazon CloudWatch metrics. Delete old logs with a recurring AWS Lambda function.
- Create and use API Gateway usage plans. Delete old logs with a recurring AWS Lambda function.
-
A company is developing a new web application in Python. A developer must deploy the application using AWS Elastic Beanstalk from the AWS Management Console. The developer creates an Elastic Beanstalk source bundle to upload using the console.
Which of the following are requirements when creating the source bundle? (Choose two.)
- The source bundle must include the ebextensions.yaml file
- The source bundle must not include a top-level directory
- The source bundle must be compressed with any required dependencies in a top-level parent folder
- The source bundle must be created as a single .zip or .war file
- The source bundle must be uploaded into Amazon EFS
-
A developer is creating a role to access Amazon S3 buckets. To create the role, the developer uses the AWS CLI create-role command.
Which policy should be added to allow the Amazon EC2 service to assume the role?
- Managed policy
- Trust policy
- Inline policy
- Service control policy (SCP)
-
A company is running a custom application on a set of on-premises Linux servers that are accessed using Amazon API Gateway. AWS X-Ray tracing has been enabled on the API test stage.
How can a developer enable X-Ray tracing on the on-premises servers with the LEAST amount of configuration?
- Install and run the X-Ray SDK on the on-premises servers to capture and relay the data to the X-Ray service.
- Install and run the X-Ray daemon on the on-premises servers to capture and relay the data to the X-Ray service.
- Capture incoming requests on-premises and configure an AWS Lambda function to pull, process, and relay relevant data to X-Ray using the PutTraceSegments API call.
- Capture incoming requests on-premises and configure an AWS Lambda function to pull, process, and relay relevant data to X-Ray using the PutTelemetryRecords API call.
-
A developer works in an environment with multiple AWS accounts that have AWS Lambda functions processing the same 100 KB payloads. The developer wants to centralize the point of origin of the payloads to one account and have all the Lambda functions be invoked whenever the initiating event occurs in the parent account.
How can the developer design the workflow in the MOST efficient way, so all the multi-account Lambda functions get invoked when the event occurs?
- Create a Lambda function in the parent account and use cross-account IAM roles with the AWS Security Token Service (AWS STS) AssumeRole API call to make AWS Lambda invoke the API call to invoke all the cross-account Lambda functions.
- Subscribe all the multi-account Lambda functions to an Amazon SNS topic and make a SNS Publish API call with the payload to the SNS topic.
- Set up an Amazon SQS queue with the queue policy permitting the ReceiveMessage action for multi-account Lambda functions. Then send the payload to the SQS queue using the sqs:SendMessage permission and poll the queue using multi-account Lambda functions.
- Use a worker on an Amazon EC2 instance to poll for the payload event. Invoke all Lambda functions using the Lambda Invoke API after using cross-account IAM roles with the AWS Security Token Service (AWS STS) AssumeRole API call.
-
A large company has its application components distributed across multiple AWS accounts. The company needs to collect and visualize trace data across these accounts.
What should be used to meet these requirements?
- AWS X-Ray
- Amazon CloudWatch
- Amazon VPC flow logs
- Amazon Elasticsearch Service
-
A development team uses AWS Elastic Beanstalk to deploy a Java-based web application. The team wants to ensure that the changes to the source code and the configuration are always deployed on new instances. The team configures the Elastic Beanstalk environment to use immutable updates. However, an error occurs the first time a change is deployed with the new update policy.
What is the MOST likely cause of this issue?
- Immutable updates are not supported for Java-based applications.
- The account has reached its on-demand instance limit.
- Immutable updates are only supported for m4.large and larger instance types.
- The developer must also modify the .ebextensions/immutable-updates.config file to enable immutable updates.
-
A developer tested an application locally and then deployed it to AWS Lambda. While testing the application remotely, the Lambda function fails with an access denied message.
How can this issue be addressed?
- Update the Lambda function’s execution role to include the missing permissions.
- Update the Lambda function’s resource policy to include the missing permissions.
- Include an IAM policy document at the root of the deployment package and redeploy the Lambda function.
- Redeploy the Lambda function using an account with access to the AdministratorAccess policy.
-
An application contains two components: one component to handle HTTP requests, and another component to handle background processing tasks. Each component must scale independently. The developer wants to deploy this application using AWS Elastic Beanstalk.
How should this application be deployed, based on these requirements?
- Deploy the application in a single Elastic Beanstalk environment.
- Deploy each component in a separate Elastic Beanstalk environment.
- Use multiple Elastic Beanstalk environments for the HTTP component, but one environment for the background task component.
- Use multiple Elastic Beanstalk environments for the background task component, but one environment for the HTTP component.
-
A company experienced partial downtime during the last deployment of a new application. AWS Elastic Beanstalk split the environment’s Amazon EC2 instances into batches and deployed a new version one batch at a time after taking them out of service. Therefore, full capacity was not maintained during deployment.
The developer plans to release a new version of the application, and is looking for a policy that will maintain full capacity and minimize the impact of the failed deployment.
Which deployment policy should the developer use?
- Immutable
- All at Once
- Rolling
- Rolling with an Additional Batch
-
An application running on multiple Amazon EC2 instances pulls messages from a standard Amazon SQS queue. A requirement for the application is that all messages must be encrypted at rest.
Developers are instructed to use methods that allow for centralized key management and minimize possible support requirements whenever possible.
Which of the following solutions supports these requirements?
- Encrypt individual messages by using client-side encryption with customer managed keys, then write to the SQS queue.
- Encrypt individual messages by using SQS Extended Client and the Amazon S3 encryption client.
- Create an SQS queue, and encrypt the queue by using sewer-side encryption with AWS KMS.
- Create an SQS queue, and encrypt the queue by using client-side encryption.
-
A company is developing a serverless ecommerce web application. The application needs to make coordinated, all-or-nothing changes to multiple items in the company’s inventory table in Amazon DynamoDB.
Which solution will meet these requirements?
- Enable transactions for the DynamoDB table. Use the BatchWriteItem operation to update the items.
- Use the TransactWriteItems operation to group the changes. Update the items in the table.
- Set up a FIFO queue using Amazon SQS. Group the changes in the queue. Update the table based on the grouped changes.
- Create a transaction table in an Amazon Aurora DB cluster to manage the transactions. Write a backend process to sync the Aurora DB table and the DynamoDB table.
-
How can a developer use a debugger for AWS Lambda code that is deployed with AWS Serverless Application Model (AWS SAM)?
- Download the Lambda code locally and use the AWS CLI to execute it
- Use the Lambda console to connect the debugger
- Use AWS SAM to invoke a function locally in debug mode
- Connect a third-party-compatible integrated development environment (IDE) to the Lambda debugger endpoint
-
An application takes longer than expected to process an Amazon SQS message.
What should the developer do to the application so that other instances do not pick up the same message?
- Make a ReceiveMessage call to get the same message again from the queue
- Issue a DeleteMessage call to delete the message from the queue
- Use SendMessage to pass the message to the dead letter queue
- Send a ChangeMessageVisibility call to extend VisibilityTimeout
-
A developer is building a WebSocket API using Amazon API Gateway. The payload sent to this API is JSON that includes an action key. This key can have three different values: create, update, and remove. The developer must integrate with different routes based on the value of the action key of the incoming JSON payload.
How can the developer accomplish this task with the LEAST amount of configuration?
- Deploy the WebSocket API to three stages for the respective routes: create, update, and remove
- Create a new route key and set the name as action
- Set the value of the route selection expression to action
- Set the value of the route selection expression to $request.body.action
-
A development team is creating a new application designed to run on AWS. While the test and production environments will run on Amazon EC2 instances, developers will each run their own environment on their laptops.
Which of the following is the simplest and MOST secure way to access AWS services from the local development machines?
- Use an IAM role to assume a role and execute API calls using the role.
- Create an IAM user to be shared with the entire development team; provide the development team with the access key.
- Create an IAM user for each developer on the team; provide each developer with a unique access key.
- Set up a federation through an Amazon Cognito user pool.
-
A developer wants to ensure the Amazon EC2 instances in AWS Elastic Beanstalk execute a certain set of commands before the application is ready to use.
Which Elastic Beanstalk feature will allow the developer to accomplish this?
- Rolling update
- Immutable update
- User data
- .ebextensions
-
A developer is planning to use an Amazon API Gateway and AWS Lambda to provide a REST API. The developer will have three distinct environments to manage: development, test, and production.
How should the application be deployed while minimizing the number of resources to manage?
- Create a separate API Gateway and separate Lambda function for each environment in the same Region.
- Assign a Region for each environment and deploy API Gateway and Lambda to each Region.
- Create one API Gateway with multiple stages with one Lambda function with multiple aliases.
- Create one API Gateway and one Lambda function, and use a REST parameter to identify the environment.
-
A developer is creating an application to process a large number of requests. Requests must be processed in order, and each request should be processed only once.
How should Amazon SQS be deployed to achieve this?
- Configure First in First out (FIFO) delivery in a standard Amazon SQS queue to process requests.
- Use an SQS FIFO queue to process requests.
- Use the SetOrder attribute to ensure sequential request processing.
- Convert the standard queue to a FIFO queue by renaming the queue to use the .fifo suffix.
-
An application is using a custom library to make HTTP calls directly to AWS service endpoints. The application is experiencing transient errors that are causing processes to stop when each error is first encountered. A request has been made to make the application more resilient by adding error retries and exponential backoff.
How should a developer implement the changes with MINIMAL custom code?
- Add a Retry-After HTTP header to API requests
- Use the AWS CLI to configure the retry settings in a named profile
- Change the custom library to retry on 5xx errors only
- Use an AWS SDK and set retry-specific configurations