All practice questions
1542 questions
A developer is designing a new web application and needs to implement user sign-up, sign-in, and directory management capabilities. Which Amazon Cognito component should the developer use to meet these requirements?
A developer is configuring an application running on an Amazon EC2 instance that needs to read items from an Amazon DynamoDB table. The developer has created the following trust policy for an IAM role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which TWO steps must the developer complete to enable the application on the EC2 instance to securely access the DynamoDB table without hardcoding credentials?
Select all that apply
A developer has configured a microservice to perform actions in a different AWS account by assuming an IAM role. The microservice's execution role has an IAM policy that allows the sts:AssumeRole action on the target role's ARN. During execution, the microservice fails to assume the target role and receives an AccessDenied error. Which of the following is the most likely cause of this authorization failure?
An AWS Lambda function is configured to run inside private subnets of a custom VPC. The function needs to call a public external payment gateway API and also write results to an Amazon DynamoDB table. During testing, the function successfully connects to DynamoDB via a VPC gateway endpoint, but the connection attempts to the external payment gateway API consistently fail with connection timeout errors. The Lambda function's execution role has the AWSLambdaVPCAccessExecutionRole policy attached, and its security group allows all outbound traffic. Which two actions must the developer take to resolve the external API connectivity issue?
Select all that apply
A developer is updating a serverless application hosted on AWS Lambda and wants to roll out a new function version using AWS CodeDeploy. The deployment must route of incoming traffic to the new version initially. After a -minute observation period, if no errors are detected by Amazon CloudWatch alarms, all remaining traffic () must be routed to the new version. Which AWS CodeDeploy deployment configuration meets these requirements?
A developer is deploying a containerized application to an Amazon ECS cluster using the Amazon EC2 launch type. The application, which runs in a container with the `bridge` network mode, is designed to write records to an Amazon DynamoDB table. The developer specifies an IAM role named `DynamoDBWorkerRole` in the `taskRoleArn` parameter of the task definition. This IAM role has a policy that allows `dynamodb:PutItem` on the target table. However, at runtime, the application fails to write to DynamoDB and logs the following error:
`AccessDeniedException: User: arn:aws:sts::123456789012:assumed-role/ECSInstanceRole/i-0abcdef123456789 is not authorized to perform: dynamodb:PutItem on resource`
(Note: `` is the AWS account ID, and `ECSInstanceRole` is the IAM role associated with the EC2 container instances.)
Which of the following actions will resolve this issue?
An engineering team is developing a document management application. The application's frontend is a single-page application (SPA). The backend APIs are deployed on Amazon API Gateway (REST API) with AWS Lambda integrations. The application uses an Amazon Cognito User Pool for user authentication, which includes federated identity providers. The backend Lambda functions must receive the authenticated user's custom department attribute ('custom:department') to authorize document access at the application layer. The developers want to implement a highly performant and secure authorization mechanism that minimizes API calls and operational overhead.
Which solution should the developer implement to meet these requirements?
A developer is configuring an AWS Lambda function that needs to retrieve files from an Amazon S3 bucket. Which two IAM configurations are required to allow the Lambda function to assume its execution role and read the objects from the bucket? (Select TWO.)
Select all that apply
A serverless order processing application utilizes an AWS Lambda function to send confirmation emails via a third-party API. The function is also configured to access an Amazon Aurora PostgreSQL database in a private subnet. The developer has configured the Lambda function to run inside the private subnets of the VPC to enable database access.
During testing, the developer observes two issues:
1. The Lambda function fails to connect to the third-party email API.
2. The database connection pool is frequently exhausted, and Lambda execution logs show connection timeouts during concurrent invocations.
Which two actions should the developer take to resolve these issues?
Select all that apply
An organization is containerizing a legacy session manager and deploying it as a task on Amazon ECS with the AWS Fargate launch type. The application code requires permissions to write session state directly to an Amazon DynamoDB table. Additionally, the task's container image is hosted within a private Amazon Elastic Container Registry (ECR) repository. The developer needs to establish the correct IAM permissions for both the ECS container agent and the application itself to run successfully.
Which of the following configuration steps must the developer perform? (Select TWO.)
Select all that apply
A developer is designing a web application that will be hosted on Amazon ECS. The application requires a shared session state store to support horizontal scaling of container instances. The session data consists of semi-structured JSON documents that are updated frequently with each user request. The session documents must automatically expire and be deleted after 24 hours of inactivity to keep storage costs low. Which solution meets these requirements with the lowest operational overhead?
An application downloads a encrypted payload and its corresponding encrypted data key from an Amazon S3 bucket. The payload was encrypted client-side using envelope encryption with an AWS KMS customer managed key. Which of the following workflows should the developer implement in the application code to decrypt the payload?
A backend service uses an AWS Lambda function to process data files uploaded to Amazon S3. During execution, the function stops processing before completing, and the Amazon CloudWatch logs report that the function reached its configured execution limit of . Which action should the developer take to resolve this issue?
A developer is configuring an in-place deployment in AWS CodeDeploy for an application running on an Auto Scaling group with Amazon EC2 instances. To prevent performance degradation during peak hours, the application must maintain at least of its capacity ( instances) to serve traffic at all times during the deployment. The developer also wants to complete the deployment in the shortest time possible. Which deployment configuration should the developer use to meet these requirements?
A developer is preparing an AppSpec file for an Amazon ECS deployment using AWS CodeDeploy. The developer needs to define lifecycle hooks to validate the deployment before routing production traffic to the new task set. What target type must the developer specify in the AppSpec file to execute the validation tests?
A developer has configured an AWS Lambda function in AWS Account A to send messages to an Amazon Simple Queue Service (Amazon SQS) queue located in AWS Account B. During execution, the Lambda function fails with an AccessDenied error when attempting to write to the queue. Which two actions are required to resolve this authorization failure? (Select TWO.)
Select all that apply
A developer is building a serverless web application that allows users to sign in and upload files directly to an Amazon S3 bucket. The application must support user registration and sign-in, and provide temporary AWS credentials to authenticated users for S3 uploads. Which two Amazon Cognito features should the developer configure to meet these requirements? (Select TWO.)
Select all that apply
An application uses an AWS Lambda function associated with private subnets of a VPC to perform write operations on an Amazon RDS PostgreSQL database. The function also needs to write tracking data to an Amazon DynamoDB table, but the write operations to DynamoDB are failing with connection timeout errors. Which two actions should a developer take to resolve this connectivity issue? (Select TWO.)
Select all that apply
A developer is containerizing a Python microservice that uses the AWS SDK (Boto3) to retrieve objects from an Amazon S3 bucket. During local development on a macOS host, the developer runs the application in a Docker container using Docker Desktop. The container fails to authenticate with AWS and throws a `NoCredentialsError`. The host machine's AWS CLI is configured with a default profile and a named profile `local-dev` that contains active credentials.
Which TWO actions should the developer perform to resolve this authentication failure and allow the containerized application to use the `local-dev` credentials? (Choose two.)
Select all that apply
A developer is implementing authorization for an Amazon API Gateway REST API. The API serves as the backend for a web application where users register and log in directly using Amazon Cognito. The developer needs to validate the JSON Web Tokens (JWT) sent in the HTTP authorization header for each request. The solution should minimize both custom development effort and operational overhead. Which of the following approaches should the developer choose to secure the API?