Questão 1
Questão
A developer is setting up the deployment of application stacks to new test environments by using the AWS Cloud Development Kit (AWS CDK). The application contains the code for several AWS Lambda functions that will be deployed as assets. Each Lambda function is defined by using the AWS CDK Lambda construct library. The developer has already successfully deployed the application stacks to the alpha environment in the first account by using the AWS CDK CLI’s cdk deploy command. The developer is preparing to deploy to the beta environment in a second account for the first time. The developer makes no significant changes to the CDK code between deployments, but the initial deployment in the second account is unsuccessful and returns a NoSuchBucket error.
Which command should the developer run before redeployment to resolve this error?
Responda
-
cdk synth
-
cdk bootstrap
-
cdk init
-
cdk destroy
Questão 2
Questão
A company’s infrastructure team is using AWS CloudFormation to deploy common infrastructure resources such as VPCs, subnets, Amazon RDS DB cluster endpoints, and Amazon DynamoDB tables for other teams to use. The CloudFormation templates also create AWS Systems Manager Parameter Store parameters to store information about these resources for application developers. The parameters include elements such as RDS DB cluster endpoints for clusters that the templates create. A developer creates a CloudFormation template that includes an AWS Lambda function that reads the SSM parameter value to access RDS DB cluster endpoints. The Lambda function has reserved concurrency configured to match the value of the Parameter Store maximum throughput (transactions per second) quota for the account and the AWS Region that hosts the account. The developer wants to prepare for a potential load increase. The developer expects the Lambda function’s concurrent invocation rate to be two times more than the Parameter Store maximum throughput quota value.
Which solution will prepare for the load increase MOST cost-effectively?
Responda
-
Move the code that is reading the SSM parameter value outside the Lambda function handler. Store the RDS DB cluster endpoint value in a global variable. Use the endpoint value inside the Lambda function handler.
-
Move the code that is reading the SSM parameter value outside the Lambda function handler. Store the RDS DB cluster endpoint value in an environment variable. Use the endpoint value inside the Lambda function handler.
-
Request a service quota increase for the Systems Manager GetParameter rate quota value to match the Lambda function's concurrency.
-
Add an SSM parameter to the CloudFormation template that resolves the RDS DB cluster endpoint value at deployment time by using the ssm dynamic reference. Update the Lambda function resource in CloudFormation to create an environment variable that references the newly created SSM parameter.
Questão 3
Questão
A developer is troubleshooting an application that uses Amazon DynamoDB in the us-west-2 Region. The application is deployed to an Amazon EC2 instance. The application requires read-only permissions to a table that is named Cars. The EC2 instance has an attached IAM role that contains the following IAM policy:
When the application tries to read from the Cars table, an Access Denied error occurs.
How can the developer resolve this error?
Responda
-
Modify the IAM policy resource to be “arn:aws:dynamodb-us-west-2:account-id:table/*”
-
Modify the IAM policy to include the dynamodb:* action.
-
Create a trust policy that specifies the EC2 service principal. Associate the role with the policy.
-
Create a trust relationship between the role and dynamodb.amazonaws.com.
Questão 4
Questão
A developer has created a Java application that runs on AWS Elastic Beanstalk with the default Elastic Beanstalk instance profile. The developer needs to visualize a map of the application’s interactions with AWS services to help identify and debug issues with the application.
Which combination of steps should the developer take to meet this requirement with the LEAST operational effort? (Choose two.)
Responda
-
Instrument the code by using the AWS X-Ray software development kit (SDK) for Java.
-
Create an Elastic Beanstalk configuration file to download and install the AWS X-Ray daemon on the underlying Amazon EC2 instances.
-
Enable the AWS X-Ray daemon in the Elastic Beanstalk console.
-
Enable Elastic Beanstalk enhanced health reporting.
-
Configure AWS CloudTrail to visualize the services map.
Questão 5
Questão
A developer is creating a photo website. Amazon Route 53 hosts the website’s domain. The developer wants to store the application code and images in an Amazon S3 bucket. The developer also wants to use Amazon CloudFront to deliver the images to users. The developer has created the S3 bucket and a CloudFront distribution. The developer wants the images to be accessed only through the website’s domain. Users must not use the S3 URLs.
Which solution will meet these requirements?
Responda
-
Create a CloudFront origin access identity (OAI). Associate the OAI with the CloudFront distribution. Modify the S3 bucket policy to allow access from only the OAI. Create an alias in Route 53 that points the website domain to the S3 bucket.
-
Create a CloudFront origin access identity (OAI). Associate the OAI with the CloudFront distribution. Modify the S3 bucket policy to allow access from only the OAI. Update the Route 53 records to point the website domain to the CloudFront domain name.
-
Block public access in the S3 bucket policy. Configure CloudFront to use the S3 bucket endpoint. Create an alias in Route 53 that points the website domain to the S3 bucket.
-
Block public access in the S3 bucket policy. Configure CloudFront to use the S3 bucket endpoint. Create an alias in Route 53 that points the website domain to the CloudFront domain name.
Questão 6
Questão
A logistics company built an asset-tracking microservice by using the AWS Serverless Application Model (AWS SAM). One of the microservice’s AWS Lambda functions needs to import a large geospatial dataset from Amazon S3 before the function can process the requests. The import of the dataset requires significant time and is causing the function to take too long to finish running. The results are increased latency and cost. A developer needs to optimize the function to process requests faster with the least possible cost.
Which solution will meet these requirements?
Responda
-
Store the geospatial dataset on Amazon Elastic File System (Amazon EFS) instead of on Amazon S3. Attach the EFS file system to the function. Retrieve the dataset by accessing the file system for every invocation.
-
Store the geospatial dataset on Amazon Elastic File System (Amazon EFS) instead of on Amazon S3. Attach the EFS file system to the function. Cache the data in the /tmp directory for use with every invocation.
-
Declare the Amazon S3 SDK and object request outside of the function handler. Configure provisioned concurrency for the function.
-
Declare the Amazon S3 SDK and object request outside of the function handler. Increase memory capacity of the function to 1,769 MB.
Questão 7
Questão
A company’s developer has deployed an application in AWS by using AWS CloudFormation. The CloudFormation stack includes parameters in AWS Systems Manager Parameter Store that the application uses as configuration settings. The application can modify the parameter values. When the developer updated the stack to create additional resources with tags, the developer noted that the parameter values were reset and that the values ignored the latest changes made by the application. The developer needs to change the way the company deploys the CloudFormation stack. The developer also needs to avoid resetting the parameter values outside the stack.
Which solution will meet these requirements with the LEAST development effort?
Responda
-
Modify the CloudFormation stack to set the deletion policy to Retain for the Parameter Store parameters.
-
Create an Amazon DynamoDB table as a resource in the CloudFormation stack to hold configuration data for the application. Migrate the parameters that the application is modifying from Parameter Store to the DynamoDB table.
-
Create an Amazon RDS DB instance as a resource in the CloudFormation stack. Create a table in the database for parameter configuration. Migrate the parameters that the application is modifying from Parameter Store to the configuration table.
-
Modify the CloudFormation stack policy to deny updates on Parameter Store parameters.
Questão 8
Questão
A company deploys a new application to AWS. The company is streaming application logs to Amazon CloudWatch Logs. The company’s development team must receive notification by email when the word “ERROR” appears in any log lines. A developer sets up an Amazon Simple Notification Service (Amazon SNS) topic and subscribes the development team to the topic.
What should the developer do next to meet the requirements?
Responda
-
Select the appropriate log group. Create a CloudWatch metric filter with “ERROR” as the search term. Create an alarm on this metric that notifies the SNS topic when the metric is 1 or higher.
-
In CloudWatch Logs Insights, select the appropriate log group. Create a metric query to search for the term “ERROR” in the logs. Create an alarm on this metric that notifies the SNS topic when the metric is 1 or higher.
-
Select the appropriate log group. Create an SNS subscription filter with “ERROR” as the filter pattern. Select the SNS topic as the destination.
-
Create a CloudWatch alarm that includes “ERROR” as a filter pattern, a log group dimension that defines the appropriate log group, and a destination that notifies the SNS topic.
Questão 9
Questão
A developer runs an application that uses an Amazon API Gateway REST API. The developer needs to implement a solution to proactively monitor the health of both API responses and latencies in case a deployment causes a service disruption despite passing deployment pipeline tests. The solution also must check for endpoint vulnerability and unauthorized changes to APIs, URLs, and website content.
Which solution will meet these requirements?
Responda
-
Use the Amazon CloudWatch Synthetics canary functionality to call the API and check the responses and duration of the request.
-
Use a custom health check in the API that queries hosts to check the duration of the request.
-
Implement a custom AWS Lambda function with an Amazon EventBridge event to periodically call the API and check the responses and duration of the request.
-
Use the built-in API Gateway metrics to monitor the average duration of the API response.
Questão 10
Questão
A company needs an application that consumes logs from Apache HTTP servers at a large scale with near real-time processing. The logs will vary in size from 300 KB to 500 KB. As part of processing, the company needs to convert the logs to JSON format and then upload the logs to an Amazon OpenSearch Service cluster.
Which combination of steps will meet these requirements? (Choose two.)
Responda
-
Install the Amazon CloudWatch agent on the Apache HTTP servers. Configure the CloudWatch agent to push the logs to an Amazon Simple Queue Service (Amazon SQS) queue.
-
Install the Amazon CloudWatch agent on the Apache HTTP servers. Configure the CloudWatch agent to push the logs to the Amazon Kinesis Data Firehose delivery stream.
-
Install the Amazon Kinesis agent on the Apache HTTP servers. Configure the Kinesis agent to push the logs to the Amazon Kinesis Data Firehose delivery stream.
-
Create an AWS Lambda function that converts the logs to JSON format and pushes the results to the OpenSearch Service cluster. Consume the logs from the Amazon Simple Queue Service (Amazon SQS) queue by using the Lambda function.
-
Create an Amazon Kinesis Data Firehose delivery stream. Set the source as Direct PUT. Implement an AWS Lambda function to convert the logs to JSON format. Enable source record transformation on the Kinesis Data Firehose delivery stream for the Lambda function. Set the OpenSearch Service cluster as the destination.
Questão 11
Questão
A developer is implementing an AWS Lambda function that will be invoked when an object is uploaded to Amazon S3. The developer wants to test the Lambda function in a local development machine before publishing the function to a production AWS account.
Which solution will meet these requirements with the LEAST operational overhead?
Responda
-
Upload an object to Amazon S3 by using the aws s3api put-object CLI command. Wait for the local Lambda invocation from the S3 event.
-
Create a sample JSON text file for a put object S3 event. Invoke the Lambda function locally. Use the aws lambda invoke CLI command with the JSON file and Lambda function name as arguments.
-
Use the sam local start-lambda CLI command to start Lambda. Use the sam local generate-event s3 put CLI command to create the Lambda test JSON file. Use the sam local invoke CLI command with the JSON file as the argument to invoke the Lambda function.
-
Create a JSON string for the put object S3 event. In the AWS Management Console, use the JSON string to create a test event for the local Lambda function. Perform the test.
Questão 12
Questão
A company is running Amazon EC2 instances in multiple AWS accounts. A developer needs to implement an application that collects all the lifecycle events of the EC2 instances. The application needs to store the lifecycle events in a single Amazon Simple Queue Service (Amazon SQS) queue in the company's main AWS account for further processing.
Which solution will meet these requirements?
Responda
-
Configure Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the Amazon EventBridge event bus of the main account. Add an EventBridge rule to the event bus of the main account that matches all EC2 instance lifecycle events. Add the SQS queue as a target of the rule.
-
Use the resource policies of the SQS queue in the main account to give each account permissions to write to that SQS queue. Add to the Amazon EventBridge event bus of each account an EventBridge rule that matches all EC2 instance lifecycle events. Add the SQS queue in the main account as a target of the rule.
-
Write an AWS Lambda function that scans through all EC2 instances in the company accounts to detect EC2 instance lifecycle changes. Configure the Lambda function to write a notification message to the SQS queue in the main account if the function detects an EC2 instance lifecycle change. Add an Amazon EventBridge scheduled rule that invokes the Lambda function every minute.
-
Configure the permissions on the main account event bus to receive events from all accounts. Create an Amazon EventBridge rule in each account to send all the EC2 instance lifecycle events to the main account event bus. Add an EventBridge rule to the main account event bus that matches all EC2 instance lifecycle events. Set the SQS queue as a target for the rule.
Questão 13
Questão
Deploy the image to the production Amazon Elastic Container Service (Amazon ECS) cluster by using AWS CodeDeploy. Recently, the CodeDeploy deployments began failing in Stage 4. The deployments are unable to perform rollbacks. The developer must minimize the number of failures that reach production without slowing down the pipeline.
Which solution will meet these requirements?
Responda
-
Add a human review and approval stage between Stage 3 and Stage 4.
-
Perform a more comprehensive test before Stage 2 by adding a test for the CodeCommit trigger in Stage 1.
-
Replace Stage 4 with a manual deployment until the developer can add more quality tests to the automation.
-
Modify Stage 3 so that it uses Amazon ECS and CodeDeploy.
Questão 14
Questão
A company is building a serverless application that uses AWS Lambda. The application includes Lambda functions that are exposed by Amazon API Gateway. The functions will use several large third-party libraries, and the build artifacts will exceed 50 MB in size.
Which combination of steps should a developer take to prepare and perform the deployment? (Choose two.)
Responda
-
Issue the aws lambda update-function-code CLI command with the --zip-file fileb://my-function.zip parameter.
-
Upload the build artifact to Amazon S3.
-
Issue the aws cloudformation package CLI command.
-
Issue the aws lambda update-function-code CLI command with the --s3-bucket and --s3-key parameters.
-
Issue the aws lambda update-function-code CLI command with a parameter that points to the source code in AWS CodeCommit.