AWS Certified Developer Associate practice questions, page 16 of 18, with answer review and explanations.
Question 76
An ecommerce company wants to redirect users to a country-specific website when they enter the example.com website. For example, the company wants to redirect United States users to example.com/us/ and wants to redirect French users to example.com/fr/. The web application is using Amazon CloudFront and an Application Load Balancer with an Amazon Elastic Container Service (Amazon ECS) cluster. The application's domain name resolution is configured in an Amazon Route 53 public hosted zone. Which solution will meet these requirements with the LEAST operational effort?
Update the routing policy for the application's Route 53 record to specify geolocation routing. Configure listener rules based on a unique alias location to redirect requests to the correct URLs by country.
Create a CloudFront function to inspect the CloudFront-Viewer-Country header and return redirect responses to different URLs based on user location.
On the ECS web server configuration, use a GeoIP database to look up the requested IP address and redirect requests to the correct URLs by country.
Use AWS WAF to determine the country of origin. Create an AWS WAF custom rule with a geographic match condition to redirect traffic from each country to the correct URL.
Question 77
A developer deploys an AWS Lambda function that runs each time a new Amazon S3 bucket is created. The Lambda function is supposed to attach an S3 Lifecycle policy to each new S3 bucket. The developer discovers that newly created S3 buckets have no S3 Lifecycle policy attached. Which AWS service should the developer use to find a possible error in the Lambda function?
AWS CloudTrail
Amazon S3
AWS CloudFormation
Amazon CloudWatch
Question 78
A developer has created a web API that uses Amazon Elastic Container Service (Amazon ECS) and an Application Load Balancer (ALB). An Amazon CloudFront distribution uses the API as an origin for web clients. The application has received millions of requests with a JSON Web Token (JWT) that is not valid in the authorization header. The developer has scaled out the application to handle the unauthenticated requests. What should the developer do to reduce the number of unauthenticated requests to the API?
Add a request routing rule to the ALB to return a 401 status code if the authorization header is missing.
Add a container to the ECS task definition to validate JWTs Set the new container as a dependency of the application container.
Create a CloudFront function for the distribution Use the crypto module in the function to validate the JWT.
Add a custom authorizer for AWS Lambda to the CloudFront distribution to validate the JWT.
Question 79
A developer is creating a mobile application that will not require users to log in. What is the MOST efficient method to grant users access to AWS resources?
Use an identity provider to securely authenticate with the application.
Create an AWS Lambda function to create an IAM user when a user accesses the application.
Create credentials using AWS KMS and apply these credentials to users when using the application.
Use Amazon Cognito to associate unauthenticated users with an IAM role that has limited access to resources.
Question 80
A developer has created on AWS Lambda function tool uses 15 MB of memory. When the developer runs the code natively on a laptop that has 4 cores, the function runs within 100 ms. When the developer deploys the code as a Lambda function with 128 MB of memory, the first run takes 3 seconds. Subsequent runs take more than 500 ms to finish. The developer needs to improve the performance of the Lambda function so that the function runs consistently in less than 100 ms, excluding the initial startup time. Which solution will meet this requirement?
Increase the reserved concurrency of the Lambda function.
Increase the provisioned concurrency of the Lambda function.
Increase the memory of the Lambda function.
Repackage the Lambda function as a container. Redeploy the function.