DVA-C01 : AWS Certified Developer Associate : Part 01
DVA-C01 : AWS Certified Developer Associate : Part 01
-
A Developer created a dashboard for an application using Amazon API Gateway, Amazon S3, AWS Lambda, and Amazon RDS. The Developer needs an authentication mechanism allowing a user to sign in and view the dashboard. It must be accessible from mobile applications, desktops, and tablets, and must remember user preferences across platforms.
Which AWS service should the Developer use to support this authentication scenario?
- AWS KMS
- Amazon Cognito
- AWS Directory Service
- Amazon IAM
-
A Developer has created an S3 bucket s3://mycoolapp and has enabled server across logging that points to the folder s3://mycoolapp/logs. The Developer moved 100 KB of Cascading Style Sheets (CSS) documents to the folder s3://mycoolapp/css, and then stopped work. When the developer came back a few days later, the bucket was 50 GB.
What is the MOST likely cause of this situation?
- The CSS files were not compressed and S3 versioning was enabled.
- S3 replication was enabled on the bucket.
- Logging into the same bucket caused exponential log growth.
- An S3 lifecycle policy has moved the entire CSS file to S3 Infrequent Access.
-
A Developer is creating an Auto Scaling group whose instances need to publish a custom metric to Amazon CloudWatch.
Which method would be the MOST secure way to authenticate a CloudWatch PUT request?
- Create an IAM user with PutMetricData permission and put the user credentials in a private repository; have applications pull the credentials as needed.
- Create an IAM user with PutMetricData permission, and modify the Auto Scaling launch configuration to inject the user credentials into the instance user data.
- Modify the CloudWatch metric policies to allow the PutMetricData permission to instances from the Auto Scaling group.
- Create an IAM role with PutMetricData permission and modify the Auto Scaling launching configuration to launch instances using that role.
-
A Developer is working on an application that tracks hundreds of millions of product reviews in an Amazon DynamoDB table. The records include the data elements shown in the table:
Which field, when used as the partition key, would result in the MOST consistent performance using DynamoDB?
- starRating
- reviewID
- comment
- productID
-
A Developer has written a serverless application using multiple AWS services. The business logic is written as a Lambda function which has dependencies on third-party libraries. The Lambda function endpoints will be exposed using Amazon API Gateway. The Lambda function will write the information to Amazon DynamoDB. The Developer is ready to deploy the application but must have the ability to rollback. How can this deployment be automated, based on these requirements?
- Deploy using Amazon Lambda API operations to create the Lambda function by providing a deployment package.
- Use an AWS CloudFormation template and use CloudFormation syntax to define the Lambda function resource in the template.
- Use syntax conforming to the Serverless Application Model in the AWS CloudFormation template to define the Lambda function resource.
- Create a bash script which uses AWS CLI to package and deploy the application.
-
What are the steps to using the AWS CLI to launch a templatized serverless application?
- Use AWS CloudFormation get-template then CloudFormation execute-change-set.
- Use AWS CloudFormation validate-template then CloudFormation create-change-set.
- Use AWS CloudFormation package then CloudFormation deploy.
- Use AWS CloudFormation create-stack then CloudFormation update-stack.
-
A Developer is creating a web application that requires authentication, but also needs to support guest access to provide users limited access without having to authenticate. What service can provide support for the application to allow guest access?
- IAM temporary credentials using AWS STS.
- Amazon Directory Service
- Amazon Cognito with unauthenticated access enabled
- IAM with SAML integration
-
An application takes 40 seconds to process instructions received in an Amazon SQS message.
Assuming the SQS queue is configured with the default VisibilityTimeout value, what is the BEST way, upon receiving a message, to ensure that no other instances can retrieve a message that has already been processed or is currently being processed?
- Use the ChangeMessageVisibility API to increase the VisibilityTimeout, then use the DeleteMessage API to delete the message.
- Use the DeleteMessage API call to delete the message from the queue, then call DeleteQueue API to remove the queue.
- Use the ChangeMessageVisibility API to decrease the timeout value, then use the DeleteMessage API to delete the message.
- Use the DeleteMessageVisibility API to cancel the VisibilityTimeout, then use the DeleteMessage API to delete the message.
-
A Developer has implemented a Lambda function that needs to add new customers to an RDS database that is expected to run hundreds of times per hour. The Lambda function is configured to use 512MB of RAM and is based on the following pseudo code:
After testing the Lambda function, the Developer notices that the Lambda execution time is much longer than expected. What should the Developer do to improve performance?
- Increase the amount of RAM allocated to the Lambda function, which will increase the number of threads the Lambda can use.
- Increase the size of the RDS database to allow for an increased number of database connections each hour.
- Move the database connection and close statement out of the handler. Place the connection in the global space.
- Replace RDS wit Amazon DynamoDB to implement control over the number of writes per second.
-
A current architecture uses many Lambda functions invoking one another as a large state machine. The coordination of this state machine is legacy custom code that breaks easily.
Which AWS Service can help refactor and manage the state machine?
- AWS Data Pipeline
- AWS SNS with AWS SQS
- Amazon Elastic MapReduce
- AWS Step Functions
-
A Developer is asked to implement a caching layer in front of Amazon RDS. Cached content is expensive to regenerate in case of service failure. Which implementation below would work while maintaining maximum uptime?
- Implement Amazon ElastiCache Redis in Cluster Mode
- Install Redis on an Amazon EC2 instance.
- Implement Amazon ElastiCache Memcached.
- Migrate the database to Amazon Redshift.
-
A current architecture uses many Lambda functions invoking one another as large state machine. The coordination of this state machine is legacy custom code that breaks easily.
Which AWS Service can help refactor and manage the state machine?
- AWS Data Pipeline
- AWS SNS with AWS SQS
- Amazon Elastic MapReduce
- AWS Step Functions
-
A large e-commerce site is being designed to deliver static objects from Amazon S3. The Amazon S3 bucket will server more than 300 GET requests per second. What should be done to optimize performance? (Choose two.)
- Integrate Amazon CloudFront with Amazon S3.
- Enable Amazon S3 cross-region replication.
- Delete expired Amazon S3 server log files.
- Configure Amazon S3 lifecycle rules.
- Randomize Amazon S3 key name prefixes.
-
A company is building a stock trading application that requires sub-millisecond latency in processing trading requests. Amazon DynamoDB is used to store all the trading data that is used to process each request. After load testing the application, the development team found that due to data retrieval times, the latency requirement is not satisfied. Because of sudden high spikes in the number of requests, DynamoDB read capacity has to be significantly over-provisioned to avoid throttling.
What steps should be taken to meet latency requirements and reduce the cost of running the application?
- Add Global Secondary Indexes for trading data.
- Store trading data in Amazon S3 and use Transfer Acceleration.
- Add retries with exponential back-off for DynamoDB queries
- Use DynamoDB Accelerator to cache trading data.
-
A Developer needs temporary access to resources in a second account.
What is the MOST secure way to achieve this?
- Use the Amazon Cognito user pools to get short-lived credentials for the second account.
- Create a dedicated IAM access key for the second account, and send it by mail.
- Create a cross-account access role, and use sts:AssumeRole API to get short-lived credentials.
- Establish trust, and add an SSH key for the second account to the IAM user.
-
An application reads data from an Amazon DynamoDB table. Several times a day, for a period of 15 seconds, the application receives multiple ProvisionedThroughputExceeded errors.
How should this exception be handled?
- Create a new global secondary index for the table to help with the additional requests.
- Retry the failed read requests with exponential backoff.
- Immediately retry the failed read requests.
- Use the DynamoDB “UpdateItem” API to increase the provisioned throughput capacity of the table.
-
A Developer has created a large Lambda function, and deployment is failing with the following error:
ClientError: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: Unzipped size must be smaller than XXXXXXXXX bytes’, where XXXXXXXXX is the current Lambda limit
What can the Developer do to fix this problem?
- Submit a limit increase request to AWS Support to increase the function to the size needed.
- Use a compression algorithm that is more efficient than ZIP.
- Break the function into multiple smaller Lambda functions.
- ZIP the ZIP file twice to compress it further.
-
Given the source code for an AWS Lambda function in the local store.py containing a handler function called get_store and the following AWS CloudFormation template:
What should be done to prepare the template so that it can be deployed using the AWS CLI command aws cloudformation deploy?
- Use aws cloudformation compile to base64 encode and embed the source file into a modified CloudFormation template.
- Use aws cloudformation package to upload the source code to an Amazon S3 bucket and produce a modified CloudFormation template.
- Use aws lambda zip to package the source file together with the CloudFormation template and deploy the resulting zip archive.
- Use aws serverless create-package to embed the source file directly into the existing CloudFormation template.
-
An application stores images in an S3 bucket. Amazon S3 event notifications are used to trigger a Lambda function that resizes the images. Processing each image takes less than a second.
How will AWS Lambda handle the additional traffic?
- Lambda will scale out to execute the requests concurrently.
- Lambda will handle the requests sequentially in the order received.
- Lambda will process multiple images in a single execution.
- Lambda will add more compute to each execution to reduce processing time.
-
A company wants to implement a continuous integration for its workloads on AWS. The company wants to trigger unit test in its pipeline for commits-on its code repository, and wants to be notified of failure events in the pipeline.
How can these requirements be met?
- Store the source code in AWS CodeCommit. Create a CodePipeline to automate unit testing. Use Amazon SNS to trigger notifications of failure events.
- Store the source code in GitHub. Create a CodePipeline to automate unit testing. Use Amazon SES to trigger notifications of failure events.
- Store the source code on GitHub. Create a CodePipeline to automate unit testing. Use Amazon CloudWatch to trigger notifications of failure events.
- Store the source code in AWS CodeCommit. Create a CodePipeline to automate unit testing. Use Amazon CloudWatch to trigger notification of failure events.