All practice questions
1542 questions
A developer is deploying a containerized microservice to Amazon ECS using the AWS Fargate launch type. The application requires sensitive database credentials to be injected into the container as environment variables at startup from AWS Systems Manager Parameter Store. Additionally, the application must send its container logs to Amazon CloudWatch Logs using the awslogs log driver. Which configuration steps must the developer perform to establish the required IAM roles and permissions for this deployment? (Select TWO.)
Select all that apply
An organization is developing a web-based document portal using React. The portal must allow employees to authenticate using their existing corporate SAML identity provider (IdP). Once authenticated, the application must meet the following requirements:
1. Access a backend REST API hosted on Amazon API Gateway, validating the user's authentication token and verifying their group membership.
2. Directly download department-specific files from an Amazon S3 bucket, restricting access so that users can only retrieve objects under a prefix that matches their department attribute (e.g., /finance/* for the finance department).
Which combination of configuration steps will meet these requirements with the least operational overhead and the most secure architecture?
A developer is implementing client-side envelope encryption for a microservice that processes sensitive payload objects larger than before storing them in an Amazon DynamoDB table. The developer needs to minimize latency, avoid KMS cryptographic limits, and ensure secure key storage.
Which of the following workflows is the correct method to encrypt and store the payloads?
A developer is deploying a serverless application using a local AWS Serverless Application Model (SAM) template file named `template.yaml`. The template contains the following definition:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
GetProductFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs20.x
CodeUri: ./src
Events:
GetProduct:
Type: Api
Properties:
Path: /products/{id}
Method: get
The developer attempts to deploy the application directly by executing the following AWS CLI command:
`aws cloudformation deploy --template-file template.yaml --stack-name product-service-dev --capabilities CAPABILITY_IAM`
However, the command fails, indicating that the `CodeUri` property of the `AWS::Serverless::Function` resource must point to an Amazon S3 location.
Which of the following statements identifies the root cause of this error and the correct action to resolve it?
A developer is designing a serverless architecture for a report distribution application. The frontend is a Single Page Application (SPA) hosted on Amazon S3. The backend APIs are deployed using Amazon API Gateway. The developer needs to implement sign-up and sign-in functionality for users, secure the API Gateway endpoints, and allow the SPA to download reports directly from a private S3 bucket after authentication.
Which combination of actions should the developer take to meet these requirements securely? (Select TWO.)
Select all that apply
A developer attempts to create a new AWS CloudFormation stack to deploy a web application. The stack creation fails because of an invalid AMI ID parameter, and the stack enters the ROLLBACK_COMPLETE status. The developer updates the template with the correct AMI ID.
Which action should the developer take to deploy the resources successfully?
A developer is creating a web application and needs to provide a secure sign-up, sign-in, and password reset workflow for the application's users. The developer must also maintain a user directory to store user profile data. Which feature or service should the developer implement to meet these requirements?
A developer is building a mobile application that allows external users to authenticate using an external OpenID Connect (OIDC) identity provider. Once authenticated, users must be able to upload log files directly to a private Amazon S3 bucket. Each user's uploads must be restricted to an S3 folder named after their unique OIDC user identifier (the `sub` claim). The application also needs to write metadata for each upload to an Amazon DynamoDB table, using the same OIDC `sub` value as the partition key. Which solution meets these requirements with the least development effort and adheres to the principle of least privilege?
A developer is building a serverless web application that allows authenticated users to read and write items in a shared Amazon DynamoDB table. The application needs to support self-service user registration and login, as well as authenticate users via a secure directory. The client application runs in the browser and must interact directly with the DynamoDB table using temporary AWS credentials, ensuring that each user can only access items where the partition key matches their unique user identifier. Which combination of steps should the developer perform to configure the authentication and authorization mechanism? (Select TWO.)
Select all that apply
A developer is configuring a continuous delivery pipeline in AWS CodePipeline to automate the release of a containerized web application. The pipeline needs to retrieve source code, build a Docker image, deploy the application to Amazon ECS, and verify its status. Arrange the pipeline actions in the correct chronological sequence from start to finish.
Drag items to arrange them in the correct order
A company is developing a REST API in Amazon API Gateway that will serve a partner dashboard. The dashboard authenticates users through a third-party OpenID Connect (OIDC) identity provider. The developer needs to secure the API Gateway endpoints so that only users containing the PartnerAdmin role within their OIDC token can access the /partner/settings resource. To optimize performance and reduce backend overhead, the system must cache the authorization decisions for up to 10 minutes. Which two configuration steps should the developer perform to meet these requirements?
Select all that apply
An application needs to decrypt locally stored database backups that were encrypted using client-side envelope encryption with an AWS Key Management Service (AWS KMS) Customer Managed Key (CMK). The application has access to the encrypted database backups and the encrypted data key that was packaged with the backup. Which two actions must the developer perform in the application code to decrypt the database backups?
Select all that apply
A logistics company is developing a cargo tracking application. The mobile client authenticates users via an Amazon Cognito User Pool. The client application needs to invoke a REST API hosted on Amazon API Gateway to fetch real-time tracking data. The developer wants to restrict access to this API endpoint to ensure that only users authenticated by the user pool can access it. Which approach should the developer use to meet these requirements with the lowest latency and minimal operational overhead?
A developer is updating a critical, high-traffic API application deployed on AWS Elastic Beanstalk. The application must maintain full serving capacity during the deployment process. If any instance running the new version fails, the system must trigger an automatic rollback to the previous version with the absolute minimum time to restore the original state. The developer wants to avoid the overhead of managing a separate environment for Blue/Green deployments. Which deployment policy best satisfies these requirements?
A developer is implementing a cross-account ingestion pipeline where an AWS Lambda function running in Account A () needs to write files to an Amazon S3 bucket in Account B (). The Lambda function is configured with the execution role `arn:aws:iam::111111111111:role/LambdaExecutionRole`.
To write files, the Lambda function code uses the AWS SDK to assume an IAM role in Account B named `S3WriteRole` (`arn:aws:iam::222222222222:role/S3WriteRole`).
The IAM policy attached to `LambdaExecutionRole` in Account A is:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::222222222222:role/S3WriteRole"
}
]
}
When the Lambda function executes, the `sts:AssumeRole` API call fails with an `AccessDenied` error. The developer inspects the trust policy of `S3WriteRole` in Account B, which is currently configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which of the following modifications to Account B's `S3WriteRole` trust policy will resolve this authorization error?
A developer is configuring a continuous delivery pipeline in AWS CodePipeline to deploy a serverless web application. The pipeline needs to pause automatically after the test stage and wait for a QA manager to review the test results before deploying to the production stage. Which of the following is the correct configuration to implement this manual approval step?
A developer is designing a web application and wants to store user session states externally to make the application tier completely stateless. The session store must support high availability, scale horizontally, and allow fast key-value lookups. Which TWO of the following configurations should the developer implement? (Select TWO.)
Select all that apply
An enterprise has a backend service running on Amazon EC2 that needs to securely communicate with a protected REST API hosted on Amazon API Gateway. There is no user interaction involved in this communication. The developer wants to implement a secure, scalable authentication and authorization mechanism using Amazon Cognito to protect the API. How should the developer configure Amazon Cognito and API Gateway to meet these requirements with the least operational overhead?
A company needs to integrate an on-premises backend daemon service with a REST API hosted on AWS behind Amazon API Gateway. The daemon service must perform automated, non-interactive batch uploads to the API. Security requirements state that authentication must be handled via Amazon Cognito, leveraging OAuth 2.0 flows, and the service must be granted only the specific scope required for writing data (api/write). How should the developer configure Cognito and the daemon service to implement this authentication flow?
A developer is implementing a security feature for a web application to encrypt sensitive transaction records using an AWS KMS customer managed key (CMK). During the `Encrypt` API call, the developer passes the transaction ID as part of the encryption context: `{"TransactionID": "TX-98765"}`. During a scheduled audit, an offline compliance service attempts to decrypt the transaction records using the AWS SDK. The service's IAM role has full permissions to call `kms:Decrypt` on the CMK, but the decryption requests fail with an `InvalidCiphertextException`. How should the developer resolve this issue?