All practice questions
1542 questions
A developer is implementing a secure audit logging system where an application running on Amazon EC2 instances encrypts log files locally before uploading them to Amazon S3. A separate analytics service running on AWS Fargate needs to decrypt and process these log files. The developer wants to use a customer managed key (CMK) in AWS KMS for envelope encryption and must ensure that all encryption and decryption operations are cryptographically bound to the encryption context `{"Project": "Audit"}`.
Which TWO actions must the developer perform to successfully implement this security architecture?
Select all that apply
A company is using AWS CodePipeline to automate their deployment process. The pipeline includes a deploy stage that triggers a custom AWS Lambda action to run database migrations against an Amazon RDS MySQL DB instance located in a private subnet. The migration script requires database credentials that must be rotated automatically every 14 days, as well as a non-sensitive database endpoint port number. During execution, the custom Lambda action fails. Which configuration should the developer implement to allow the Lambda function to securely run the migrations while optimizing for operational overhead, cost, and security?
A developer is configuring security for an Amazon API Gateway REST API. The API needs to validate JSON Web Tokens (JWT) issued by an Amazon Cognito User Pool. Additionally, the backend Lambda function, which is integrated using a Lambda Proxy integration, must be able to read the user's group memberships to apply application-level authorization. Which two configuration steps should the developer perform to achieve this? (Select TWO.)
Select all that apply
An organization is designing a B2B integration platform where partner companies consume API endpoints exposed via an Amazon API Gateway REST API. The partners authenticate using a third-party Identity Provider (IdP) and obtain a custom JWT containing a partnerId claim. The organization requires that partners can only access API paths matching /partners/{partnerId}/*. Which solution should a developer implement to meet these authorization requirements with the least administrative complexity?
A developer has configured an application running on an Amazon EC2 instance to decrypt database credentials using an AWS KMS customer managed key. The EC2 instance profile has an IAM policy attached that allows the `kms:Decrypt` action on the key's Amazon Resource Name (ARN). However, the application receives an `AccessDeniedException` error when attempting to decrypt the credentials. Which configuration change is required to resolve this authorization error?
A developer is building a healthcare application that processes patient medical images. Each image file is approximately in size. The developer needs to encrypt these images locally using client-side envelope encryption with an AWS KMS customer managed key before uploading them to an Amazon S3 bucket.
Which of the following steps must the developer perform to complete this encryption process? (Select TWO.)
Select all that apply
An organization requires a new microservice backend to run on AWS Lambda within a custom VPC. The function must query an Amazon Aurora MySQL database residing in a private subnet. The function also needs to retrieve database credentials from AWS Secrets Manager without any traffic transiting the public internet.
Which configuration should a developer implement to meet these requirements securely?
A developer is setting up a basic release pipeline using AWS CodePipeline to compile a containerized application and deploy it to Amazon Elastic Container Service (Amazon ECS). The source code is stored in an AWS CodeCommit repository. Which of the following configurations are required to successfully set up this pipeline? (Select TWO.)
Select all that apply
A developer is designing a serverless e-commerce application that runs on AWS Lambda and uses Amazon DynamoDB. The developer needs to implement a session state management solution to store user shopping carts externally, and a database caching solution to reduce read latency for popular products.
Which TWO architectural decisions should the developer make to meet these requirements? (Select TWO.)
Select all that apply
A developer is building a serverless backend for a mobile application. The APIs are exposed via an Amazon API Gateway REST API. The application uses an Amazon Cognito User Pool for user authentication. The developer needs to secure the API Gateway methods so that only authenticated users can access them. Additionally, the backend Lambda function must access the authenticated user's custom attribute, `custom:department`, to perform fine-grained data authorization. The client application is configured to pass the user's ID token in the HTTP `Authorization` header.
Which two configuration steps must the developer perform to meet these requirements?
Select all that apply
A developer is building a smart-home mobile application that connects to a backend hosted on Amazon API Gateway. Users authenticate with the application through an Amazon Cognito User Pool, which provides a JSON Web Token (JWT) upon login. The developer needs to secure the API Gateway REST API by verifying these JWTs before forwarding requests to the backend services.
Which of the following is the most operationally efficient method to authorize API requests using these JWTs?
A developer is planning the deployment strategy for a critical, high-volume API hosted on AWS Elastic Beanstalk. The API is highly sensitive to performance fluctuations under load and must maintain of its provisioned capacity throughout the deployment process. Additionally, company compliance requires that the update must be deployed onto brand-new EC2 instances to ensure compliance with a fresh OS base image, and any deployment failure must support an immediate rollback to minimize service disruption. Which two AWS Elastic Beanstalk deployment strategies should the developer choose to satisfy these requirements? (Select TWO.)
Select all that apply
A developer needs to deploy an update to a non-production web application running in an AWS Elastic Beanstalk environment. The update must be deployed as quickly as possible, and the developer can tolerate a brief period of downtime during the deployment. Additionally, no new EC2 instances should be provisioned to avoid temporary cost increases. Which deployment policy should the developer select?
A developer is configuring an Amazon ECS task definition to deploy a containerized application to AWS Fargate. The application needs a database password at startup. The password is saved as a secret in AWS Secrets Manager. The developer wants the Amazon ECS container agent to automatically retrieve the secret value and inject it as an environment variable into the container. Which configuration is required to achieve this?
A developer is managing a web application infrastructure deployed via an AWS CloudFormation stack. The stack includes an Auto Scaling group of Amazon EC2 instances, which are configured using AWS::CloudFormation::Init metadata and helper scripts to install packages and start the application. During a stack update, the update fails and rolls back because the new instances do not signal success to the stack within the specified timeout. Additionally, the developer suspects that team members might have made manual configuration changes directly on the production EC2 instances. Which two actions should the developer take to troubleshoot the deployment failure and address the configuration drift? (Choose two.)
Select all that apply
A developer is preparing to deploy a Node.js web application to an AWS Elastic Beanstalk environment. The deployment has two new requirements: it must securely retrieve a database password that is configured to rotate automatically, and it must install a custom security daemon package on the underlying Amazon EC2 instances during environment provisioning.
Which two actions should the developer take to meet these requirements?
Select all that apply
A developer is implementing user authentication for a web application. The application must allow users to register and sign in directly using their email addresses. Once signed in, the client application needs to invoke a secured REST API hosted on Amazon API Gateway. The developer wants to validate user sessions at the API Gateway layer while minimizing operational overhead and avoiding custom token-validation code.
Which configuration should the developer implement to meet these requirements?
A developer is designing a stateful web application that will be hosted on Amazon ECS across multiple Availability Zones. The application requires a shared, external session store to maintain user shopping carts. The session store must support sub-millisecond read/write latency, accommodate complex data structures such as lists and hashes for cart items, and automatically expire session records after 2 hours of inactivity to control costs. Additionally, the solution must survive cache node failures without losing user session data.
Which solution should the developer implement to meet these requirements?
A developer is configuring an AWS Lambda function to run inside a private subnet of a custom VPC. The function must retrieve configuration parameters from Systems Manager Parameter Store and send trace data to AWS X-Ray. Due to strict compliance guidelines, the VPC does not have a NAT Gateway or an Internet Gateway. Which two configurations must the developer implement to enable this connectivity? (Select TWO.)
Select all that apply
A developer is implementing client-side envelope encryption to secure local data files of size . The developer calls the AWS KMS `GenerateDataKey` API operation. What does this API operation return to the developer's application?