Font size
WorksheetsDesarrollador prueba 2
Total questions: 65
Worksheet time: 2hrs 10mins
An application running in an EC2 Auto Scaling group experiences long instance startup times due to a slow‑running UserData script. The solution must ensure that instances become available quickly, always run the latest validated application version with all security patches, and minimize the number of images created. Which two steps should be taken?
Use EC2 Image Builder to create an AMI with all required patches and agents, and update the Auto Scaling launch configuration to use this AMI.
Use EC2 Image Builder to create an AMI with the latest application version and patches, and update the Auto Scaling launch configuration to use this AMI.
Set up AWS CodeDeploy to deploy the latest application version at runtime.
Set up AWS CodePipeline to deploy the latest application version at runtime.
Remove OS patching commands from the UserData script.
A business operates Amazon EC2 instances across several AWS accounts. A developer is tasked with creating an application that aggregates lifecycle events from these instances. These events must be consolidated into a single Amazon SQS queue in the primary AWS account for further processing.
Set up Amazon EC2 to forward lifecycle events from every account to the primary account’s EventBridge event bus. Then, create an EventBridge rule in that bus to capture all lifecycle events, using the SQS queue as the designated target.
Apply resource policies on the main account’s SQS queue to grant write permissions to each account. In each account’s EventBridge event bus, set up a rule that filters for EC2 lifecycle events and directs them to the SQS queue in the primary account.
Develop an AWS Lambda function that periodically reviews all EC2 instances across accounts to detect lifecycle changes, sending a notification to the SQS queue in the main account whenever a change is found. A scheduled EventBridge rule triggers this function every minute.
Adjust the primary account’s event bus permissions to accept events from other accounts. In every account, establish an EventBridge rule to forward all EC2 lifecycle events to the main account’s event bus. Finally, in the main account, create an EventBridge rule that filters these events and designates the SQS queue as its target.
A financial company must retain original customer records containing PII for 10 years, while ensuring that only authorized personnel can access the PII and third parties receive statistical data without it. A developer has stored the immutable record in Amazon S3 and written a Lambda function named removePii to strip PII when needed. How should the solution be configured to meet these requirements with a single copy of the document?
Configure an S3 event notification to trigger the removePii function on each GET request, returning the object without PII.
Configure an S3 event notification to trigger the removePii function on each PUT request, and use PUT requests to access the sanitized object.
Create an S3 Object Lambda access point, associate it with the removePii function, and use this access point to retrieve the object without PII.
Create a standard S3 access point and use the GetObjectLegalHold API with the removePii function to access the object without PII.
A developer is creating a static website that uses Amazon CloudFront to deliver content from a private S3 bucket. Users can access pages like /products/index.html but receive errors when accessing directories (e.g., /products/) without specifying a file name. Which solution meets these requirements without exposing the S3 bucket publicly?
Update the CloudFront distribution’s default root object to index.html
Enable S3 static website hosting and change the CloudFront origin to the S3 website endpoint
Create a CloudFront function that appends "index.html" to requests for directories
Configure a custom error response in CloudFront to redirect 404 errors to /index.html
A company is migrating a multi‑node Windows legacy application to Amazon EC2. The application uses a network shared folder to store XML configuration files. To ensure high availability for the configuration repository cost‑effectively, which solution should be implemented?
Attach an EBS volume to an EC2 instance, set up a file system, share a folder via the OS, and modify the application to use the shared folder.
Deploy a micro EC2 instance with an instance store volume, share a folder via the OS, and update the application accordingly.
Use an Amazon S3 bucket to host the repository, migrate the XML files, and update the application to access the files using the AWS SDK.
Use an Amazon S3 bucket, migrate the XML files, and mount the S3 bucket as a local volume on the EC2 instances.
A developer has created a Lambda function that queries an Aurora MySQL DB instance. The function fails with “too many connections” errors. Which solution meets these requirements with the least operational effort?
Create a read replica for the DB instance and query the replica.
Migrate the data to Amazon DynamoDB.
Configure Aurora for Multi‑AZ deployment.
Create an RDS Proxy and have the Lambda function query the proxy.
A company uses AWS CloudFormation to deploy an application that uses an Amazon API Gateway REST API with AWS Lambda function integration and Amazon DynamoDB for data persistence. The application has three stages (development, testing, production), each with its own DynamoDB table. When promoting changes to production, unexpected issues occur. A developer needs to route 20% of production traffic to the new API version while routing 80% to the existing production API, minimizing errors per customer.
Incrementally update 20% of the changes and deploy repeatedly.
Update the Amazon Route 53 DNS record with a weighted routing policy (80% to production, 20% to testing stage alias).
Deploy an Application Load Balancer in front of the API, registering production and testing stages as targets with weights 80% and 20%.
Configure canary settings for the production stage API to direct 20% of traffic to the new deployment and deploy the changes.
A developer is designing an application that uses Amazon S3 to store objects. The company must ensure that all data transferred to S3 is encrypted in transit. Which solution meets this requirement?
Require all clients to use HTTPS when accessing S3 by configuring a bucket policy that denies non‑secure requests.
Enable server‑side encryption on S3.
Encrypt data on the client side before uploading to S3.
Use Amazon CloudFront to deliver content over HTTPS.
A company hosts a client‑side web application on Amazon S3 delivered via CloudFront. To support additional subsidiaries, common JavaScript files and web fonts were moved to a central S3 bucket, but browsers block these resources. What should the developer do to prevent this issue?
Create four S3 access points for the central bucket, assigning one per web application.
Create and attach a bucket policy to the central S3 bucket to allow access.
Configure a CORS policy on the central S3 bucket to permit cross‑origin access for the web applications.
Implement a Content‑MD5 header for each request to the central S3 bucket to ensure message integrity.
A developer has built a data collection application where users upload files and await a validation status on a dashboard. Since validating large files takes time, the developer must refactor the app so that the validation result is pushed immediately to the user’s dashboard without reloading the page.
Integrate the client with an API Gateway WebSocket API; store the file with the connection ID and push the status when processing is complete.
Set up a WebSocket server on an EC2 micro instance to push updates.
Email the user when validation is complete.
Use DynamoDB Streams with SNS to trigger dashboard updates.
A developer wants to create a Lambda function that is invoked every 10 minutes in a fully serverless and automated manner. Which solution meets these requirements?
Deploy an EC2 instance with a cron job.
Configure an environment variable named PERIOD with value 600.
Create an EventBridge rule with a rate expression to invoke the Lambda function every 10 minutes.
Create an SNS topic with a 600‑second timer subscription to the Lambda function.
A developer is building a web API that receives requests through an internet‑facing Application Load Balancer (ALB) with an HTTPS listener. The developer configures an Amazon Cognito user pool for authentication and must ensure every request is authenticated via Cognito.
Add a listener rule to return a fixed 401 Unauthorized response if the Authorization header is missing.
Create an authentication action for the ALB listener rules with type authenticate-cognito and set OnUnauthenticatedRequest to “deny.”
Create an API Gateway API with a Cognito authorizer and forward requests to the ALB.
Create a new target group with a Lambda function to validate the Authorization header.
A developer writing an AWS Lambda function needs to log key events with a unique identifier for each invocation. Which solution best meets this requirement?
Retrieve the request identifier from the AWS request ID in the context object and log to standard output.
Retrieve the request identifier from the event object and log to a file.
Retrieve the request identifier from the event object and log to standard output.
Retrieve the request identifier from the context object and log to a file.
A developer needs to insert a record into an Amazon DynamoDB table immediately after a new file is added to an Amazon S3 bucket. Which set of steps should be taken to achieve this?
Set up an EventBridge event to monitor the S3 bucket and insert records into DynamoDB.
Configure an S3 event to trigger a Lambda function that inserts records into DynamoDB.
Create a Lambda function that polls the S3 bucket and then inserts records into DynamoDB.
Establish a scheduled cron job to insert records into DynamoDB.
A developer is building an application using AWS CloudFormation and AWS CodeCommit to manage infrastructure as code. The developer must write unit tests for the generated CDK templates and validate that critical security configurations are enabled. Which two actions will meet these requirements with minimal development overhead?
Use a unit testing framework to write custom tests against the generated cdk.out file and run them in a CI/CD pipeline.
Use the CDK assertions module to write unit tests for the constructs and run them in a CI/CD pipeline.
Use the CDK runtime context to set key-value pairs and fail synthesis if violations occur.
Write a script that searches the code for specific configuration strings and reports violations.
Use the CDK Aspects class to create custom rules to validate security configurations and fail synthesis if violations occur.
