All practice questions
1542 questions
A developer is configuring a serverless application where an AWS Lambda function in Account A () needs to ingest records from an Amazon Kinesis data stream located in Account B (). The Lambda function runs under the execution role `arn:aws:iam::111111111111:role/LambdaExecutionRole`.
To accomplish this, the developer creates a role named `CrossAccountStreamReader` in Account B with the following permission policy attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kinesis:DescribeStream",
"kinesis:GetShardIterator",
"kinesis:GetRecords"
],
"Resource": "arn:aws:kinesis:us-east-1:222222222222:stream/DataIngestStream"
}
]
}
The Lambda function code is written to assume this role using the AWS Security Token Service (STS) before calling Kinesis APIs. However, when executing the function, the developer receives an `AccessDenied` error during the STS `AssumeRole` API call.
Which TWO configurations are required to resolve this error? (Select TWO.)
Select all that apply
A developer writes an AWS Serverless Application Model (SAM) template to deploy a Lambda function that reads objects from an Amazon S3 bucket. The template is configured as follows:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
ProcessUploadsFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src
Handler: index.handler
Runtime: nodejs18.x
Policies:
- S3ReadPolicy
When executing `sam deploy`, the deployment fails with a CloudFormation template validation or parsing error. Which of the following describes the root cause of this deployment failure and the correct resolution?
A developer is building a new web application and needs to implement user registration, login, and profile management. The developer wants to store user profile data directly in a managed user directory and support federated sign-in through external identity providers. Which Amazon Cognito feature should the developer use?
A developer is configuring the deployment settings for a critical production API hosted on AWS Elastic Beanstalk. The application currently runs on an Auto Scaling group of 8 instances and experiences a constant heavy workload. The deployment of the new application version must meet the following requirements:
- The environment must maintain its full capacity of 8 healthy instances running the current version during the deployment process.
- If the deployment fails, the rollback must be immediate and must not require redeploying the previous version to the instances, preventing any service disruption to the active environment.
- The new version must be deployed to new instances and pass health checks before any production traffic is routed to them.
Which Elastic Beanstalk deployment strategy satisfies these requirements?
A developer is building a partner portal API using an Amazon API Gateway REST API. External partner organizations will access this API using JSON Web Tokens (JWTs) issued by their own external OAuth 2.0 Identity Provider (IdP). The developer needs to secure the API so that requests are authorized only if the JWT is valid and contains a specific custom scope.
Which approach should the developer use to meet these security requirements with the least administrative and operational overhead?
A developer is configuring a containerized microservice deployed on AWS App Runner that needs to access a secure legacy database running on-premises and a third-party logistics API. The database credentials must be rotated automatically every 30 days using a custom rotation function that interacts with the on-premises database via an AWS Direct Connect connection. The third-party logistics API key is static, does not require automated rotation, and needs to be shared across multiple development environments cost-effectively. Which combination of steps should the developer take to manage these credentials in compliance with security best practices? (Select TWO.)
Select all that apply
A developer manages a web application deployed via an AWS CloudFormation stack. The stack contains an Amazon ECS service and an Amazon RDS database instance. During troubleshooting, a team member manually modifies the RDS security group rules in the AWS Management Console to allow temporary access. During a subsequent stack update to deploy a new ECS task definition, the update fails and the stack is left in the UPDATE_ROLLBACK_FAILED state. Additionally, the developer needs to store the database credentials securely and enable automatic rotation. Which approach should the developer take to resolve the stack's state and manage the credentials?
A developer is deploying an AWS Lambda function that processes transaction requests. The function is configured to run within the private subnets of a custom VPC. The Lambda function must connect to a private Amazon RDS PostgreSQL database cluster in the same VPC, call a public API endpoint of an external payment provider, and retrieve parameters from AWS Systems Manager Parameter Store. Which two network and security configurations should the developer implement to enable this connectivity? (Select two.)
Select all that apply
A company is developing a client-side web application where users need to log in to their accounts and then upload profile images directly to a private Amazon S3 bucket. Which Amazon Cognito features should the developer implement to meet these requirements? (Select TWO.)
Select all that apply
A company is evaluating AWS deployment strategies for its web application to ensure that any new version is deployed to brand new instances rather than updating the existing instances in-place. This approach is required to allow a clean separation of environments and a rapid rollback if issues are detected in production. Which two deployment strategies satisfy these requirements? (Select TWO.)
Select all that apply
A developer is configuring the following trust policy for an IAM role to be used by an AWS Lambda function:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which of the following describes the purpose of this trust policy?
A development team is preparing to deploy an application to Amazon ECS using the AWS Fargate launch type. The application container needs to pull its Docker image from a private Amazon ECR repository. Once the container is running, the application code needs to retrieve data from an Amazon S3 bucket.
Which IAM role configuration is required in the task definition to support this deployment?
A developer is managing a continuous delivery pipeline in AWS CodePipeline that consists of Source, Build, Test, and Production stages. The developer needs to temporarily stop code changes from being deployed to the Production stage while allowing developers to continue committing code and verifying builds in the Test stage. Additionally, the developer must configure the system to send email alerts to the operations team whenever any stage in the pipeline fails. Which combination of actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is building a mobile fitness tracking app. The app requires users to create an account, sign in with a username and password, and manage their profile data. The application does not need to access other AWS services directly from the mobile client. Which Amazon Cognito feature should the developer implement to provide the user directory and authentication services?
A developer is building a serverless web application that allows users to authenticate using external social identity providers (Google and Apple). After logging in, users must be able to upload files directly to a private Amazon S3 bucket. The frontend application runs in the user's browser.
Which two steps should the developer perform to configure authentication and authorization for this application? (Select TWO.)
Select all that apply
A developer is updating a web application hosted on an AWS Elastic Beanstalk environment. The developer needs to deploy the new application version as quickly as possible. The application is for internal testing, so temporary downtime during the deployment is acceptable, and there is no budget for additional Amazon EC2 instances. Which Elastic Beanstalk deployment strategy meets these requirements?
A company is deploying a secure microservice to Amazon ECS using the AWS Fargate launch type. The application code inside the container must pull messages from an Amazon SQS queue and write processed records to an Amazon DynamoDB table. Additionally, when the container is initialized, the Amazon ECS agent must retrieve database credentials from AWS Secrets Manager using the container definition secrets parameter and inject them as environment variables. The secret is encrypted using an AWS KMS customer managed key (CMK). During deployment, the tasks fail to transition to the RUNNING state, and the developer receives an error indicating that the container helper was unable to retrieve the Secrets Manager secret. How should the developer configure the IAM roles to resolve this issue and adhere to the principle of least privilege?
A developer is deploying a microservices application to Amazon ECS using the AWS Fargate launch type in AWS Account A. The container image is stored in a private Amazon Elastic Container Registry (Amazon ECR) repository located in AWS Account B. During deployment, the ECS tasks fail to transition to the RUNNING state, and the task status shows an error indicating that the container image cannot be pulled from the remote registry. Which combination of steps should the developer perform to resolve this authentication and access issue? (Select TWO.)
Select all that apply
A company is building a financial transactions API where an AWS Lambda function, attached to private subnets in a custom VPC, must query a private Amazon Aurora MySQL database. The function also needs to retrieve database credentials from AWS Systems Manager Parameter Store and dispatch transaction receipts to an external payment gateway. Security policies mandate that database traffic and credentials retrieval must not traverse the public internet. Which combination of network configurations and security settings will allow the function to perform all required tasks?
A developer is writing an appspec.yaml file to deploy updates to an AWS Lambda function using AWS CodeDeploy. Which of the following sections or hooks are valid for an AWS Lambda deployment? (Select TWO.)
Select all that apply