WorksheetsTest2A
Total questions: 65
Worksheet time: 35mins
A developer needs to use the AWS CLI on an on-premises development server temporarily to access AWS services while performing maintenance. The developer needs to authenticate to AWS with their identity for several hours.
What is the MOST secure way to call AWS CLI commands with the developer's IAM identity?
Specify the developer's IAM access key ID and secret access key as parameters for each CLI command
Run the aws configure CLI command. Provide the developer's IAM access key ID and secret access key.
Specify the developer's IAM profile as a parameter for each CLI command.
Run the get-session-token CLI command with the developer's IAM user. Use the returned credentials to call the CLI
An AWS Lambda function accesses two Amazon DynamoDB tables. A developer wants to improve the performance of the Lambda function by identifying bottlenecks in the function.
How can the developer inspect the timing of the DynamoDB API calls?
Add DynamoDB as an event source to the Lambda function. View the performance with Amazon CloudWatch metrics
Place an Application Load Balancer (ALB) in front of the two DynamoDB tables. Inspect the ALB logs
Limit Lambda to no more than five concurrent invocations. Monitor from the Lambda console.
Enable AWS X-Ray tracing for the function. View the traces from the X-Ray service.
A developer deployed an application to an Amazon EC2 instance. The application needs to know the public IPv4 address of the instance.
How can the application find this information?
Query the instance metadata from http://169.254.169.254/latest/meta-data/.
Query the instance user data from http://169.254.169.254/latest/user-data/.
Query the Amazon Machine Image (AMI) information from http://169.254 169.254/latest/meta-data/ami/.
Check the hosts file of the operating system.
A developer is designing an AWS Lambda function to perform a maintenance activity. The developer will use Amazon EventBridge (Amazon CloudWatch Events) to invoke the function on an hourly schedule. The developer wants the function to log information at different levels of detail according to the value of a log level variable. The developer must design the function so that the log level can be set without requiring a change to the function code.
Which solution will meet these requirements?
Add a custom log level parameter for the Lambda function. Set the parameter by using the Lambda console
Set the log level in a Lambda environment variable
Set the log level in the Amazon CloudWatch Logs console.
Add a custom log level parameter for the Lambda function. Set the parameter by using the AWS CLI.
A developer is creating a serverless application that uses an AWS Lambda function The developer will use AWS CloudFormation to deploy the application The application will write logs to Amazon CloudWatch Logs. The developer has created a log group in a CloudFormation template for the application to use. The developer needs to modify the CloudFormation template to make the name of the log group available to the application at runtime.
Which solution will meet this requirement?
Use the AWS::Include transform in CloudFormation to provide the log group's name to the application.
Pass the log group's name to the application in the user data section of the CloudFormation template
Use the CloudFormation template's Mappings section to specify the log group's name for the application.
Pass the log group's Amazon Resource Name (ARN) as an environment variable to the Lambda function.
A company is running an application on Amazon Elastic Container Service (Amazon ECS). When the company deploys a new version of the application, the company initially needs to expose 10% of live traffic to the new version. After a period of time, the company needs to immediately route all the remaining live traffic to the new version.
Which ECS deployment should the company use to meet these requirements?
Rolling update
Blue/green with canary
Blue/green with all at once
Blue/green with linear
A microservices application is deployed across multiple containers in Amazon Elastic Container Service (Amazon ECS). To improve performance, a developer wants to capture trace information between the microservices and visualize the microservices architecture.
Which solution will meet these requirements?
Build the container from the amazon/aws-xray-daemon base image. Use the AWS X-Ray SDK to instrument the application.
Install the Amazon CloudWatch agent on the container image. Use the CloudWatch SDK to publish custom metrics from each of the microservices.
Install the AWS X-Ray daemon on each of the ECS instances.
Configure AWS CloudTrail data events to capture the traffic between the microservices.
A company is planning to use AWS CodeDeploy to deploy an application to Amazon Elastic Container Service (Amazon ECS). During the deployment of a new version of the application, the company initially must expose only 10% of live traffic to the new version of the deployed application. Then, after 15 minutes elapse, the company must route all the remaining live traffic to the new version of the deployed application.
Which CodeDeploy predefined configuration will meet these requirements?
CodeDeployDefault.ECSCanary10Percent15Minutes
CodeDeployDefault.LambdaCanary10Percent5Minutes
CodeDeployDefault.LambdaCanary10Percent15Minutes
CodeDeployDefault.ECSLinear10PercentEvery1 Minutes
A developer notices timeouts from the AWS CLI when the developer runs list commands.
What should the developer do to avoid these timeouts?
Use the --page-size parameter to request a smaller number of items.
Use shorthand syntax to separate the list by a single space.
Use the yaml-stream output for faster viewing of large datasets.
Use quotation marks around strings to enclose data structure.
A company has moved a legacy on-premises application to AWS by performing a lift and shift. The application exposes a REST API that can be used to retrieve billing information. The application is running on a single Amazon EC2 instance. The application code cannot support concurrent invocations. Many clients access the API, and the company adds new clients all the time.
A developer is concerned that the application might become overwhelmed by too many requests. The developer needs to limit the number of requests to the API for all current and future clients. The developer must not change the API, the application, or the client code.
What should the developer do to meet these requirements?
Place the API behind an Amazon API Gateway API. Set the server-side throttling limits.
Place the API behind a Network Load Balancer. Set the target group throttling limits.
Place the API behind an Application Load Balancer. Set the target group throttling limits.
Place the API behind an Amazon API Gateway API. Set the per-client throttling limits.
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.
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
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.
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.
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.
A company is planning to use AWS CodeDeploy to deploy an application to AWS Lambda. During the deployment of a new version of the application, the company initially must expose only 10% of live traffic to the new version of the deployed application. Then, every 10 minutes, the company must route another
10% of live traffic to the new version of the deployed application until all live traffic is routed to the new version.
Which CodeDeploy predefined configuration will meet these requirements?
CodeDeployDefault.OnceAtATime
CodeDeployDefault.LambdaCanary10Percent10Minutes
CodeDeployDefault.LambdaLinear10PercentEvery10Minutes
CodeDeployDefault.ECSLinear10PercentEvery3Minutes
A developer wants to use AWS Elastic Beanstalk to test a new version of on application in a test environment.
Which deployment method offers the FASTEST deployment?
Immutable
Rolling
Rolling with additional batch
All at once
A developer has built an application that inserts data into an Amazon DynamoDB table. The table is configured to use provisioned capacity. The application is deployed on a burstable nano Amazon EC2 Instance. The application logs show that the application has been failing because of a
ProvisionedThroughputExceedException error.
Which actions should the developer take to resolve this issue? (Choose two.)
Move The application to a larger EC instance.
Increase the number or read capacity units (RCUs) that are provisioned for the DynamoDB table.
Reduce the frequency of requests to DynamoDB by implement ng exponential backoff.
Increase the frequency of requests to DynamoDB by decreasing the retry delay.
Change the capacity mode of the DynamoDB table from provisioned to on-demand.
A developer is deploying on application on Amazon EC2 instances that run in Account A. In certain cases, this application needs to read data from a private
Amazon S3 bucket in Account B. The developer must provide the application access to the S3 bucket without exposing the S3 bucket to anyone else.
Which combination of actions should the developer take to meet these requirements? (Choose two.)
Create an IAM role with S3 read permissions in Account B.
Update the instance profile IAM role in Account A with S3 read permissions.
Make the S3 bucket public with limited access for Account A.
Configure the bucket policy in Account B to grant permissions to the instance profile role.
Add a trust policy that allows s3:Get* permissions to the IAM rote in Account B.
A developer at a company recently created a serverless application to process and show data from business reports. The application's user interface (UI) allows users to select and start processing the flies. The UI displays a message when the result is available to view. The application uses AWS Step Functions with AWS
Lambda functions to process the files. The developer used Amazon API Gateway and Lambda functions to create an API to support the UI.
The company's UI team reports that the request to process a file s often returning timeout errors because of the size or complexity of the files. The UI team wants the API to provide an immediate response so that the UI can display a message while the files are being processed. The backend process that is invoked by the
API needs to send an email message when the report processing is complete.
What should the developer do to configure the API to meet these requirements?
Change the API Gateway route to add an X-Amz-Invocation-Type header with a static value of 'Event' in the integration request. Deploy the API Gateway stage to apply the changes.
Change the configuration of the Lambda function that implements the request to process a file. Configure the maximum age of the event so that the Lambda function will run asynchronously.
Change the API Gateway timeout value to match the Lambda function timeout value. Deploy the API Gateway stage to apply the changes.
Change the API Gateway route to add an X-Amz-Target header with a static value of 'Async' in the integration request. Deploy the API Gateway stage to apply the changes.
An ecommerce application is running behind an Application Load Balancer. A developer observes some unexpected load on the application during non-peak hours. The developer wants to analyze patterns for the client IP addresses that use the application.
Which HTTP header should the developer use for this analysis?
The X-Forwarded-Proto header
The X-Forwarded-Host header
The X-Forwarded-For header
The X-Forwarded-Port header
A developer needs to create an application that supports Security Assertion Markup Language (SAML) and authentication with social media providers. It must also allow access to AWS services, such as Amazon DynamoDB.
Which AWS service or feature will meet these requirements with the LEAST amount of additional coding?
AWS AppSync
Amazon Cognito identity pools
Amazon Cognito user pools
Amazon Lambda@Edge
A developer is designing a serverless application for an ecommerce website. An Amazon API Gateway API exposes AWS Lambda functions for billing, payment, and user operations. The website features shopping carts for the users. The shopping carts must be stored for extended periods of time and will be retrieved frequently by the front-end application.
The load on the application will vary significantly based on the time of day and the promotional sales that are offered on the website. The application must be able to scale automatically to meet these changing demands.
Which solution will meet these requirements?
Store the data objects on an Amazon RDS DB instance. Cache the data objects in memory by using Amazon ElastiCache.
Store the data objects on Amazon EC2 instances behind an Application Load Balancer. Use session affinity (sticky sessions) for each user's shopping cart.
Store the data objects in Amazon S3 buckets. Cache the data objects by using Amazon CloudFront with the maximum TTL.
Store the data objects in Amazon DynamoDB tables. Cache the data objects by using DynamoDB Accelerator (DAX).
A company is migrating its on-premises database to Amazon RDS for MySQL. The company has read-heavy workloads, and wants to make sure it re-factors its code to achieve optimum read performance for its queries.
How can this objective be met?
Add database retries to effectively use RDS with vertical scaling.
Use RDS with multi-AZ deployment.
Add a connection string to use an RDS read replica for read queries.
Add a connection string to use a read replica on an EC2 instance.
An application running on Amazon EC2 opens connections to an Amazon RDS SQL Server database. The developer does not want to store the user name and password for the database in the code. The developer would also like to automatically rotate the credentials.
What is the MOST secure way to store and access the database credentials?
Create an IAM role that has permissions to access the database. Attach the role to the EC2 instance.
Use AWS Secrets Manager to store the credentials. Retrieve the credentials from Secrets Manager as needed.
Store the credentials in an encrypted text file in an Amazon S3 bucket. Configure the EC2 instance's user data to download the credentials from Amazon S3 as the instance boots.
Store the user name and password credentials directly in the source code. No further action is needed because the source code is stored in a private repository.
A developer received the following error message during an AWS CloudFormation deployment:
DELETE_FAILED (The following resource(s) failed to delete: [ASGInstanceRolel2345678].)
Which action should the developer take to resolve this error?
Contact AWS Support to report an issue with the Auto Scaling Groups (ASG) service.
Add a DependsOn attribute to the ASGInstanceRole12345678 resource in the CloudFormation template. Then delete the stack.
Modify the CloudFormation template to retain the ASGInstanceRolel2345678 resource. Then manually delete the resource after deployment.
Add a force parameter when calling CloudFormation with the role-arn of ASGInstanceRolel2345678.
An application runs on multiple EC2 instances behind an ELB.
Where is the session data best written so that it can be served reliably across multiple requests?
Write data to Amazon ElastiCache.
Write data to Amazon Elastic Block Store.
Write data to Amazon EC2 Instance Store.
Write data to the root filesystem.
A company is using continuous integration/continuous delivery (CI/CD) systems. A developer must automate the deployment of an application software package to Amazon EC2 instances and virtual servers that run on premises.
Which AWS service should the developer use to meet these requirements?
AWS Cloud9
AWS CodeBuild
AWS Elastic Beanstalk
AWS CodeDeploy
A software company is using AWS CodeBuild to build an application. The buildspec runs the application build and creates a Docker image that contains the application. The company needs to push the Docker image to Amazon Elastic Container Registry (Amazon ECR) only upon the completion of each successful build.
Which solution meets these requirements?
Change the buildspec by adding a post_build phase that uses the commands block to push the Docker image.
Change the buildspec by adding a post_build phase that uses the finally block to push the Docker image.
Specify the Docker image in the buildspec's artifacts sequence with an action to push the image.
Use a batch build to define a build matrix. Use the batch build to push the Docker image.
A company is using Amazon RDS as the backend database for its application. After a recent marketing campaign, a surge of read requests to the database increased the latency of data retrieval from the database.
The company has decided to implement a caching layer in front of the database. The cached content must be encrypted and must be highly available.
Which solution will meet these requirements?
Amazon CloudFront
Amazon ElastiCache for Memcached
Amazon ElastiCache for Redis in cluster mode
Amazon DynamoDB Accelerator (DAX)
A company has an application that runs on AWS Elastic Beanstalk in a load-balanced environment. The company needs to update the instance types in the environment to a more recent generation of instance types. The company must minimize downtime during the deployment of this configuration change.
Which deployment options will meet these requirements? (Choose two.)
Disabled
Rolling based on Health
Immutable
All at once
Canary
Given the source code for an AWS Lambda function in the local file 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.
A company is developing a report implemented using AWS Step Functions. Amazon CloudWatch shows errors in the Step Functions task state machine. To troubleshoot each task, the state input needs to be included along with the error message in the state output.
Which coding practice can preserve both the original input and the error for the state?
Use ResultPath in a Catch statement to include the error with the original input.
Use InputPath in a Catch statement and set the value to null.
Use ErrorEquals in a Retry statement to include the error with the original input.
Use OutputPath in a Retry statement and set the value to $.
A developer is receiving HTTP 400: ThrottlingException errors intermittently when calling the Amazon CloudWatch API. When a call fails, no data is retrieved.
What best practice should first be applied to address this issue?
Contact AWS Support for a limit increase.
Use the AWS CLI to get the metrics.
Analyze the applications and remove the API call.
Retry the call with exponential backoff.
A company has an online order website that uses Amazon DynamoDB to store item inventory. A sample of the inventory object is as follows:
A developer needs to reduce all inventory prices by 100 as long as the resulting price would not be less than 500.
What should the developer do to make this change with the LEAST number of calls to DynamoDB?
Perform a DynamoDB Query operation with the Id. If the price is >= 600, perform an UpdateItem operation to update the price.
Perform a DynamoDB UpdateItem operation with a condition expression of "Price >= 600".
Perform a DynamoDB UpdateItem operation with a condition expression of "ProductCategory IN ({"S": "Sporting Goods"}) and Price 600".
Perform a DynamoDB UpdateItem operation with a condition expression of "MIN Price = 500".
A company is using an AWS Lambda function to process records from an Amazon Kinesis data stream. The company recently observed slow processing of the records. A developer notices that the iterator age metric for the function is increasing and that the Lambda run duration is constantly above normal.
Which actions should the developer take to increase the processing speed? (Choose two.)
Increase the number of shards of the Kinesis data stream.
Decrease the timeout of the Lambda function.
Increase the memory that is allocated to the Lambda function.
Decrease the number of shards of the Kinesis data stream.
Increase the timeout of the Lambda function.
A developer is making changes to a custom application that uses AWS Elastic Beanstalk.
Which solutions will update the Elastic Beanstalk environment with the new application version after the developer completes the changes? (Choose two.)
Package the application code into a .zip file. Use the AWS Management Console to upload the zip file and deploy the packaged application.
Package the application code into a .tar file. Use the AWS Management Console to create a new application version from the .tar file. Update the environment by using the AWS CLI.
Package the application code into a .tar file. Use the AWS Management Console to upload the .tar file and deploy the packaged application.
Package the application code into a .zip file. Use the AWS CLI to create a new application version from the .zip file and to update the environment.
Package the application code into a .zip file. Use the AWS Management Console to create a new application version from the .zip file. Rebuild the environment by using the AWS CLI.
A company has an application where reading objects from Amazon S3 is based on the type of user. The user types are registered user and guest user. The company has 25,000 users and is growing. Information is pulled from an S3 bucket depending on the user type.
Which approaches are recommended to provide access to both user types? (Choose two.)
Provide a different access key and secret access key in the application code for registered users and guest users to provide read access to the objects.
Use S3 bucket policies to restrict read access to specific IAM users.
Use Amazon Cognito to provide access using authenticated and unauthenticated roles.
Create a new IAM user for each user and grant read access.
Use the AWS IAM service and let the application assume the different roles using the AWS Security Token Service (AWS STS) AssumeRole action depending on the type of user and provide read access to Amazon S3 using the assumed role.
A developer is writing an application to analyze the traffic to a fleet of Amazon EC2 instances. The EC2 instances run behind a public Application Load Balancer
(ALB). An HTTP server runs on each of the EC2 instances, logging all requests to a log file.
The developer wants to capture the client public IP addresses. The developer analyzes the log files and notices only the IP address of the ALB.
What must the developer do to capture the client public IP addresses in the log file?
Add a Host header to the HTTP server log configuration file.
Install the Amazon CloudWatch Logs agent on each EC2 instance. Configure the agent to write to the log file.
Install the AWS X-Ray daemon on each EC2 instance. Configure the daemon to write to the log file.
Add an X-Forwarded-For header to the HTTP server log configuration file.
A developer is writing a new AWS Serverless Application Model (AWS SAM) template with a new AWS Lambda function. The Lambda function runs complex code. The developer wants to test the Lambda function with more CPU power.
What should the developer do to meet this requirement?
Increase the runtime engine version.
Increase the timeout.
Increase the number of Lambda layers.
Increase the memory.
A developer uses a single AWS CloudFormation template to configure the test environment and the production environment for an application. The developer handles environment-specific requirements in the CloudFormation template.
The developer decides to update the Amazon EC2 Auto Scaling launch template with new Amazon Machine Images (AMIs) for each environment. The
CloudFormation update for the new AMIs is successful in the test environment, but the update fails in the production environment.
What are the possible causes of the CloudFormation update failure in the production environment? (Choose two.)
The new AMIs do not fulfill the specified conditions in the CloudFormation template.
The service quota for the number of EC2 vCPUs in the AWS Region has been exceeded.
The security group that is specified in the CloudFormation template does not exist.
CloudFormation does not recognize the template change as an update.
CloudFormation does not have sufficient IAM permissions to make the changes.
A developer is creating a serverless web application and maintains different branches of code. The developer wants to avoid updating the Amazon API Gateway target endpoint each time a new code push is performed.
What solution would allow the developer to perform a code push efficiently, without the need to update the API Gateway?
Associate different AWS Lambda functions to an API Gateway target endpoint.
Create different stages in API Gateway. then associate API Gateway with AWS Lambda.
Create aliases and versions in AWS Lambda.
Tag the AWS Lambda functions with different names.
A developer needs to deploy an application running on AWS Fargate using Amazon ECS. The application has environment variables that must be passed to a container for the application to initialize.
How should the environment variables be passed to the container?
Define an array that includes the environment variables under the environment parameter within the service definition.
Define an array that includes the environment variables under the environment parameter within the task definition.
Define an array that includes the environment variables under the entryPoint parameter within the task definition.
Define an array that includes the environment variables under the entryPoint parameter within the service definition.
A developer must extend an existing application that is based on the AWS Serverless Application Model (AWS SAM). The developer has used the AWS SAM CLI to create the project. The project contains different AWS Lambda functions.
Which combination of commands must the developer use to redeploy the AWS SAM application? (Choose two.)
sam init
sam validate
sam build
sam deploy
sam publish
A developer manages an application that interacts with Amazon RDS. After observing slow performance with read queries, the developer implements Amazon
ElastiCache to update the cache immediately following the primary database update.
What will be the result of this approach to caching?
Caching will increase the load on the database instance because the cache is updated for every database update.
Caching will slow performance of the read queries because the cache is updated when the cache cannot find the requested data.
The cache will become large and expensive because the infrequently requested data is also written to the cache.
Overhead will be added to the initial response time because the cache is updated only after a cache miss.
A developer has a stateful web server on-premises that is being migrated to AWS. The developer must have greater elasticity in the new design.
How should the developer re-factor the application to make it more elastic? (Choose two.)
Use pessimistic concurrency on Amazon DynamoDB.
Use Amazon CloudFront with an Auto Scaling group.
Use Amazon CloudFront with an AWS Web Application Firewall.
Store session state data in an Amazon DynamoDB table.
Use an ELB with an Auto Scaling group.
A developer has a legacy application that is hosted on-premises. Other applications hosted on AWS depend on the on-premises application for proper functioning.
In case of any application errors, the developer wants to be able to use Amazon CloudWatch to monitor and troubleshoot all applications from one place.
How can the developer accomplish this?
Install an AWS SDK on the on-premises server to automatically send logs to CloudWatch.
Download the CloudWatch agent to the on-premises server. Configure the agent to use IAM user credentials with permissions for CloudWatch.
Upload log files from the on-premises server to Amazon S3 and have CloudWatch read the files.
Upload log files from the on-premises server to an Amazon EC2 instance and have the instance forward the logs to CloudWatch.
A developer is designing a serverless application with two AWS Lambda functions to process photos. One Lambda function stores objects in an Amazon S3 bucket and stores the associated metadata in an Amazon DynamoDB table. The other Lambda function fetches the objects from the S3 bucket by using the metadata from the DynamoDB table. Both Lambda functions use the same Python library to perform complex computations and are approaching the quota for the maximum size of zipped deployment packages.
What should the developer do to reduce the size of the Lambda deployment packages with the LEAST operational overhead?
Package each Python library in its own .zip file archive. Deploy each Lambda function with its own copy of the library.
Create a Lambda layer with the required Python library. Use the Lambda layer in both Lambda functions.
Combine the two Lambda functions into one Lambda function. Deploy the Lambda function as a single .zip file archive.
Download the Python library to an S3 bucket. Program the Lambda functions to reference the object URLs.
A developer is adding a feature to a client-side application so that users can upload videos to an Amazon S3 bucket.
What is the MOST secure way to give the application the ability to write files to the S3 bucket?
Update the S3 bucket policy to allow public write access. Allow any user to upload videos by removing the need to handle user authentication within the client- side application.
Create a new IAM policy and a corresponding IAM user with permissions to write to the S3 bucket. Store the key and the secret for the user in the application code. Use the key to authenticate the video uploads.
Configure the API layer of the application to have a new endpoint that creates signed URLs that allow an object to be put into the S3 bucket. Generate a presigned URL through this API call in the client application. Upload the video by using the signed URL.
Generate a new IAM key and a corresponding secret by using the AWS account root user credentials. Store the key and the secret for the user in the application code. Use the key to authenticate the video uploads.
A company is building an application for stock trading. The application needs sub-millisecond latency for processing trade requests. The company uses Amazon
DynamoDB to store all the trading data that is used to process each trading request.
A development team performs load testing on the application and finds that the data retrieval time is higher than expected. The development team needs a solution that reduces the data retrieval time with the least possible effort.
Which solution meets these requirements?
Add local secondary indexes (LSIs) for the trading data.
Store the trading data in Amazon S3, and use S3 Transfer Acceleration.
Add retries with exponential backoff for DynamoDB queries.
Use DynamoDB Accelerator (DAX) to cache the trading data.
A developer needs to build and deploy a serverless application that has an API that mobile clients will use. The API will use Amazon DynamoDB and Amazon
OpenSearch Service (Amazon Elasticsearch Service) as data sources. Responses that are sent to the clients will contain aggregated data from both data sources.
The developer must minimize the number of API endpoints and must minimize the number of API calls that are required to retrieve the necessary data.
Which solution should the developer use to meet these requirements?
GraphQL API on AWS AppSync
REST API on Amazon API Gateway
GraphQL API on an Amazon EC2 instance
REST API on AWS Elastic Beanstalk
A Lambda function processes data before sending it to a downstream service. Each piece of data is approximately 1MB in size. After a security audit, the function is now required to encrypt the data before sending it downstream.
Which API call is required to perform the encryption?
Pass the data to the KMS ReEncrypt API for encryption.
Use the KMS GenerateDataKey API to get an encryption key.
Use the KMS GenerateDataKeyWithoutPlainText API to get an encryption key.
Pass the data to KMS as part of the Encrypt API for encryption.
A company has a web application that runs on Amazon EC2 instances with a custom Amazon Machine Image (AMI). The company uses AWS CloudFormation to provision the application. The application runs in the us-east-1 Region, and the company needs to deploy the application to the us-west-1 Region.
An attempt to create the AWS CloudFormation stack in us-west-1 fails. An error message states that the AMI ID does not exist. A developer must resolve this error with a solution that uses the least amount of operational overhead.
Which solution meets these requirements?
Change the AWS CloudFormation templates for us-east-1 and us-west-1 to use an AWS AMI. Relaunch the stack for both Regions.
Copy the custom AMI from us-east-1 to us-west-1. Update the AWS CloudFormation template for us-west-1 to refer to AMI ID for the copied AMI. Relaunch the stack.
Build the custom AMI in us-west-1. Create a new AWS CloudFormation template to launch the stack in us-west-1 with the new AMI ID.
Manually deploy the application outside AWS CloudFormation in us-west-1.
A developer wants to run a PHP website with an NGINX proxy and package them as Docker containers in one environment. The developer wants a managed environment with automated provisioning and load balancing. The developer cannot change the configuration and must minimize operational overhead.
How should the developer build the website to meet these requirements?
Create a new application in AWS Elastic Beanstalk that is preconfigured for a multicontainer Docker environment. Upload the code, and deploy it to a web server environment.
Deploy the code on Amazon EC2 instances in an Auto Scaling group behind an Application Load Balancer.
Construct an AWS CloudFormation template that launches Amazon EC2 instances. Install and configure the PHP code by using cfn helper scripts.
Upload the code for the PHP website into an Amazon S3 bucket. Host the website from the S3 bucket.
A company has a website that displays a daily newsletter. When a user visits the website, an AWS Lambda function processes the browser's request and queries the company's on-premises database to obtain the current newsletter. The newsletters are stored in English. The Lambda function uses the Amazon Translate
TranslateText API operation to translate the newsletters, and the translation is displayed to the user.
Due to an increase in popularity, the website's response time has slowed. The database is overloaded. The company cannot change the database and needs a solution that improves the response time of the Lambda function.
Which solution meets these requirements?
Change to asynchronous Lambda function invocation.
Cache the translated newsletters in the Lambda /tmp directory.
Enable TranslateText API caching.
Change the Lambda function to use parallel processing.
A developer is creating an AWS CloudFormation template for an application. The application includes an Amazon RDS database. The password to be set for the resource's MasterUserPassword property is already stored in AWS Secrets Manager.
How can the developer reference the value of the password in the CloudFormation template?
Use a parameter in the CloudFormation template with the same name of the secret.
Use the ssm dynamic reference by specifying the name of the secret and its version.
Use the secretsmanager dynamic reference by specifying the appropriate reference-key segment.
Use the ssm-secure dynamic reference by specifying the name of the secret and its version.
An application is using Amazon DynamoDB as its data store, and should be able to read 100 items per second as strongly consistent reads. Each item is 5 KB in size.
To what value should the table's provisioned read throughput be set?
50 read capacity units
100 read capacity units
200 read capacity units
500 read capacity units
A developer created a Lambda function for a web application backend. When testing the Lambda function from the AWS Lambda console, the developer can see that the function is being run, but there is no log data being generated in Amazon CloudWatch Logs, even after several minutes.
What could cause this situation?
The Lambda function does not have any explicit log statements for the log data to send it to CloudWatch Logs.
The Lambda function is missing CloudWatch Logs as a source trigger to send log data.
The execution role for the Lambda function is missing permissions to write log data to the CloudWatch Logs.
The Lambda function is missing a target CloudWatch Log group.
A developer has written code for an application and wants to share it with other developers on the team to receive feedback. The shared application code needs to be stored long-term with multiple versions and batch change tracking.
Which AWS service should the developer use?
AWS CodeBuild
Amazon S3
AWS CodeCommit
AWS Cloud9
A developer has created a new IAM user that has the s3:PutObject permission to write to a specific Amazon S3 bucket. The S3 bucket uses server-side encryption with AWS KMS managed keys (SSE-KMS) as the default encryption. When an application uses the access key and secret key of the IAM user to call the PutObject API operation, the application receives an access denied error.
What should the developer do to resolve this error?
Update the policy of the IAM user to allow the s3:EncryptionConfiguration action.
Update the bucket policy of the S3 bucket to allow the IAM user to upload objects.
Update the policy of the IAM user to allow the kms:GenerateDataKey action.
Update the ACL of the S3 bucket to allow the IAM user to upload objects.
A static website is hosted in an Amazon S3 bucket. Several HTML pages on the site use JavaScript to download images from another Amazon S3 bucket. These images are not displayed when users browse the site.
What is the possible cause for the issue?
The referenced Amazon S3 bucket is in another region.
The images must be stored in the same Amazon S3 bucket.
Port 80 must be opened on the security group in which the Amazon S3 bucket is located.
Cross Origin Resource Sharing must be enabled on the Amazon S3 bucket.
An application needs to encrypt data that is written to Amazon S3 where the keys are managed in an on-premises data center, and the encryption is handled by
S3.
Which type of encryption should be used?
Use server-side encryption with Amazon S3-managed keys.
Use server-side encryption with AWS KMS-managed keys.
Use client-side encryption with AWS KMS-managed keys.
Use server-side encryption with customer-provided keys.
A developer is building a serverless application that is based on AWS Lambda. The developer initializes the AWS software development kit (SDK) outside of the
Lambda handler function.
What is the PRIMARY benefit of this action?
Improves legibility and stylistic convention
Takes advantage of runtime environment reuse
Provides better error handling
Creates a new SDK instance for each invocation
A developer is testing a Docker-based application that uses the AWS SDK to interact with Amazon DynamoDB. In the local development environment, the application has used IAM access keys. The application is now ready for deployment onto an ECS cluster.
How should the application authenticate with AWS services in production?
Configure an ECS task IAM role for the application to use.
Refactor the application to call AWS STS AssumeRole based on an instance role.
Configure AWS access key/secret access key environment variables with new credentials.
Configure the credentials file with a new access key/secret access key.
A developer has created an AWS Lambda function to provide notification through Amazon Simple Notification Service (Amazon SNS) whenever a file is uploaded to Amazon S3 that is larger than 50 MB. The developer has deployed and tested the Lambda function by using the CLI. However, when the event notification is added to the S3 bucket and a 3,000 MB file is uploaded, the Lambda function does not launch.
Which of the following is a possible reason for the Lambda function's inability to launch?
The S3 event notification does not activate for files that are larger than 1,000 MB.
The resource-based policy for the Lambda function does not have the required permissions to be invoked by Amazon S3.
Lambda functions cannot be invoked directly from an S3 event.
The S3 bucket needs to be made public.
