Free DOP-C02 Practice Questions & Study Guide (2026)

Official Exam Details: (DOP-C02)

Exam Code:
DOP-C02
Passing Score:
70%
Total Question Bank:
498 Verified Questions
Exam Duration:
120 Minutes

Exam Format & Question Types

This certification exam features multiple-choice questions (single and multi-select), interactive Hotspots, Hot Areas, and Drag-and-Drop scenario configurations designed to test real-world technical competency.

AWS DOP-C02: DevOps Engineer – Professional Certification Study Guide & Architectural Master Blueprint

This comprehensive study guide and architectural blueprint is designed to equip you with the advanced knowledge and strategic thinking required to excel in the AWS DOP-C02 DevOps Engineer – Professional certification exam. As an expert cloud architect and exam author, I’ve distilled the critical concepts and practical applications into an actionable resource, focusing exclusively on the DOP-C02 objectives.

Exam Overview & Profile

The AWS Certified DevOps Engineer – Professional (DOP-C02) certification validates expertise in provisioning, operating, and managing distributed application systems on the AWS platform. It targets professionals with two or more years of experience provisioning, operating, and managing AWS environments, with a strong emphasis on automation, infrastructure as code, continuous delivery, and monitoring.

  • Target Audience: DevOps engineers, solutions architects, and system administrators seeking to demonstrate advanced skills in implementing and managing CI/CD pipelines, monitoring, logging, and incident response on AWS.
  • Question Count: Approximately 65 questions.
  • Duration: 180 minutes to complete the exam.
  • Passing Score Context: A scaled score of 750 out of 1000 is typically required to pass. The exam features multiple-choice and multiple-response questions, often presented in scenario-based formats.

Deep-Dive Domain Breakdown

Success on DOP-C02 hinges on a profound understanding of each domain. Here’s an architectural breakdown of core concepts and services:

  • SDLC Automation:
    • AWS CodeServices: CodeCommit (source control), CodeBuild (compilation/testing), CodeDeploy (deployment automation, blue/green, canary), CodePipeline (orchestration of CI/CD workflows), CodeArtifact (package management).
    • Deployment Strategies: In-place, blue/green, canary. Understanding trade-offs (downtime, rollback complexity, risk mitigation).
    • Version Control: Git branching strategies (e.g., feature branch, GitFlow, trunk-based development).
    • Containers: ECR, ECS, EKS integration within CI/CD.
  • Configuration Management & Infrastructure as Code:
    • CloudFormation: Advanced templates (nested stacks, intrinsic functions, custom resources), change sets, drift detection, CloudFormation Guard.
    • AWS CDK: Infrastructure provisioning using familiar programming languages.
    • AWS Systems Manager (SSM): Parameter Store, State Manager (instance configuration), Run Command, Patch Manager.
    • AWS Config: Compliance enforcement and resource inventory.
  • Monitoring & Logging:
    • Amazon CloudWatch: Metrics, alarms, dashboards, Logs Insights, custom metrics, event rules (EventBridge).
    • AWS CloudTrail: API activity logging and auditing.
    • AWS X-Ray: Distributed tracing for microservices and serverless applications.
    • VPC Flow Logs: Network traffic visibility.
    • Centralized Logging: S3, Kinesis, Amazon OpenSearch Service.
  • Policies & Standards Automation:
    • IAM: Advanced policy crafting (conditions, resource-level permissions), roles for cross-service and cross-account access, federation, ABAC.
    • AWS Organizations: Service Control Policies (SCPs) for guardrails.
    • Security Services: GuardDuty, Security Hub, KMS, Secrets Manager.
    • Compliance: Automating adherence with AWS Config Rules.
  • Incident & Event Response:
    • AWS Lambda: Serverless compute for automated responses to events.
    • Amazon EventBridge (CloudWatch Events): Event-driven architecture for invoking Lambda, SNS, SQS.
    • AWS Step Functions: Orchestrating complex workflows for incident response.
    • Systems Manager Automation: Runbooks for automated operational procedures.
    • Disaster Recovery: RTO/RPO considerations driving strategies (backup/restore, pilot light, warm standby, multi-site).
  • High Availability, Fault Tolerance, & Disaster Recovery:
    • Auto Scaling: Dynamic scaling, lifecycle hooks, scaling policies.
    • Load Balancing: ALB, NLB, GLB (Route 53 latency/weighted routing).
    • Multi-AZ & Multi-Region Architectures: Designing for resilience across failure domains.
    • Database Strategies: RDS Multi-AZ, Aurora Global Database, DynamoDB global tables.

High-Yield Exam Tips & Scenario Traps

Mastering the exam’s nuances requires strategic thinking:

  • Automate Everything: When presented with a manual process, always look for an AWS service solution to automate it (e.g., Systems Manager, CloudFormation, CodePipeline, Lambda).
  • Prioritize Managed Services: AWS generally prefers its managed services over self-managed alternatives for scalability, reliability, and reduced operational overhead.
  • Least Privilege: Always design IAM policies with the principle of least privilege. Cross-account access should typically use roles, not shared credentials.
  • Security First: Encryption (at rest with KMS, in transit with TLS) is paramount. Understand WAF, Shield, GuardDuty, and Security Hub.
  • Cost Optimization: Consider Spot Instances for fault-tolerant workloads, S3 lifecycle policies, and appropriate instance sizing.
  • Blue/Green vs. Canary: Understand when to use each. Blue/green offers immediate rollback but requires double resources. Canary offers gradual rollout with fine-grained control and A/B testing potential.
  • Monitoring Depth: Differentiate between CloudWatch Logs (application/OS logs), CloudTrail (API calls), and VPC Flow Logs (network traffic).
  • RTO/RPO: These requirements are critical for determining the appropriate disaster recovery strategy. Low RTO/RPO often means multi-site active-active or warm standby.

Frequently Asked Questions (FAQ)

Q1: How should I structure my study time to maximize my chances of passing?

Dedicate significant time to hands-on practice, especially building CI/CD pipelines, deploying IaC with CloudFormation/CDK, and configuring monitoring/logging solutions. Review AWS whitepapers (e.g., Well-Architected Framework, DevOps on AWS), official documentation, and re:Invent presentations. Use reputable practice exams to identify your weaker domains and focus your efforts there. Aim for deep understanding, not just memorization.

Q2: What are the most essential resources for DOP-C02 preparation beyond this guide?

Key resources include the official AWS DOP-C02 exam guide, the AWS Well-Architected Framework (especially the Operational Excellence and Security pillars), the AWS Skill Builder learning path for DevOps Engineers, and detailed service documentation for CodePipeline, CodeDeploy, CloudFormation, Systems Manager, CloudWatch, and X-Ray. Engaging with the AWS community and forums can also provide valuable insights.

Q3: What’s the best strategy for approaching the scenario-based questions common in this exam?

Carefully read the entire question and all options. Identify keywords that indicate constraints or requirements (e.g., “most cost-effective,” “least operational overhead,” “minimal downtime,” “highly available,” “serverless”). Eliminate answers that clearly violate these constraints or introduce unnecessary complexity. Compare the remaining options, looking for the solution that best addresses all aspects of the scenario, prioritizing AWS best practices and managed services.

Q4: Is it necessary to have advanced programming language skills for DOP-C02?

While the exam focuses heavily on automation and infrastructure as code, it’s primarily service- and concept-oriented rather than code-heavy. General scripting knowledge (e.g., Bash, Python for Lambda functions or build scripts) is beneficial, but you won’t be writing complex applications during the exam. Understanding how to interpret CloudFormation templates, CodeBuild buildspecs, and Lambda function configurations is more critical than deep programming fluency.

Free DOP-C02 Sample Practice Questions

Test your knowledge with these sample scenario questions complete with verified explanations:

General Practice Questions

QUESTION 1

A DevOps engineer is building a continuous deployment pipeline for a serverless application that uses AWS Lambda functions. The company wants to the customer impact of an unsuccessful deployment. The company also wants to monitor for issues.

Which deploy stage configuration will meet these requirements?

  • A. Use an AWS Serverless Application Model (AWS SAM) template to define the serverless application. Use AWS to deploy the Lambda functions with the Canary10Percent15Minutes Deployment Preference Type. Use Amazon CloudWatch alarms to monitor the health of the functions.
  • B. Use AWS CloudFormation to publish a new stack and include Amazon CloudWatch alarms on all Set up an AWS CodePipeline approval action for a developer to verify and approve the AWS CloudFormation change set.
  • C. Use AWS CloudFormation to publish a new version on every stack and include Amazon CloudWatch alarms on all resources. Use the RoutingConfig of the resource to the traffic routing during the stack update.
  • D. Use AWS CodeBuild to add sample event for testing to the Lambda functions. Publish a new version of the functions, and include Amazon CloudWatch alarms. Update the production alias to point to the new version. Configure to when an alarm is in the ALARM state.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: AWS SAM with CodeDeploy’s Canary10Percent15Minutes deployment preference provides a controlled rollout, shifting 10% traffic for 15 minutes, which minimizes impact. CloudWatch alarms configured with CodeDeploy automatically monitor health and trigger rollbacks if issues arise, meeting all requirements for safe, monitored deployments.

❌ Why the other choices are incorrect:

  • Option B is incorrect: An AWS CodePipeline approval action is a manual gate, not an automated deployment strategy to minimize customer impact during a traffic shift. Deploying a new stack for every update is inefficient.
  • Option C is incorrect: While CloudFormation can update Lambda aliases with RoutingConfig, it lacks the integrated, automated monitoring and rollback orchestration for gradual deployments that AWS CodeDeploy provides natively for Lambda functions.
  • Option D is incorrect: Updating the production alias to the new version typically means an all-at-once traffic shift, which doesn’t minimize customer impact as effectively as a canary strategy. CodeBuild testing is for validation, not the deployment strategy itself.

QUESTION 2

A company has enabled all features for its organization in AWS Organizations. The organization contains 10 AWS accounts. The company has turned on AWS CloudTrail in all the accounts. The company expects the number of AWS accounts in the organization to increase to 500 during the next year. The company plans to use multiple OUS for these accounts.

The company has enabled AWS Config in each existing AWS account in the organization. A DevOps engineer must implement a solution that enables AWS Config automatically for all future AWS accounts that are created in the organization.

Which solution will meet this requirement?

  • A. In the organization's management account, create an Amazon EventBridge (Amazon CloudWatch Events) rule that reacts to a CreateAccountAPl call. Configure the rule to invoke an AWS Lambda function that enables trusted access to AWS Config for the organization.
  • B. In the organization's management account, create an AWS CloudFormation stack set to enable AWS Config. Configure the stack set to deploy automatically when an account is created through Organizations.
  • C. In the organization's management account, create an SCP that allows the appropriate AWS Config API calls to enable AWS Config. Apply the SCP to the root-level OU.
  • D. In the organization's management account, create an Amazon EventBridge (Amazon CloudWatch Events) rule that reacts to a CreateAccount API call. Configure the rule to invoke an AWS Systems Manager Automation runbook to enable AWS Config for the account.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: CloudFormation Stack Sets with service-managed permissions are designed to deploy a consistent baseline of resources, like AWS Config recorders and rules, across multiple accounts and OUs within an AWS Organization. They can be configured to automatically deploy to new accounts as they are created, ensuring Config is enabled organization-wide.

❌ Why the other choices are incorrect:

  • Option A is incorrect: An EventBridge rule reacting to CreateAccountAPI is triggered before the account is fully provisioned. More importantly, merely enabling trusted access for Config doesn’t automatically enable Config recorders or delivery channels within individual new accounts.
  • Option C is incorrect: SCPs (Service Control Policies) define maximum permissions for accounts, acting as guardrails. An SCP allowing Config API calls permits actions but does not automatically enable or provision AWS Config services in any account.
  • Option D is incorrect: While technically feasible, orchestrating this with EventBridge, Lambda, and Systems Manager Automation is less declarative and typically more complex to manage than CloudFormation Stack Sets, which are purpose-built for deploying baseline configurations across an AWS Organization.

QUESTION 3

A development team wants to use AWS CloudFormation stacks to deploy an application. However, the developer IAM role does not have the required permissions to provision the resources that are specified in the AWS CloudFormation template. A DevOps engineer needs to implement a solution that allows the developers to deploy the stacks. The solution must follow the principle of least privilege.

Which solution will meet these requirements?

  • A. Create an IAM policy that allows developers to provision the required resources. Attach the policy to the developer IAM role.
  • B. Create an IAM policy that allows fun access to AWS CloudFormation. Attach the to the developer IAM role.
  • C. Create an AWS CloudFormation service role that has the required permissions. Grant the developer LAM role a cloudformation: action. Use the new role during stack deployments.
  • D. Create an AWS CloudFormation service role the required permissions. Grant the developer IAM role the iam:PassRole permission. Use the new service role during stack deployments.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: This solution correctly implements least privilege. The CloudFormation service role holds the elevated permissions needed to provision resources. Developers are only granted iam:PassRole, allowing them to delegate this specific, pre-configured role to CloudFormation for stack deployments, without directly inheriting the provisioning permissions themselves.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Granting developers direct permissions to provision resources via an IAM policy violates the principle of least privilege, giving them broader access than just through CloudFormation.
  • Option B is incorrect: "Full access to AWS CloudFormation" is overly permissive and violates least privilege. It grants wide-ranging control over CloudFormation itself, but still doesn’t inherently give CloudFormation permission to provision underlying resources unless specified.
  • Option C is incorrect: While creating a service role is correct, granting the developer a general cloudformation:action without iam:PassRole means CloudFormation would attempt to provision resources using the developer’s insufficient permissions, or the developer couldn’t properly delegate the service role.

QUESTION 4

A company has multiple AWS accounts. The company uses AWS Single Sign-On (AWS SSO) that is integrated with AWS Toolkit for Microsoft Azure DevOps. The attributes for access control feature is enabled in AWS SSO.

The attribute mapping list contains two entries. The department key is mapped to ${path:enterprise.department). The costCenter key is mapped to ${path:enterprise.costCenter).

All existing Amazon EC2 instances have a department tag that corresponds to three company departments (dl, d2, d3). A DevOps engineer must create policies based on the matching attributes. The policies must minimize administrative effort and must grant each Azure AD user access to only the EC2 instances that are tagged with the user’s respective department name.

Which condition key should the DevOps engineer include in the custom permissions policies to meet these requirements?

  • A. options/DOPC02_6c8c81478b.webp
  • B. options/DOPC02_84bd9ff53a.webp
  • C. options/DOPC02_59aef6fc80.webp
  • D. options/DOPC02_42640ade47.webp
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: This condition key (aws:PrincipalTag/department) correctly compares the user’s department attribute (passed by AWS SSO as a principal tag) with the EC2 instance’s department tag. This implements Attribute-Based Access Control (ABAC), minimizing administrative effort by dynamically granting access based on matching tags.

❌ Why the other choices are incorrect:

  • Option A is incorrect: aws:RequestTag/department refers to tags included in the API request, not the user’s attributes (principal tags) or resource tags, and the comparison is reversed.
  • Option B is incorrect: aws:TagKeys is used to restrict which tag keys can be applied to a resource, not for comparing principal attributes to resource tags for access control.
  • Option D is incorrect: sso:IdentityStoreTag/department is not a standard IAM condition key. AWS SSO user attributes are exposed in policies as aws:PrincipalTag.

QUESTION 5

A DevOps engineer needs to apply a core set of security controls to an existing set of AWS accounts. The accounts are in an organization in AWS Organizations. Individual teams will administer individual accounts by using the AdministratorAccess AWS managed policy. For all accounts, AWS CloudTrail and AWS Config must be turned on in all available AWS Regions. Individual account administrators must not be able to edit or delete any of the baseline resources.

However, individual account administrators must be able to edit or delete their own CloudTrail trails and AWS Config rules.

Which solution will meet these requirements in the MOST operationally efficient way?

  • A. Create an AWS CloudFormation template that defines the standard account resources. Deploy the template to all accounts from the organization's management account by using CloudFormation StackSets. Set the stack policy to deny Update:Delete actions.
  • B. Enable AWS Control Tower. Enroll the existing accounts in AWS Control Tower. Grant the individual account administrators access to CloudTrail and AWS Config.
  • C. Designate an AWS Config management account. Create AWS Config recorders in all accounts by using AWS CloudFormation StackSets. Deploy AWS Config rules to the organization by using the AWS Config management account.Create a CloudTrail organization trail in the organization's management account. Deny modification or deletion of the AWS Config recorders by using an SCP.
  • D. Create an AWS CloudFormation template that defines the standard account resources. Deploy the template to all accounts from the organization's management account by using CloudFormation StackSets. Create an SCP that prevents updates or deletions to CloudTrail resources or AWS Config resources unless the principal is an administrator of the organization's management account.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: CloudFormation StackSets efficiently deploy baseline CloudTrail and AWS Config resources to all accounts. An SCP, enforced by AWS Organizations, prevents individual account administrators from modifying these baseline resources while allowing them to create/manage their own, meeting all requirements immutability and flexibility goals operationally efficiently.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Stack policies apply to the entire stack and are managed within the account. An administrator with AdministratorAccess could potentially modify the stack policy itself, or it would prevent all modifications, not just the baseline, conflicting with the requirement that administrators can edit their own trails/rules.
  • Option B is incorrect: Control Tower, while providing security, is often geared for new account provisioning. Enrolling existing accounts can be complex, and its default guardrails might not offer the precise granular control needed to protect only the baseline resources while allowing modifications to other (user-created) resources efficiently without extensive customization.
  • Option C is incorrect: An SCP protecting only AWS Config recorders would prevent individual administrators from managing their own Config rules (which depend on recorders), violating the requirement. It also doesn’t specify how CloudTrail baseline is protected with the same nuance.

QUESTION 6 (Multi-Select)

An ecommerce company has chosen AWS to host its new platform. The company’s DevOps team has started building an AWS Control Tower landing zone. The DevOps team has set the identity store within AWS Single Sign-On (AWS SSO) to external identity provider (ldP) and has configured SAML 2.0.

The DevOps team wants a robust permission model that applies the principle of least privilege. The model must allow the team to build and manage only the team’s own resources.

Which combination of steps will meet these requirements? (Select THREE.)

  • A. Create IAM policies that include the required permissions. Include the aws:PrincipalTag condition key.
  • B. Create permission sets. Attach an inline policy that includes the required permissions and uses the aws:PrincipalTag condition key to scope the permissions.
  • C. Create a group in the ldP. Place users in the group. Assign the group to accounts and the permission sets in AWS SSO.
  • D. Create a group in the ldP. Place users in the group. Assign the group to OUS and IAM policies.
  • E. Enable attributes for access control in AWS SSO. Apply tags to users. Map the tags as key-value pairs.
  • F. Enable attributes for access control in AWS SSO. Map attributes from the ldP as key-value pairs.
Click to View Verified Solution & Explanation

Correct Option: B,C,F

Explanation: ✅ Option B (Correct)
Reasoning: Permission sets in AWS SSO define access across accounts. Attaching an inline policy with aws:PrincipalTag enables Attribute-Based Access Control (ABAC), scoping permissions based on attributes (tags) assigned to the user/principal. This precisely supports least privilege, allowing the team to manage only resources tagged with their team’s identifier.


✅ Option C (Correct)
Reasoning: With an external IdP, user groups are managed in the IdP. Creating groups there and assigning them to AWS SSO accounts and permission sets is the standard method for provisioning user access. This integrates the IdP-managed groups with AWS SSO’s permission model, centralizing identity and access management.


✅ Option F (Correct)
Reasoning: To utilize aws:PrincipalTag for ABAC (as in option B), attributes must be passed from the external IdP to AWS SSO. Enabling attributes for access control in AWS SSO and mapping IdP attributes as key-value pairs makes these attributes available as session tags, critical for implementing attribute-based policies.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While aws:PrincipalTag is correct, directly creating IAM policies isn’t the primary method for defining permissions in an AWS SSO managed environment. Permissions are defined within AWS SSO permission sets, which then deploy IAM roles and policies to target accounts.
  • Option D is incorrect: AWS SSO assigns groups to accounts and permission sets, not directly to OUs or IAM policies. OUs define the organizational structure, and IAM policies are components within permission sets, not directly assigned to IdP groups.
  • Option E is incorrect: When using an external IdP, user attributes for ABAC should originate from and be mapped from the IdP. Applying tags directly to users within AWS SSO or mapping tags without explicitly sourcing them from the IdP isn’t the intended or primary method for ABAC with external identity providers.

QUESTION 7

A DevOps engineer is creating an AWS CloudFormation template to deploy a web service. The web service will run on Amazon EC2 instances in a private subnet behind an Application Load Balancer (ALB). The DevOps engineer must ensure that the service can accept requests from clients that have IPv6 addresses.

What should the DevOps engineer do with the CloudFormation template so that IPv6 clients can access the web service?

  • A. Add an IPv6 CIDR block to the VPC and the private subnet for the EC2 instances. Create route table entries for the IPv6 network, use EC2 instance types that support IPv6, and assign IPv6 addresses to each EC2 instances.
  • B. Assign each EC2 instance an IPv6 Elastic IP address. Create a target group, and add the EC2 instances as targets. Create a listener on port 443 of the ALB, and associate the target group with the ALB.
  • C. Replace the ALB with a Network Load Balancer (NLB). Add an IPv6 CIDR block to the VPC and subnets for the NLB, and assign the NLB and IPv6 Elastic address.
  • D. Add an IPv6 CIDR block to the VPC and subnets for the ALB. Create a listener on port 443, and specify the dualstack IP address type on the ALB. Create a target group, and add the EC2 instances as targets. Associate the target group with the ALB.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: To enable IPv6 clients to access the service via an ALB, the ALB must be configured with a dualstack IP address type. This allows the ALB to receive both IPv4 and IPv6 requests. The subnets where the ALB operates must also have IPv6 CIDR blocks associated. The ALB can then forward traffic to IPv4-only EC2 instances.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While adding IPv6 to VPC, subnets, and EC2 instances enables IPv6 at the instance level, it doesn’t configure the ALB itself to accept IPv6 client requests. The ALB’s IP address type must be set to dualstack.
  • Option B is incorrect: Assigning IPv6 Elastic IP addresses directly to EC2 instances would bypass the Application Load Balancer, contradicting the scenario where the service runs behind an ALB.
  • Option C is incorrect: Replacing the ALB with a Network Load Balancer (NLB) is unnecessary. ALBs fully support IPv6 client access through their dualstack IP address type, providing Layer 7 features beneficial for web services.

QUESTION 8

A video-sharing company stores its videos in Amazon S3. The company has observed a sudden increase in access requests, but the company does not know which videos are most popular. The needs to identify the general access pattern for the video files. This pattern includes the number of users who access a certain file on a given day, as well as the number of pull requests for certain files.

How can the company meet these requirements with the LEAST amount of effort?

  • A. Activate S3 server access logging. Import the logs into an Amazon Aurora database. Use an Aurora SQL query to analyze the access patterns.
  • B. Activate S3 server access logging. Use Amazon Athena to create an external table with the log files. Use Athena to create a SQL query to analyze the patterns.
  • C. Invoke an AWS Lambda function for every S3 object access event. Configure the function to write the file access information, such as user, S3 bucket, and file key, to an Amazon Aurora database. Use an Aurora SOL query to analyze the patterns.
  • D. Record an Amazon CloudWatch Logs log message for every S3 object event. Configure a CloudWatch log stream to write the file access information, such as user, S3 bucket, and file key, to an Amazon Kinesis Data Analytics for SQL application. Perform a sliding window analysis.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: S3 server access logging directly captures all necessary access data. Amazon Athena allows querying these logs in situ using standard SQL without moving data or provisioning servers. This serverless approach offers the most straightforward and "least effort" solution for analyzing existing log patterns.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Importing S3 logs into an Amazon Aurora database adds significant ETL effort, infrastructure management, and cost compared to Athena’s serverless direct query capability.
  • Option C is incorrect: Invoking Lambda for every S3 access event would be extremely expensive, create high operational overhead, and is unnecessary for retrospective pattern analysis. It’s an active event-driven approach, not "least effort."
  • Option D is incorrect: Recording CloudWatch Logs for every S3 event generates massive log volumes and high costs. Kinesis Data Analytics is for real-time stream processing, not the most efficient tool for analyzing historical access patterns from existing S3 logs.

QUESTION 9

A development team uses AWS CodeCommit, AWS CodePipeline, and AWS CodeBuild to develop and deploy an application. Changes to the code are submitted by pull requests. The development team reviews and merges the pull requests, and then the pipeline builds and tests the application.

Over time, the number of pull requests has increased. The pipeline is frequently blocked because of failing tests. To prevent this blockage, the development team wants to run the unit and integration tests on each pull request before it is merged.

Which solution will meet these requirements?

  • A. Create a CodeBuild project to run the unit and integration tests. Create a CodeCommit approval rule template. Configure the template to require the successful invocation of the CodeBuiId project. Attach the approval rule to the project's CodeCommit repository.
  • B. Create an Amazon EventBridge (Amazon CloudWatch Events) rule to match events from CodeCommit. Create a CodeBuild project to run the unit and integration tests. Configure the CodeBuild project as a target of the EventBridge (CloudWatch Events) rule that includes a custom event payload with the CodeCommit repository and branch information from the event.
  • C. Create an Amazon EventBridge (Amazon CloudWatch Events) rule to match events from Modify the existing CodePipeline pipeline to not run the deploy steps if the build is started from a pull request. Configure the EventBridge (CloudWatch Events) rule to run the pipeline with a custom payload that the CodeCommit repository and branch information from the event.
  • D. Create a CodeBuild project to run the unit and integration tests. Create a CodeCommit notification rule that matches when a pull request is created or updated. Configure the notification rule to invoke the CodeBuild project.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: EventBridge (CloudWatch Events) rules accurately detect CodeCommit pull request events. This triggers a dedicated CodeBuild project for unit and integration tests. The event payload provides necessary branch and repository details to CodeBuild, enabling pre-merge testing before the main pipeline is affected.

❌ Why the other choices are incorrect:

  • Option A is incorrect: CodeCommit approval rules can require successful CodeBuild invocation, but they don’t initiate the CodeBuild project itself upon PR creation. A separate trigger is needed.
  • Option C is incorrect: Modifying the main CodePipeline to run for PRs and skip deploy steps is a less efficient and more complex approach than a dedicated CodeBuild project. The main pipeline is intended for post-merge.
  • Option D is incorrect: CodeCommit notification rules can send events to targets like SNS or Lambda, but they cannot directly invoke a CodeBuild project. An intermediary (e.g., Lambda) would be required, making this solution incomplete as described.

QUESTION 10

A development team is using AWS CodeCommit to version control application code and AWS CodePipeline to orchestrate software deployments. The team has decided to use a remote master branch as the trigger for the pipeline to integrate code changes. A developer has pushed code changes to the CodeCommit repository, but noticed that the pipeline had no reaction, even after 10 minutes.

Which of the following actions should be taken to troubleshoot this issue?

  • A. Check that an Amazon CloudWatch Events rule has been created for the master branch to trigger the pipeline.
  • B. Check that the CodePipeline service role has permission to access the CodeCommit repository.
  • C. Check that the developer’s IAM role has permission to push to the CodeCommit repository.
  • D. Check to see if the pipeline failed to start because of CodeCommit errors in Amazon CloudWatch Logs.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: CodePipeline typically relies on Amazon CloudWatch Events (now EventBridge) to detect changes in CodeCommit repositories and trigger pipelines. If no CloudWatch Events rule exists or is misconfigured for the specified branch (e.g., ‘master’), the pipeline will not receive the event to start, resulting in no reaction even after a successful push.

❌ Why the other choices are incorrect:

  • Option B is incorrect: If the CodePipeline service role lacked CodeCommit permissions, the pipeline would likely start but fail during the source stage when trying to fetch the code, not fail to trigger entirely.
  • Option C is incorrect: The scenario states the developer "has pushed code changes," implying the push was successful. If permissions were an issue, the push itself would have failed, not the pipeline trigger.
  • Option D is incorrect: CloudWatch Logs for CodeCommit errors are relevant for repository issues or after a pipeline starts and encounters CodeCommit-related problems. This doesn’t explain why the pipeline didn’t start in the first place.

QUESTION 11 (Multi-Select)

An ecommerce company has chosen AWS to host its new platform. The company’s DevOps team has started building an AWS Control Tower landing zone. The DevOps team has set the identity store within AWS IAM Identity Center (AWS Single Sign-On) to external identity provider (IdP) and has configured SAML 2.0.

The DevOps team wants a robust permission model that applies the principle of least privilege. The model must allow the team to build and manage only the team’s own resources.

Which combination of steps will meet these requirements? (Choose three.)

  • A. Create IAM policies that include the required permissions. Include the aws:PrincipalTag condition key.
  • B. Create permission sets. Attach an inline policy that includes the required permissions and uses the aws:PrincipalTag condition key to scope the permissions.
  • C. Create a group in the IdP. Place users in the group. Assign the group to accounts and the permission sets in IAM Identity Center.
  • D. Create a group in the IdP. Place users in the group. Assign the group to OUs and IAM policies.
  • E. Enable attributes for access control in IAM Identity Center. Apply tags to users. Map the tags as key-value pairs.
  • F. Enable attributes for access control in IAM Identity Center. Map attributes from the IdP as key-value pairs.
Click to View Verified Solution & Explanation

Correct Option: B,C,F

Explanation: ✅ Option B (Correct)
Reasoning: Permission sets are the mechanism within IAM Identity Center for defining permissions. Attaching an inline policy with aws:PrincipalTag enables Attribute-Based Access Control (ABAC). This scopes permissions based on user attributes (passed as principal tags) matching resource tags, ensuring users manage only resources tagged with their associated attributes.


✅ Option C (Correct)
Reasoning: With an external IdP, user groups are managed externally. This step correctly outlines how to integrate these groups by assigning them to AWS accounts and permission sets in IAM Identity Center, thereby granting users access based on their IdP group membership and the defined permissions.


✅ Option F (Correct)
Reasoning: To utilize aws:PrincipalTag for ABAC with an external IdP, you must first enable "attributes for access control" in IAM Identity Center. This crucial step maps user attributes from the external IdP (e.g., department=devops) into session tags, which can then be referenced by policies using the aws:PrincipalTag condition key.

❌ Why the other choices are incorrect:

  • Option A is incorrect: IAM policies are generally attached to IAM users/roles directly in individual accounts. IAM Identity Center uses permission sets as its primary mechanism for assigning permissions to users or groups, not direct IAM policies for user access.
  • Option D is incorrect: IAM Identity Center assigns groups to accounts and permission sets, not Organizational Units (OUs). OUs are for organizational structure and Service Control Policies (SCPs), not direct user permission assignment.
  • Option E is incorrect: While enabling attributes for access control is correct, you do not "apply tags to users" directly within IAM Identity Center when using an external IdP. Instead, you map attributes from the IdP (as described in option F) to be used as session tags.

QUESTION 12

A company has an on-premises application that is written in A DevOps engineer must move the application to AWS The company’s development team wants to enable blue/green deployments and perform ALB testing.

Which solution will meet these requirements?

  • A. Deploy the application on an Amazon EC2 instance, and create an AMI of the instance. Use the AMI to create an automatic scaling launch configuration that is used in an Auto Scaling group. Use Elastic Load Balancing to distribute traffic When changes are made to the application, a new AMI will be which will initiate an EC2 instance refresh.
  • B. Use Amazon LightSail to deploy the application. Store the application in a zipped format in an Amazon S3 bucket. Use this zipped version to deploy new versions of the application to Lightsail. Use LightSail deployment options to manage the deployment.
  • C. Use AWS CodeArtifact to store the application code. Use AWS CodeDeploy to deploy the application to a fleet of Amazon EC2 instances. Use Elastic Load Balancing to distribute the traffic to the EC2 instances. When making changes to the application, upload a new version to CodeArtifact and create a new CodeDeploy deployment.
  • D. Use AWS Elastic Beanstalk to host the application. Store a version of the application in Amazon S3. Use that location to deploy new versions of the application. Use Elastic Beanstalk to manage the deployment options.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: AWS Elastic Beanstalk natively supports blue/green deployments and integrates seamlessly with Application Load Balancers (ALBs). It provides built-in deployment policies to manage traffic shifting between environment versions, making it ideal for testing new application versions on an ALB before a full cutover.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While EC2, Auto Scaling Groups, and instance refreshes can be part of a deployment strategy, they do not inherently provide the integrated blue/green deployment capabilities or direct ALB testing features that Elastic Beanstalk offers without significant custom scripting and orchestration.
  • Option B is incorrect: Amazon Lightsail is a simplified platform designed for basic web applications and does not offer native blue/green deployment options or the advanced ALB testing and traffic management required for this professional DevOps scenario.
  • Option C is incorrect: AWS CodeDeploy can perform blue/green deployments, but Elastic Beanstalk offers a higher-level, more integrated solution for environment provisioning, application deployment, and ALB management. CodeArtifact is primarily for package management, not the deployment mechanism itself.

QUESTION 13

A company has developed a serverless web application that is hosted on AWS. The application consists of Amazon S3. Amazon API Gateway, several AWS Lambda functions, and an Amazon RDS for MySQL database. The company is using AWS CodeCommit to store the source code. The source code is a combination of AWS Serverless Application Model (AWS SAM) templates and Python code.

A security audit and penetration test reveal that user names and passwords for authentication to the database are hardcoded within CodeCommit repositories. A DevOps engineer must implement a solution to automatically detect and prevent hardcoded secrets.

What is the MOST secure solution that meets these requirements?

  • A. Enable Amazon CodeGuru Profiler. Decorate the handler function with @with_lambda_profiler(). Manually review the recommendation report. Write the secret to AWS Systems Manager Parameter Store as a secure string. Update the SAM templates and the Python code to pull the secret from Parameter Store.
  • B. Associate the CodeCommit repository with Amazon CodeGuru Reviewer. Manually check the code review for any recommendations. Choose the option to protect the secret. Update the SAM templates and the Python code to pull the secret from AWS Secrets Manager.
  • C. Enable Amazon CodeGuru Profiler. Decorate the handler function with @with lambda profiler(). Manually review the recommendation report. Choose the option to protect the secret. Update the SAM templates and the Python code to pull the secret from AWS Secrets Manager.
  • D. Associate the CodeCommit repository with Amazon CodeGuru Reviewer. Manually check the code review for any recommendations. Write the secret to AWS Systems Manager Parameter Store as a string. Update the SAM templates and the Python code to pull the secret from Parameter Store.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Amazon CodeGuru Reviewer automatically detects hardcoded secrets and security vulnerabilities in code. AWS Secrets Manager is the most secure service for storing and managing database credentials, offering automatic rotation, encryption, and granular access control, fulfilling both detection and prevention requirements securely.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Amazon CodeGuru Profiler analyzes application performance and resource utilization, not security vulnerabilities like hardcoded secrets. AWS Systems Manager Parameter Store (even as a secure string) is less specialized for database secrets than Secrets Manager.
  • Option C is incorrect: Amazon CodeGuru Profiler does not detect hardcoded secrets. While Secrets Manager is correct for storage, the detection method is flawed.
  • Option D is incorrect: Storing the secret as a plain "string" in AWS Systems Manager Parameter Store is highly insecure and does not meet the "MOST secure" requirement. Secrets Manager is generally preferred for database credentials over Parameter Store (even secure string) for its advanced features.

QUESTION 14

A company uses AWS Storage Gateway in file gateway mode in front of an Amazon S3 bucket that is used by multiple resources. In the morning when business begins, users do not see the objects processed by a third party the previous evening. When a DevOps engineer looks directly at the S3 bucket, the data is there, but it is missing in Storage Gateway.

Which solution ensures that all the updated third-party files are available in the morning?

  • A. Configure a nightly Amazon EventBridge (Amazon CloudWatch Events) event to trigger an AWS Lambda function to run the RefreshCache command for Storage Gateway.
  • B. Instruct the third party to put data into the S3 bucket using AWS Transfer for SFTP.
  • C. Modify Storage Gateway to run in volume gateway mode.
  • D. Use S3 same-Region replication to replicate any changes made directly in the S3 bucket to Storage Gateway.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: AWS Storage Gateway in file gateway mode caches S3 objects. Changes made directly to the S3 bucket by external processes (like a third party) are not automatically visible. The RefreshCache operation explicitly updates the gateway’s cache from S3, making new objects visible. Automating this nightly via EventBridge and Lambda ensures availability.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Instructing the third party to use AWS Transfer for SFTP still involves direct uploads to S3, bypassing Storage Gateway. This means the gateway’s cache would still be out of sync, requiring a RefreshCache.
  • Option C is incorrect: Modifying Storage Gateway to volume gateway mode changes its entire functionality to block storage (iSCSI volumes), not a file share. This wouldn’t resolve the issue of files uploaded directly to S3 not appearing in a file gateway.
  • Option D is incorrect: S3 same-Region replication replicates objects between S3 buckets. Storage Gateway interacts with a single S3 bucket as its backend; it is not a replication target itself. This option misapplies S3 replication.

QUESTION 15 (Multi-Select)

A company’s application is currently deployed to a single AWS Region. Recently, the company opened a new office on a different continent. The users in the new office are experiencing high latency. The company’s application runs on Amazon EC2 instances behind an Application Load Balancer (ALB) and uses Amazon DynamoDB as the database layer. The instances run in an EC2 Auto Scaling group across multiple Availability Zones. A DevOps Engineer is tasked with minimizing application response times and improving availability for users in both Regions.

Which combination of actions should be taken to address the latency issues? (Choose three.)

  • A. Create a new DynamoDB table in the new Region with cross-Region replication enabled.
  • B. Create new ALB and Auto Scaling group global resources and configure the new ALB to direct traffic to the new Auto Scaling group.
  • C. Create new ALB and Auto Scaling group resources in the new Region and configure the new ALB to direct traffic to the new Auto Scaling group.
  • D. Create Amazon Route 53 records, health checks, and latency-based routing policies to route to the ALB.
  • E. Create Amazon Route 53 aliases, health checks, and failover routing policies to route to the ALB.
  • F. Convert the DynamoDB table to a global table.
Click to View Verified Solution & Explanation

Correct Option: C,D,F

Explanation: ✅ Option C (Correct)
Reasoning: Deploying the application stack (ALB, EC2, Auto Scaling) in the new Region brings compute resources closer to the new users, directly reducing network latency. ALBs and ASGs are regional services, requiring a separate deployment per region for a multi-region architecture.


✅ Option D (Correct)
Reasoning: Route 53 with latency-based routing automatically directs users to the closest healthy AWS Region hosting the application, minimizing network travel time. Health checks ensure traffic is only routed to operational ALBs in active regions, improving availability.


✅ Option F (Correct)
Reasoning: Converting to DynamoDB Global Tables provides active-active, multi-region database replication. This ensures users in both regions access a local copy of the data with low latency, preventing the database from becoming a bottleneck in the multi-region setup.

❌ Why the other choices are incorrect:

  • Option A is incorrect: DynamoDB Global Tables are the managed solution for active-active, bi-directional multi-region replication. Manually setting up a new table with simple cross-region replication might imply a less robust or less performant solution than Global Tables for active-active use.
  • Option B is incorrect: ALBs and Auto Scaling Groups are regional services, not global. You cannot create "global" ALB or Auto Scaling group resources; they must be deployed within a specific AWS Region.
  • Option E is incorrect: Failover routing is for active-passive disaster recovery, not optimizing latency for active users in both regions. Latency-based routing is specifically designed to direct users to the closest healthy endpoint to minimize response times.

QUESTION 16

A company wants to migrate its content sharing web application hosted on Amazon EC2 to a serverless architecture. The company currently deploys changes to its application by creating a new Auto Scaling group of EC2 instances and a new Elastic Load Balancer, and then shifting the traffic away using an Amazon Route 53 weighted routing policy.

For its new serverless application, the company is planning to use Amazon API Gateway and AWS Lambda. The company will need to update its deployment processes to work with the new application. It will also need to retain the ability to test new features on a small number of users before rolling the features out to the entire user base.

Which deployment strategy will meet these requirements?

  • A. Use AWS CDK to deploy API Gateway and Lambda functions. When code needs to be changed, update the AWS CloudFormation stack and deploy the new version of the APIs and Lambda functions. Use a Route 53 failover routing policy for the canary release strategy.
  • B. Use AWS CloudFormation to deploy API Gateway and Lambda functions using Lambda function versions. When code needs to be changed, update the CloudFormation stack with the new Lambda code and update the API versions using a canary release strategy. Promote the new version when testing is complete.
  • C. Use AWS Elastic Beanstalk to deploy API Gateway and Lambda functions. When code needs to be changed, delpoy a new version of the API and Lambda functions. Shift traffic gradually using an Elastic Beanstalk blue/green deployment.
  • D. Use AWS OpsWorks to deploy API Gateway in the service layer and Lambda functions in a custom layer. When code needs to be changed, use OpsWorks to perform a blue/green deployment and shift traffic gradually.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: CloudFormation is ideal for deploying API Gateway and Lambda, leveraging Lambda versions for controlled deployments. API Gateway supports canary release strategies by shifting traffic between different Lambda aliases/versions, meeting the requirement to test new features on a small user subset before full rollout.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Route 53 failover routing is for disaster recovery, not for a gradual traffic shift or canary release strategy.
  • Option C is incorrect: Elastic Beanstalk is primarily for EC2-based applications and containers, not the native deployment and management of serverless API Gateway and Lambda functions. Its blue/green deployments are not for this serverless architecture.
  • Option D is incorrect: AWS OpsWorks is for managing applications on EC2 instances or on-premises servers using Chef/Puppet, not for native serverless API Gateway/Lambda deployments and canary releases.

QUESTION 17 (Multi-Select)

A company is developing a new application. The application uses AWS Lambda functions for its compute tier. The company must use a canary deployment for any changes to the Lambda functions. Automated rollback must occur if any failures are reported.

The company’s DevOps team needs to create the infrastructure as code (laC) and the CIICD pipeline for this solution.

Which combination of steps will meet these requirements? (Select THREE.)

  • A. Create an AWS CloudFormation template for the application. Define each Lambda function in the template by using the AWS::Lambda :Function resource type. In the template: include a version for the Lambda function by using the resource type. Declare the CodeSha256 property Configure an resource that references the latest version of the Lambda function.
  • B. Create an AWS Serverless Application Model (AWS SAM) template for the application. Define each Lambda function in the template by using the resource type. For each function, include configurations for the AutoPublishAlias property and the DeploymentPreference property. Configure the deployment configuration type to LambdaCanary1 OPercent10Minutes.
  • C. Create an AWS CodeCommit repository. Create an AWS CodePipeline pipeline. use the CodeCommit repository in a new source stage that starts the pipeline. Create an AWS CodeBuild project to deploy the AWS Serverless Application Model (AWS SAM) template. Upload the template and source code to the CodeCommit repository. In the CodeCommit repository, create a buildspecyml file that includes the commands to build and deploy the SAM application.
  • D. Create an AWS CodeCommit repository. Create an AWS CodePipeline pipeline. use the CodeCommit repository in a new source stage that starts the pipeline. Create an AWS CodeDeploy deployment group that is configured for canary deployments with a DeploymentPreference type of CanarylOPercent1OMinutes. Upload the AWS CloudFormation template and source code to the CodeCommit repository. In the CodeCommit repository, create an appspecyml file that includes the commands to deploy the CloudFormation template.
  • E. Create an Amazon CloudWatch composite alarm for all the Lambda functions. Configure an evaluation period and dimensions for Lambda. Configure the alarm to enter the ALARM state if any errors are detected or if there is insufficient data.
  • F. Create an Amazon CloudWatch alarm for each Lambda function. Configure the alarms to enter the ALARM state if any errors are detected. Configure an evaluation period, dimensions for each Lambda function and version, and the namespace as AWS/Lambda on the Errors metric.
Click to View Verified Solution & Explanation

Correct Option: B,C,E

Explanation: ✅ Option B (Correct)
Reasoning: AWS SAM simplifies serverless IaC. The AWS::Serverless::Function resource with AutoPublishAlias and DeploymentPreference explicitly configures CodeDeploy for canary deployments, using LambdaCanary10Percent10Minutes to define the deployment strategy and trigger automated rollbacks if alarms activate.


✅ Option C (Correct)
Reasoning: This outlines a standard CI/CD pipeline. CodeCommit stores the source and SAM template. CodePipeline orchestrates the release process. CodeBuild, leveraging a buildspec.yml, builds and deploys the SAM application, enabling the canary deployment configured in the SAM template.


✅ Option E (Correct)
Reasoning: A CloudWatch composite alarm monitors the overall health of the Lambda functions. Configured to detect errors or insufficient data, it provides a consolidated signal. This alarm is crucial for CodeDeploy to automatically trigger a rollback of the canary deployment if application health deteriorates.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Standard AWS::Lambda::Function in CloudFormation requires manual integration with CodeDeploy for canary deployments; SAM streamlines this for serverless. CodeSha256 or versions alone don’t configure canary.
  • Option D is incorrect: While CodeDeploy can manage Lambda deployments, using a raw CloudFormation template with appspec.yml is less integrated and more complex for serverless canary deployments than the SAM framework.
  • Option F is incorrect: While individual alarms are useful, a composite alarm provides a consolidated view across multiple functions for triggering a single, unified rollback decision during a canary deployment for the entire application.

QUESTION 18

A company wants to use AWS development tools to replace its current bash deployment scripts. The company currently deploys a LAMP application to a group of Amazon EC2 instances behind an Application Load Balancer (ALB). During the deployments, the company unit tests the committed application, stops and starts services, unregisters and re-registers instances with the load balancer, and updates file permissions. The company wants to maintain the same deployment functionality through the shift to using AWS services.

Which solution will meet these requirements?

  • A. Use AWS CodeBuild to test the application. Use bash scripts invoked by AWS CodeDeploy's appspec.yml file to restart services, and deregister and register instances with the ALB. Use the appspec.yml file to update file permissions without a custom script.
  • B. Use AWS CodePipeline to move the application from the AWS CodeCommit repository to AWS CodeDeploy. Use CodeDeploy's deployment group to test the application, unregister and re-register instances with the ALB, and restart services. Use the appspec.yml file to update the permissions without a custom script.
  • C. Use AWS CodePipeline to move the application source code from the AWS CodeCommit repository to AWS CodeDeploy. Use CodeDeploy to test the application. Use CodeDeploy's appspec.yml file to restart services and update permissions without a custom script. Use AWS CodeBuild to unregister and re- register instances with the ALB.
  • D. Use AWS CodePipeline to trigger AWS CodeBuild to test the application. Use bash scripts invoked by AWS CodeDeploy's appspec.yml file to restart services. Unregister and re-register the instances in the AWS CodeDeploy deployment group with the ALB. Update the appspec.yml file to update file permissions without a custom script.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: CodePipeline orchestrates the workflow. CodeBuild effectively tests the application. CodeDeploy, with its appspec.yml bash scripts, handles service restarts. CodeDeploy’s deployment group natively manages ALB instance un/re-registration. The appspec.yml permissions section updates file permissions directly. This combination addresses all requirements efficiently.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While CodeBuild handles testing, CodeDeploy’s deployment group natively manages ALB registration/deregistration more robustly than custom appspec.yml bash scripts.
  • Option B is incorrect: CodeDeploy’s primary role is deployment, not testing the application. AWS CodeBuild is the appropriate service for unit testing.
  • Option C is incorrect: CodeDeploy is not for testing applications; CodeBuild is. Also, CodeBuild is for building/testing, not for unregistering/re-registering instances with an ALB, which is a deployment-specific task handled by CodeDeploy.

QUESTION 19

A production account has a requirement that any Amazon EC2 instance that has been logged into manually must be terminated within 24 hours. All applications in the production account are using Auto Scaling groups with Amazon CloudWatch Logs agent configured.

How can this process be automated?

  • A. Create a CloudWatch Logs subscription to an AWS Step Functions application. Configure the function to add a tag to the EC2 instance that produced the login event and mark the instance to be decommissioned. Then create a CloudWatch Events rule to trigger a second AWS Lambda function once a day that will terminate all instances with this tag.
  • B. Create a CloudWatch alarm that will trigger on the login event. Send the notification to an Amazon SNS topic that the Operations team is subscribed to, and have them terminate the EC2 instance within 24 hours.
  • C. Create a CloudWatch alarm that will trigger on the login event. Configure the alarm to send to an Amazon SQS queue. Use a group of worker instances to process messages from the queue, which then schedules the Amazon CloudWatch Events rule to trigger.
  • D. Create a CloudWatch Logs subscription in an AWS Lambda function. Configure the function to add a tag to the EC2 instance that produced the login event and mark the instance to be decommissioned. Create a CloudWatch Events rule to trigger a daily Lambda function that terminates all instances with this tag.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: CloudWatch Logs subscription filters detect login events, triggering a Lambda function to tag the EC2 instance. A daily CloudWatch EventBridge rule then invokes a second Lambda function. This function identifies and terminates all tagged instances, fully automating the process within the 24-hour requirement.

❌ Why the other choices are incorrect:

  • Option A is incorrect: CloudWatch Logs subscriptions don’t directly integrate with Step Functions; an intermediary like Lambda is needed, making this option less direct and slightly inaccurate.
  • Option B is incorrect: This solution relies on manual intervention by an operations team, failing to meet the core requirement for an automated process.
  • Option C is incorrect: Using an SQS queue with worker instances and dynamic scheduling for this task is overly complex and inefficient compared to a direct Lambda and scheduled EventBridge rule.

QUESTION 20

A company has containerized all of its in-house quality control applications. The company is running Jenkins on Amazon EC2, which requires patching and upgrading. The Compliance Officer has requested a DevOps Engineer begin encrypting build artifacts since they contain company intellectual property.

What should the DevOps Engineer do to accomplish this in the MOST maintainable manner?

  • A. Automate patching and upgrading using AWS Systems Manager on EC2 instances and encrypt Amazon EBS volumes by default.
  • B. Deploy Jenkins to an Amazon ECS cluster and copy build artifacts to an Amazon S3 bucket with default encryption enabled.
  • C. Leverage AWS CodePipeline with a build action and encrypt the artifacts using AWS Secrets Manager.
  • D. Use AWS CodeBuild with artifact encryption to replace the Jenkins instance running on Amazon EC2.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: AWS CodeBuild is a fully managed build service, eliminating the need for patching and upgrading a self-managed Jenkins instance. It natively supports artifact encryption using AWS KMS, directly fulfilling the compliance requirement in the most maintainable, serverless manner.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Automating patching with Systems Manager still requires managing an EC2 instance and Jenkins software. EBS encryption protects the disk, not specifically the build artifacts, which could be stored elsewhere.
  • Option B is incorrect: Deploying Jenkins to ECS still requires managing the Jenkins application itself, including upgrades. While S3 encryption helps, it doesn’t replace Jenkins or offer the same maintainability benefits as a fully managed build service.
  • Option C is incorrect: AWS CodePipeline orchestrates, but needs a build service (like CodeBuild or Jenkins). AWS Secrets Manager is for credentials, not for encrypting large build artifacts, which is a misuse of the service.

QUESTION 21

A company uses AWS KMS with CMKs and manual key rotation to meet regulatory compliance requirements. The security team wants to be notified when any keys have not been rotated after 90 days.

Which solution will accomplish this?

  • A. Configure AWS KMS to publish to an Amazon SNS topic when keys are more than 90 days old.
  • B. Configure an Amazon CloudWatch Events event to launch an AWS Lambda function to call the AWS Trusted Advisor API and publish to an Amazon SNS topic.
  • C. Develop an AWS Config custom rule that publishes to an Amazon SNS topic when keys are more than 90 days old.
  • D. Configure AWS Security Hub to publish to an Amazon SNS topic when keys are more than 90 days old.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: AWS Config custom rules, backed by a Lambda function, allow for precise evaluation of AWS resource configurations. A custom rule can query KMS CMK rotation details (e.g., DescribeKey to check KeyRotationEnabled and LastRotatedDate), compare the last rotation date against the 90-day threshold, and then mark the key non-compliant, triggering an SNS notification. This directly addresses the specific, custom compliance requirement for manual key rotation.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS KMS primarily monitors automatic key rotation (yearly) and doesn’t offer a native feature to monitor manual rotation intervals or publish events for keys exceeding a custom manual rotation period like 90 days.
  • Option B is incorrect: AWS Trusted Advisor’s KMS Key Rotation check specifically flags keys without automatic rotation enabled. It does not track the last manual rotation date or custom rotation intervals, making it unsuitable for this requirement.
  • Option D is incorrect: AWS Security Hub aggregates findings but doesn’t generate the initial finding for a custom 90-day manual KMS key rotation check out-of-the-box. It would consume findings from services like Config, but isn’t the mechanism to create this specific compliance check.

QUESTION 22

A company has migrated its container-based applications to Amazon EKS and wants to establish automated email notifications. The notifications sent to each email address are for specific activities related to EKS components. The solution will include Amazon SNS topics and an AWS Lambda function to evaluate incoming log events and publish messages to the correct SNS topic.

Which logging solution will support these requirements?

  • A. Enable Amazon CloudWatch Logs to log the EKS components. Create a CloudWatch subscription filter for each component with Lambda as the subscription feed destination.
  • B. Enable Amazon CloudWatch Logs to log the EKS components. Create CloudWatch Logs Insights queries linked to Amazon CloudWatch Events that trigger Lambda.
  • C. Enable Amazon S3 logging for the EKS components. Configure an Amazon CloudWatch subscription filter for each component with Lambda as the subscription feed destination.
  • D. Enable Amazon S3 logging for the EKS components. Configure S3 PUT Object event notifications with AWS Lambda as the destination.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: EKS control plane logs natively integrate with Amazon CloudWatch Logs. CloudWatch Logs subscription filters provide real-time streaming of log events to AWS Lambda. Lambda can then evaluate these events and publish targeted messages to specific Amazon SNS topics for automated email notifications.

❌ Why the other choices are incorrect:

  • Option B is incorrect: CloudWatch Logs Insights is primarily for interactive log analysis and querying, not for real-time streaming and automated processing of incoming log events to trigger Lambda via CloudWatch Events. This approach introduces unnecessary latency and complexity.
  • Option C is incorrect: EKS control plane logs are sent to Amazon CloudWatch Logs, not directly to Amazon S3. Therefore, enabling S3 logging for EKS components is fundamentally incorrect. CloudWatch subscription filters operate on CloudWatch Logs.
  • Option D is incorrect: EKS control plane logs are published to Amazon CloudWatch Logs, not S3. This option incorrectly assumes S3 as the EKS logging destination. Consequently, S3 PUT Object event notifications cannot be used to process EKS component logs.

QUESTION 23

A company hosts its staging website using an Amazon EC2 instance backed with Amazon EBS storage. The company wants to recover quickly with minimal data losses in the event of network connectivity issues or power failures on the EC2 instance.

Which solution will meet these requirements?

  • A. Add the instance to an EC2 Auto Scaling group with the minimum, maximum, and desired capacity set to 1.
  • B. Add the instance to an EC2 Auto Scaling group with a lifecycle hook to detach the EBS volume when the EC2 instance shuts down or terminates.
  • C. Create an Amazon CloudWatch alarm for the StatusCheckFailed_System metric and select the EC2 action to recover the instance.
  • D. Create an Amazon CloudWatch alarm for the StatusCheckFailed_Instance metric and select the EC2 action to reboot the instance.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: The StatusCheckFailed_System metric monitors underlying AWS infrastructure (network, power, hardware). The "recover instance" action migrates the instance to new healthy hardware, preserving its private IP, Elastic IP, and instance metadata, along with attached EBS volumes. This ensures quick recovery with minimal data loss for system-level failures.

❌ Why the other choices are incorrect:

  • Option A is incorrect: An Auto Scaling Group (ASG) would terminate the original instance and launch a new one, not recover the existing one. This means a new private IP and potential configuration loss, which doesn’t align with "minimal data loss" or preserving the existing instance state.
  • Option B is incorrect: While detaching EBS preserves data, an ASG still terminates the instance and launches a new one. This is replacement, not recovery, and involves more manual steps (reattaching volume) than instance recovery.
  • Option D is incorrect: StatusCheckFailed_Instance monitors issues within the instance’s OS. Network connectivity or power failures are system-level issues, not instance-level. A simple reboot won’t resolve underlying infrastructure problems.

QUESTION 24

A company runs an application on one Amazon EC2 instance. Application metadata is stored in Amazon S3 and must be retrieved if the instance is restarted. The instance must restart or relaunch automatically if the instance becomes unresponsive.

Which solution will meet these requirements?

  • A. Create an Amazon CloudWatch alarm for the StatusCheckFailed metric. Use the recover action to stop and start the instance. Use an S3 event notification to push the metadata to the instance when the instance is back up and running.
  • B. Configure AWS OpsWorks, and use the auto healing feature to stop and start the instance. Use a lifecycle event in OpsWorks to pull the metadata from Amazon S3 and update it on the instance.
  • C. Use EC2 Auto Recovery to automatically stop and start the instance in case of a failure. Use an S3 event notification to push the metadata to the instance when the instance is back up and running.
  • D. Use AWS CloudFormation to create an EC2 instance that includes the UserData property for the EC2 resource. Add a command in UserData to retrieve the application metadata from Amazon S3.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: AWS OpsWorks auto-healing detects unresponsive instances and automatically stops/starts them. OpsWorks lifecycle events (e.g., Setup or Deploy) can trigger custom scripts to pull metadata from S3 every time the instance starts or is deployed, satisfying both requirements.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While CloudWatch can restart an instance on system check failure, S3 event notifications push data from S3, not to an EC2 instance upon its restart. EC2 instances typically pull data.
  • Option C is incorrect: EC2 Auto Recovery only addresses underlying hardware failures, not application unresponsiveness. S3 event notifications are also not suitable for pushing data to a restarting EC2 instance.
  • Option D is incorrect: UserData runs only once when an EC2 instance is first launched. It does not re-run on subsequent restarts or stops/starts. CloudFormation alone also lacks an auto-healing mechanism for unresponsive applications.

QUESTION 25

A company’s developers use Amazon EC2 instances as remote workstations. The company is concerned that users can create or modify EC2 security groups to allow unrestricted inbound access.

A DevOps engineer needs to develop a solution to detect when users create unrestricted security group rules. The solution must detect changes to security group rules in near real time, remove unrestricted rules, and send email notifications to the security team. The DevOps engineer has created an AWS Lambda function that checks for security group ID from input, removes rules that grant unrestricted access, and sends notifications through Amazon Simple Notification Service (Amazon SNS).

What should the DevOps engineer do next to meet the requirements?

  • A. Configure the Lambda function to be invoked by the SNS topic. Create an AWS CloudTrail subscription for the SNS topic. Configure a subscription filter for security group modification events.
  • B. Create an Amazon EventBridge scheduled rule to invoke the Lambda function. Define a schedule pattern that runs the Lambda function every hour.
  • C. Create an Amazon EventBridge event rule that has the default event bus as the source. Define the rule’s event pattern to match EC2 security group creation and modification events. Configure the rule to invoke the Lambda function.
  • D. Create an Amazon EventBridge custom event bus that subscribes to events from all AWS services. Configure the Lambda function to be invoked by the custom event bus.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: EventBridge with an event rule on the default bus precisely captures EC2 security group creation/modification events in near real-time. The rule can then directly invoke the Lambda function, passing the relevant security group details from the event payload. This design aligns perfectly with the requirements.

❌ Why the other choices are incorrect:

  • Option A is incorrect: CloudTrail via SNS is less direct for real-time event processing to Lambda than EventBridge. CloudTrail primarily logs to S3/CloudWatch; using SNS to trigger Lambda from management events is not the most common or efficient real-time pattern.
  • Option B is incorrect: A scheduled rule does not meet the "near real-time" requirement, as it only checks periodically (hourly). It also wouldn’t inherently provide the specific security group ID to the Lambda function.
  • Option D is incorrect: AWS service events, like EC2 security group changes, flow into the default EventBridge event bus. A custom event bus is typically for application-specific events, not for routing native AWS service events.

QUESTION 26

To run an application, a DevOps Engineer launches an Amazon EC2 instances with public IP addresses in a public subnet. A user data script obtains the application artifacts and installs them on the instances upon launch. A change to the security classification of the application now requires the instances to run with no access to the Internet. While the instances launch successfully and show as healthy, the application does not seem to be installed.

Which of the following should successfully install the application while complying with the new rule?

  • A. Launch the instances in a public subnet with Elastic IP addresses attached. Once the application is installed and running, run a script to disassociate the Elastic IP addresses afterwards.
  • B. Set up a NAT gateway. Deploy the EC2 instances to a private subnet. Update the private subnet's route table to use the NAT gateway as the default route.
  • C. Publish the application artifacts to an Amazon S3 bucket and create a VPC endpoint for S3. Assign an IAM instance profile to the EC2 instances so they can read the application artifacts from the S3 bucket.
  • D. Create a security group for the application instances and whitelist only outbound traffic to the artifact repository. Remove the security group rule once the install is complete.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Publishing artifacts to S3 and creating a VPC endpoint for S3 allows private, direct access to S3 from EC2 instances within the VPC, bypassing the public internet. An IAM instance profile grants necessary S3 read permissions, ensuring artifacts can be downloaded without internet access.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Attaching Elastic IPs to instances in a public subnet grants internet access during installation, violating the "no access to the Internet" requirement from the start. Disassociating EIPs afterwards doesn’t change the initial breach.
  • Option B is incorrect: A NAT gateway explicitly provides outbound internet access for instances in private subnets, which directly contradicts the requirement for "no access to the Internet" for the application instances.
  • Option D is incorrect: Security groups control traffic flow but do not provide a network path. If the artifact repository is on the internet, allowing outbound traffic via a security group still means using the internet, violating the core rule.

QUESTION 27

An IT team has built an AWS CloudFormation template so others in the company can quickly and reliably deploy and terminate an application. The template creates an Amazon EC2 instance with a user data script to install the application and an Amazon S3 bucket that the application uses to serve static webpages while it is running.

All resources should be removed when the CloudFormation stack is deleted. However, the team observes that CloudFormation reports an error during stack deletion, and the S3 bucket created by the stack is not deleted. How can the team resolve the error in the MOST efficient manner to ensure that all resources are deleted without errors?

  • A. Add DeletionPolicy attribute to the S3 bucket resource, with the value Delete forcing the bucket to be removed when the stack is deleted.
  • B. Add a custom resource when an AWS Lambda function with the DependsOn attribute specifying the S3 bucket, and an IAM role. Write the Lambda function to delete all objects from the bucket when the RequestType is Delete.
  • C. Identify the resource that was not deleted. From the S3 console, empty the S3 bucket and then delete it.
  • D. Replace the EC2 and S3 bucket resources with a single AWS OpsWorks Stacks resource. Define a custom recipe for the stack to create and delete the EC2 instance and the S3 bucket.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: This is the most efficient programmatic solution. A Lambda-backed custom resource can empty the S3 bucket during stack deletion. Using DependsOn ensures the Lambda function executes to delete bucket objects before CloudFormation attempts to delete the now-empty S3 bucket, resolving the error.

❌ Why the other choices are incorrect:

  • Option A is incorrect: DeletionPolicy: Delete is the default behavior and doesn’t override S3’s requirement for buckets to be empty before deletion. CloudFormation will still report an error if the bucket contains objects.
  • Option C is incorrect: This is a manual workaround, not an automated or efficient resolution for the CloudFormation template. It requires human intervention for every stack deletion and doesn’t prevent future errors.
  • Option D is incorrect: Replacing CloudFormation with AWS OpsWorks is an overly complex and inefficient solution for this specific problem. It introduces a completely different management system rather than addressing the S3 deletion issue within the existing template.

QUESTION 28

A company is using AWS CodePipeline to automate its release pipeline. AWS CodeDeploy is being used in the pipeline to deploy an application to Amazon ECS using the blue/green deployment model. The company wants to implement scripts to test the green version of the application before shifting traffic. These scripts will complete in 5 minutes or less. If errors are discovered during these tests, the application must be rolled back.

Which strategy will meet these requirements?

  • A. Add a stage to the CodePipeline pipeline between the source and deploy stages. Use AWS CodeBuild to create an execution environment and build commands in the buildspec file to invoke test scripts. If errors are found, use the aws deploy stop-deployment command to stop the deployment.
  • B. Add a stage to the CodePipeline pipeline between the source and deploy stages. Use this stage to execute an AWS Lambda function that will run the test scripts. If errors are found, use the aws deploy stop- deployment command to stop the deployment.
  • C. Add a hooks section to the CodeDeploy AppSpec file. Use the AfterAllowTestTraffic lifecycle event to invoke an AWS Lambda function to run the test scripts. If errors are found, exit the Lambda function with an error to trigger rollback.
  • D. Add a hooks section to the CodeDeploy AppSpec file. Use the AfterAllowTraffic lifecycle event to invoke the test scripts. If errors are found, use the aws deploy stop-deployment CLI command to stop the deployment.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: The AfterAllowTestTraffic CodeDeploy hook is precisely designed for testing the new (green) version with test traffic before shifting production traffic. Invoking a Lambda function for testing is efficient and suitable for short-running scripts (under 5 minutes). Exiting Lambda with an error automatically triggers a CodeDeploy rollback, fulfilling the requirement.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Adding a CodeBuild stage between source and deploy stages doesn’t align with CodeDeploy’s blue/green lifecycle. It runs before CodeDeploy deploys the green version and shifts test traffic. aws deploy stop-deployment is not the native rollback mechanism for hook failures.
  • Option B is incorrect: Similar to A, an AWS Lambda function in a CodePipeline stage runs before CodeDeploy’s blue/green test traffic shift. It cannot test the deployed green version with test traffic before the final traffic shift. aws deploy stop-deployment is not the native rollback mechanism for hook failures.
  • Option D is incorrect: The AfterAllowTraffic hook runs after all production traffic has been shifted to the new version. This means testing would occur after the cutover, potentially impacting users, not before as required for pre-shift testing and rollback.

QUESTION 29

A DevOps engineer needs to configure a blue/green deployment for an existing three-tier application. The application runs on Amazon EC2 instances and uses an Amazon RDS database. The EC2 instances run behind an Application Load Balancer (ALB) and are in an Auto Scaling group.

The DevOps engineer has created a launch template and an Auto Scaling group for the blue environment. The DevOps engineer also has created a launch template and an Auto Scaling group for the green environment. Each Auto Scaling group deploys to a matching blue or green target group. The target group also specifies which software, blue or green, gets loaded on the EC2 instances. The ALB can be configured to send traffic to the blue environment’s target group or the green environment’s target group. An Amazon Route 53 record for www.example.com points to the ALB.

The deployment must move traffic all at once between the software on the blue environment’s EC2 instances to the newly deployed software on the green environments EC2 instances.

What should the DevOps engineer do to meet these requirements?

  • A. Start a rolling restart of the Auto Scaling group for the green environment to deploy the new software on the green environment's EC2 instances. When the rolling restart is complete, use an AWS CLI command to update the ALB to send traffic to the green environment's target group.
  • B. Use an AWS CLI command to update the ALB to send traffic to the green environments target group. Then start a rolling restart of the Auto Scaling group for the green environment to deploy the new software on the green environment's EC2 instances.
  • C. Update the launch template to deploy the green environments software on the blue environment's EC2 instances. Keep the target groups and Auto Scaling groups unchanged in both environments. Perform a rolling restart of the blue environment's EC2 instances.
  • D. Start a rolling restart of the Auto Scaling group for the green environment to deploy the new software on the green environment's EC2 instances. When the rolling restart is complete, update the Route 53 DNS to point to the green environment's endpoint on the ALB.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: This approach correctly deploys new software to the inactive green environment first via a rolling restart of its Auto Scaling group. Once the green environment is healthy, the ALB is updated to redirect all traffic to the green target group, achieving an "all at once" cut-over without affecting the live blue environment until the switch.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Switching ALB traffic to the green environment before deploying and verifying the new software would result in serving outdated software or causing downtime during deployment.
  • Option C is incorrect: This describes an in-place rolling update on the active blue environment, not a blue/green deployment. It would disrupt live traffic while the new software is deployed.
  • Option D is incorrect: Route 53 points to the ALB, which is a static endpoint for this pattern. Traffic is shifted by updating ALB listener rules between target groups (blue vs. green), not by changing the Route 53 record to a "green environment’s endpoint on the ALB."

QUESTION 30

A company has multiple accounts in an organization in AWS Organizations. The company’s SecOps team needs to receive an Amazon Simple Notification Service (Amazon SNS) notification if any account in the organization turns off the Block Public Access feature on an Amazon S3 bucket. A DevOps engineer must implement this change without affecting the operation of any AWS accounts. The implementation must ensure that individual member accounts in the organization cannot turn off the notification.

Which solution will meet these requirements?

  • A. Designate an account to be the delegated Amazon GuardDuty administrator account. Turn on GuardDuty for all accounts across the organization. In the GuardDuty administrator account, create an SNS topic. Subscribe the SecOps team's email address to the SNS topic. In the same account, create an Amazon EventBridge rule that uses an event pattern for GuardDuty findings and a target of the SNS topic.
  • B. Create an AWS CloudFormation template that creates an SNS topic and subscribes the SecOps team’s email address to the SNS topic. In the template, include an Amazon EventBridge rule that uses an event pattern of CloudTrail activity for s3:PutBucketPublicAccessBlock and a target of the SNS topic. Deploy the stack to every account in the organization by using CloudFormation StackSets.
  • C. Turn on AWS Config across the organization. In the delegated administrator account, create an SNS topic. Subscribe the SecOps team's email address to the SNS topic. Deploy a conformance pack that uses the s3-bucket-level-public-access-prohibited AWS Config managed rule in each account and uses an AWS Systems Manager document to publish an event to the SNS topic to notify the SecOps team.
  • D. Turn on Amazon Inspector across the organization. In the Amazon Inspector delegated administrator account, create an SNS topic. Subscribe the SecOps team’s email address to the SNS topic. In the same account, create an Amazon EventBridge rule that uses an event pattern for public network exposure of the S3 bucket and publishes an event to the SNS topic to notify the SecOps team.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: Designating a GuardDuty delegated administrator and enabling GuardDuty across the organization centralizes security monitoring. GuardDuty detects events like S3/Policy:BlockPublicAccessDisabled. An EventBridge rule in the delegated admin account triggers an SNS notification on these GuardDuty findings, ensuring member accounts cannot disable this critical security control or its notification.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Deploying CloudFormation StackSets with resources like SNS topics and EventBridge rules into every member account means member account administrators could modify or delete these resources within their own account, effectively disabling the notification. This violates the requirement that member accounts cannot turn off notifications.
  • Option C is incorrect: While AWS Config can detect public access, the solution proposes using a Systems Manager document in each account to publish to SNS. This distributed notification mechanism could be tampered with or disabled by individual member account administrators, compromising the central control requirement.
  • Option D is incorrect: Amazon Inspector is primarily designed for identifying software vulnerabilities and network exposure on compute instances (EC2, containers, Lambda) and ECR images. It is not the appropriate service for monitoring the status or changes of the Amazon S3 Block Public Access feature.

QUESTION 31

A company has a mobile application that makes HTTP API calls to an Application Load Balancer (ALB). The ALB routes requests to an AWS Lambda function. Many different versions of the application are in use at any given time, including versions that are in testing by a subset of users. The version of the application is defined in the user-agent header that is sent with all requests to the API.

After a series of recent changes to the API, the company has observed issues with the application. The company needs to gather a metric for each API operation by response code for each version of the application that is in use. A DevOps engineer has modified the Lambda function to extract the API operation name, version information from the user-agent header and response code.

Which additional set of actions should the DevOps engineer take to gather the required metrics?

  • A. Modify the Lambda function to write the API operation name, response code, and version number as a log line to an Amazon CloudWatch Logs log group. Configure a CloudWatch Logs metric filter that increments a metric for each API operation name. Specify response code and application version as dimensions for the metric.
  • B. Modify the Lambda function to write the API operation name, response code, and version number as a log line to an Amazon CloudWatch Logs log group. Configure a CloudWatch Logs Insights query to populate CloudWatch metrics from the log lines. Specify response code and application version as dimensions for the metric.
  • C. Configure the ALB access logs to write to an Amazon CloudWatch Logs log group. Modify the Lambda function to respond to the ALB with the API operation name, response code, and version number as response metadata. Configure a CloudWatch Logs metric filter that increments a metric for each API operation name. Specify response code and application version as dimensions for the metric.
  • D. Configure AWS X-Ray integration on the Lambda function. Modify the Lambda function to create an X-Ray subsegment with the API operation name, response code, and version number. Configure X-Ray insights to extract an aggregated metric for each API operation name and to publish the metric to Amazon CloudWatch. Specify response code and application version as dimensions for the metric.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: Modifying the Lambda to log the required data to CloudWatch Logs, then using a CloudWatch Logs metric filter, is the most direct and efficient method. Metric filters can extract values (API operation name, response code, version) from log lines and publish custom CloudWatch metrics with up to 10 dimensions, precisely meeting the problem’s requirements.

❌ Why the other choices are incorrect:

  • Option B is incorrect: CloudWatch Logs Insights is for interactive log analysis and querying, not for continuously populating persistent CloudWatch metrics directly. Metric filters are designed for this purpose.
  • Option C is incorrect: ALB access logs do not contain the "API operation name" which is determined inside the Lambda function, nor would custom Lambda response metadata be directly used by ALB access log filters to generate the required granular metrics.
  • Option D is incorrect: While X-Ray can collect custom annotations, X-Ray Insights focuses on anomaly detection within traces. It’s not primarily designed for continuously extracting detailed custom metrics with multiple dimensions and publishing them to CloudWatch in the manner requested, making it overly complex compared to metric filters.

QUESTION 32

A company provides an application to customers. The application has an Amazon API Gateway REST API that invokes an AWS Lambda function. On initialization, the Lambda function loads a large amount of data from an Amazon DynamoDB table. The data load process results in long cold-start times of 8-10 seconds. The DynamoDB table has DynamoDB Accelerator (DAX) configured.

Customers report that the application intermittently takes a long time to respond to requests. The application receives thousands of requests throughout the day. In the middle of the day, the application experiences 10 times more requests than at any other time of the day. Near the end of the day, the application’s request volume decreases to 10% of its normal total.

A DevOps engineer needs to reduce the latency of the Lambda function at all times of the day.

Which solution will meet these requirements?

  • A. Configure provisioned concurrency on the Lambda function with a concurrency value of 1. Delete the DAX cluster for the DynamoDB table.
  • B. Configure reserved concurrency on the Lambda function with a concurrency value of 0.
  • C. Configure provisioned concurrency on the Lambda function. Configure AWS Application Auto Scaling on the Lambda function with provisioned concurrency values set to a minimum of 1 and a maximum of 100.
  • D. Configure reserved concurrency on the Lambda function. Configure AWS Application Auto Scaling on the API Gateway API with a reserved concurrency maximum value of 100.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Configuring provisioned concurrency keeps Lambda functions initialized and warm, eliminating cold starts. AWS Application Auto Scaling dynamically adjusts the provisioned concurrency pool (min 1 to max 100) to match traffic demand, ensuring low latency during all traffic patterns (low, normal, and high spikes) efficiently.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Provisioned concurrency of 1 will only prevent cold starts for a single concurrent request; subsequent concurrent requests during spikes will still incur cold starts. Deleting DAX is detrimental as it would increase DynamoDB read latency, worsening performance.
  • Option B is incorrect: Reserved concurrency of 0 means the Lambda function cannot execute any requests, effectively shutting down the application. This does not reduce latency; it prevents function execution.
  • Option D is incorrect: Reserved concurrency limits total invocations but does not eliminate cold starts. Furthermore, "reserved concurrency" on API Gateway with Application Auto Scaling is a misapplication of terms and does not directly manage Lambda’s provisioned concurrency to resolve cold start issues.

QUESTION 33

A company is adopting AWS CodeDeploy to automate its application deployments for a Java-Apache Tomcat application with an Apache Webserver. The development team started with a proof of concept, created a deployment group for a developer environment, and performed functional tests within the application. After completion, the team will create additional deployment groups for staging and production.

The current log level is configured within the Apache settings, but the team wants to change this configuration dynamically when the deployment occurs, so that they can set different log level configurations depending on the deployment group without having a different application revision for each group.

How can these requirements be met with the LEAST management overhead and without requiring different script versions for each deployment group?

  • A. Tag the Amazon EC2 instances depending on the deployment group. Then place a script into the application revision that calls the metadata service and the EC2 API to identify which deployment group the instance is part of. Use this information to configure the log level settings. Reference the script as part of the AfterInstall lifecycle hook in the appspec.yml file.
  • B. Create a script that uses the CodeDeploy environment variable DEPLOYMENT_GROUP_ NAME to identify which deployment group the instance is part of. Use this information to configure the log level settings. Reference this script as part of the BeforeInstall lifecycle hook in the appspec.yml file.
  • C. Create a CodeDeploy custom environment variable for each environment. Then place a script into the application revision that checks this environment variable to identify which deployment group the instance is part of. Use this information to configure the log level settings. Reference this script as part of the ValidateService lifecycle hook in the appspec.yml file.
  • D. Create a script that uses the CodeDeploy environment variable DEPLOYMENT_GROUP_ID to identify which deployment group the instance is part of to configure the log level settings. Reference this script as part of the Install lifecycle hook in the appspec.yml file.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: CodeDeploy injects DEPLOYMENT_GROUP_NAME as an environment variable, allowing a single script to dynamically identify the target environment (dev, staging, prod). Using this variable to set log levels, referenced in the BeforeInstall hook, provides the least management overhead and avoids multiple script versions, meeting all requirements.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Tagging EC2 instances and calling EC2 API increases management overhead and script complexity due to API calls and IAM permissions, violating the "least management overhead" requirement.
  • Option C is incorrect: Creating custom CodeDeploy environment variables for each group adds management overhead compared to using built-in variables. The ValidateService hook runs after deployment, possibly too late for initial log level configuration.
  • Option D is incorrect: While DEPLOYMENT_GROUP_ID is available, DEPLOYMENT_GROUP_NAME is more human-readable for conditional logic. The Install hook primarily copies files; BeforeInstall is more suitable for pre-installation configuration adjustments.

QUESTION 34

A company requires its developers to tag all Amazon Elastic Block Store (Amazon EBS) volumes in an account to indicate a desired backup frequency. This requirement Includes EBS volumes that do not require backups. The company uses custom tags named Backup_Frequency that have values of none, daily, or weekly that correspond to the desired backup frequency. An audit finds that developers are occasionally not tagging the EBS volumes.

A DevOps engineer needs to ensure that all EBS volumes always have the Backup_Frequency tag so that the company can perform backups at least weekly unless a different value is specified.

Which solution will meet these requirements?

  • A. Set up AWS Config in the account. Create a custom rule that returns a compliance failure for all Amazon EC2 resources that do not have a Backup Frequency tag applied. Configure a remediation action that uses a custom AWS Systems Manager Automation runbook to apply the Backup_Frequency tag with a value of weekly.
  • B. Set up AWS Config in the account. Use a managed rule that returns a compliance failure for EC2::Volume resources that do not have a Backup Frequency tag applied. Configure a remediation action that uses a custom AWS Systems Manager Automation runbook to apply the Backup_Frequency tag with a value of weekly.
  • C. Turn on AWS CloudTrail in the account. Create an Amazon EventBridge rule that reacts to EBS CreateVolume events. Configure a custom AWS Systems Manager Automation runbook to apply the Backup_Frequency tag with a value of weekly. Specify the runbook as the target of the rule.
  • D. Turn on AWS CloudTrail in the account. Create an Amazon EventBridge rule that reacts to EBS CreateVolume events or EBS ModifyVolume events. Configure a custom AWS Systems Manager Automation runbook to apply the Backup_Frequency tag with a value of weekly. Specify the runbook as the target of the rule.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: AWS Config with a managed rule for EC2::Volume continuously monitors compliance, identifying untagged EBS volumes. A custom AWS Systems Manager Automation runbook configured as a remediation action will automatically apply the Backup_Frequency tag with a value of weekly, ensuring all volumes are tagged as required.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Using a custom Config rule for "all EC2 resources" is less precise than a managed rule specifically for EC2::Volume. While it could work, a managed rule is simpler and often preferred when available for specific resource types.
  • Options C and D are incorrect: CloudTrail/EventBridge are event-driven, reacting only to CreateVolume or ModifyVolume events. They won’t continuously monitor for compliance across all existing volumes or detect if tags are removed later. AWS Config provides the necessary continuous audit and remediation for all volumes, regardless of creation/modification events.

QUESTION 35

A company is using an Amazon Aurora cluster as the data store for its application. The Aurora cluster is configured with a single DB instance. The application performs read and write operations on the database by using the cluster’s instance endpoint.

The company has scheduled an update to be applied to the cluster during an upcoming maintenance window. The cluster must remain available with the least possible interruption during the maintenance window.

What should a DevOps engineer do to meet these requirements?

  • A. Add a reader instance to the Aurora cluster. Update the application to use the Aurora cluster endpoint for write operations. Update the Aurora cluster's reader endpoint for reads.
  • B. Add a reader instance to the Aurora cluster. Create a custom ANY endpoint for the cluster. Update the application to use the Aurora cluster's custom ANY endpoint for read and write operations.
  • C. Turn on the Multi-AZ option on the Aurora cluster. Update the application to use the Aurora cluster endpoint for write operations. Update the Aurora cluster’s reader endpoint for reads.
  • D. Turn on the Multi-AZ option on the Aurora cluster. Create a custom ANY endpoint for the cluster. Update the application to use the Aurora cluster's custom ANY endpoint for read and write operations.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅
Option B: Add a reader instance to the Aurora cluster. Create a custom ANY endpoint for the cluster. Update the application to use the Aurora cluster’s custom ANY endpoint for read and write operations.


Reasoning: Adding a reader instance allows for failover. A custom ANY endpoint intelligently routes both read and write traffic to any available instance. During primary instance maintenance, a reader is promoted, and the ANY endpoint ensures continuous operation with minimal application interruption.

QUESTION 36 (Multi-Select)

A company must encrypt all AMIs that the company shares across accounts. A DevOps engineer has access to a source account where an unencrypted custom AMI has been built. The DevOps engineer also has access to a target account where an Amazon EC2 Auto Scaling group will launch EC2 instances from the AMI. The DevOps engineer must share the AMI with the target account.

The company has created an AWS Key Management Service (AWS KMS) key in the source account.

Which additional steps should the DevOps engineer perform to meet the requirements? (Choose three.)

  • A. In the source account, copy the unencrypted AMI to an encrypted AMI. Specify the KMS key in the copy action.
  • B. In the source account, copy the unencrypted AMI to an encrypted AMI. Specify the default Amazon Elastic Block Store (Amazon EBS) encryption key in the copy action.
  • C. In the source account, create a KMS grant that delegates permissions to the Auto Scaling group service-linked role in the target account.
  • D. In the source account, modify the key policy to give the target account permissions to create a grant. In the target account, create a KMS grant that delegates permissions to the Auto Scaling group service-linked role.
  • E. In the source account, share the unencrypted AMI with the target account.
  • F. In the source account, share the encrypted AMI with the target account.
Click to View Verified Solution & Explanation

Correct Option: A,D,F

Explanation: ✅ Option A (Correct)
Reasoning: The initial AMI is unencrypted, but the requirement is to encrypt all shared AMIs. Copying the unencrypted AMI to an encrypted version using the specified KMS key in the source account is the necessary first step to meet the encryption mandate.


✅ Option D (Correct)
Reasoning: For cross-account KMS key usage, the source key policy must permit the target account to create grants. This allows the target account to then create a grant for its Auto Scaling group service-linked role, enabling instance launch while maintaining proper access control.


✅ Option F (Correct)
Reasoning: After the AMI is encrypted (as per step A), it must be explicitly shared with the target account to make it available for use by the Auto Scaling group. Sharing the encrypted AMI is crucial to satisfy the security requirement.

❌ Why the other choices are incorrect:

  • Option B is incorrect: The problem states the company created and will use "an AWS Key Management Service (AWS KMS) key in the source account," not the default Amazon EBS encryption key.
  • Option C is incorrect: Creating a KMS grant for a service-linked role in another account directly from the source account is not the standard or secure cross-account KMS sharing mechanism. It typically requires an intermediary step via the key policy.
  • Option E is incorrect: This violates the core requirement to "encrypt all AMIs that the company shares across accounts." The AMI must be encrypted before sharing.

QUESTION 37 (Multi-Select)

A company uses AWS CodePipeline pipelines to automate releases of its application. A typical pipeline consists of three stages build, test, and deployment. The company has been using a separate AWS CodeBuild project to run scripts for each stage. However, the company now wants to use AWS CodeDeploy to handle the deployment stage of the pipelines.

The company has packaged the application as an RPM package and must deploy the application to a fleet of Amazon EC2 instances. The EC2 instances are in an EC2 Auto Scaling group and are launched from a common AMI.

Which combination of steps should a DevOps engineer perform to meet these requirements? (Choose two.)

  • A. Create a new version of the common AMI with the CodeDeploy agent installed. Update the IAM role of the EC2 instances to allow access to CodeDeploy.
  • B. Create a new version of the common AMI with the CodeDeploy agent installed. Create an AppSpec file that contains application deployment scripts and grants access to CodeDeploy.
  • C. Create an application in CodeDeploy. Configure an in-place deployment type. Specify the Auto Scaling group as the deployment target. Add a step to the CodePipeline pipeline to use EC2 Image Builder to create a new AMI. Configure CodeDeploy to deploy the newly created AMI.
  • D. Create an application in CodeDeploy. Configure an in-place deployment type. Specify the Auto Scaling group as the deployment target. Update the CodePipeline pipeline to use the CodeDeploy action to deploy the application.
  • E. Create an application in CodeDeploy. Configure an in-place deployment type. Specify the EC2 instances that are launched from the common AMI as the deployment target. Update the CodePipeline pipeline to use the CodeDeploy action to deploy the application.
Click to View Verified Solution & Explanation

Correct Option: A,D

Explanation: ✅ Option A (Correct)
Reasoning: The CodeDeploy agent must be installed on target EC2 instances for deployments to occur; baking it into the common AMI ensures all ASG instances have it. The EC2 instance IAM role requires permissions to interact with CodeDeploy and retrieve application revisions (e.g., from S3). These are foundational prerequisites.


✅ Option D (Correct)
Reasoning: A CodeDeploy application is the top-level container. "In-place" deployment is appropriate for updating an RPM package on existing EC2 instances. Specifying the Auto Scaling Group as the target robustly manages deployments across the fleet. The CodePipeline must be updated to use the CodeDeploy action.

❌ Why the other choices are incorrect:

  • Option B is incorrect: While the CodeDeploy agent and AppSpec file are needed, the AppSpec file defines deployment hooks and file locations, it does not "grant access to CodeDeploy"; that’s handled by IAM roles.
  • Option C is incorrect: This describes deploying new AMIs, often for immutable infrastructure or blue/green, not deploying an RPM package "in-place" to existing instances using CodeDeploy. CodeDeploy’s "in-place" type updates the application on existing servers.
  • Option E is incorrect: Targeting individual EC2 instances is less robust than targeting the Auto Scaling group. CodeDeploy’s integration with ASGs ensures that all instances in the group, including newly launched ones, are correctly managed within the deployment.

QUESTION 38 (Multi-Select)

A company’s security team requires that all external Application Load Balancers (ALBs) and Amazon API Gateway APIs are associated with AWS WAF web ACLs. The company has hundreds of AWS accounts, all of which are included in a single organization in AWS Organizations. The company has configured AWS Config for the organization. During an audit, the company finds some externally facing ALBs that are not associated with AWS WAF web ACLs.

Which combination of steps should a DevOps engineer take to prevent future violations? (Choose two.)

  • A. Delegate AWS Firewall Manager to a security account.
  • B. Delegate Amazon GuardDuty to a security account.
  • C. Create an AWS Firewall Manager policy to attach AWS WAF web ACLs to any newly created ALBs and API Gateway APIs.
  • D. Create an Amazon GuardDuty policy to attach AWS WAF web ACLs to any newly created ALBs and API Gateway APIs.
  • E. Configure an AWS Config managed rule to attach AWS WAF web ACLs to any newly created ALBs and API Gateway APIs.
Click to View Verified Solution & Explanation

Correct Option: A,C

Explanation: ✅ Option A (Correct)
Reasoning: Delegating AWS Firewall Manager to a security account establishes a centralized administration point. This is crucial for managing WAF policies across "hundreds of AWS accounts" within an organization, enabling consistent security enforcement without requiring access to individual member accounts.


✅ Option C (Correct)
Reasoning: An AWS Firewall Manager policy can automatically deploy and attach AWS WAF web ACLs to resources like ALBs and API Gateway APIs across all accounts in an organization. This prevents "future violations" by ensuring newly created resources are compliant from inception, and can also remediate existing non-compliant resources.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Amazon GuardDuty is a threat detection service. Delegating it to a security account is good practice but does not prevent missing WAF associations or attach WAFs to resources.
  • Option D is incorrect: Amazon GuardDuty’s function is threat detection, not creating, managing, or attaching AWS WAF web ACLs to services like ALBs or API Gateway APIs.
  • Option E is incorrect: AWS Config managed rules detect non-compliance but do not automatically attach WAF web ACLs. While they can identify violations, they require additional remediation mechanisms. AWS Firewall Manager is purpose-built for this enforcement.

QUESTION 39

A security review has identified that an AWS CodeBuild project is downloading a database population script from an Amazon S3 bucket using an unauthenticated request. The security team does not allow unauthenticated requests to S3 buckets for this project.

How can this issue be in the MOST secure manner?

  • A. Add the bucket name to the AllowedBuckets section of the CodeBuild project settings. Update the build spec to use the AWS CLI to download the database population script.
  • B. Modify the S3 bucket settings to enable HTTPS basic authentication and specify a token. Update the build spec to use cURL to pass the token and download the database population script.
  • C. Remove unauthenticated access from the S3 bucket with a bucket policy. Modify the service role for the CodeBuild project to include Amazon S3 access. Use the AWS CLI to download the database population script.
  • D. Remove unauthenticated access from the S3 bucket with a bucket policy. Use the AWS CLI to download the database population script using an IAM access key and a secret access key.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Removing unauthenticated access with a bucket policy directly resolves the security issue. Granting CodeBuild’s service role S3 access via IAM is the secure, recommended method for AWS service-to-service communication. Using AWS CLI then automatically authenticates with this role.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AllowedBuckets is for output artifacts, not input. It doesn’t secure the download if the bucket remains unauthenticated, nor does it provide the necessary authentication/authorization.
  • Option B is incorrect: S3 does not support "HTTPS basic authentication" with a custom token. This approach attempts to implement a non-standard and less secure authentication mechanism outside of AWS’s native IAM.
  • Option D is incorrect: While removing unauthenticated access is correct, using hardcoded IAM access keys and secret access keys directly in CodeBuild is an anti-pattern and a major security risk. IAM roles are the secure alternative.

QUESTION 40 (Multi-Select)

An ecommerce company is receiving reports that its order history page is experiencing delays in reflecting the processing status of orders. The order processing system consists of an AWS Lambda function that uses reserved concurrency. The Lambda function processes order messages from an Amazon Simple Queue Service (Amazon SQS) queue and inserts processed orders into an Amazon DynamoDB table. The DynamoDB table has auto scaling enabled for read and write capacity.

Which actions should a DevOps engineer take to resolve this delay? (Choose two.)

  • A. Check the ApproximateAgeOfOldestMessage metric for the SQS queue. Increase the Lambda function concurrency limit.
  • B. Check the ApproximateAgeOfOldestMessage metnc for the SQS queue Configure a redrive policy on the SQS queue.
  • C. Check the NumberOfMessagesSent metric for the SQS queue. Increase the SQS queue visibility timeout.
  • D. Check the WriteThrottleEvents metric for the DynamoDB table. Increase the maximum write capacity units (WCUs) for the table's scaling policy.
  • E. Check the Throttles metric for the Lambda function. Increase the Lambda function timeout.
Click to View Verified Solution & Explanation

Correct Option: A,D

Explanation: ✅ Option A (Correct)
Reasoning: A high ApproximateAgeOfOldestMessage in SQS means messages are piling up, causing delays. Increasing Lambda’s concurrency limit allows more function instances to process messages in parallel, reducing the queue backlog and speeding up order processing and status updates.


✅ Option D (Correct)
Reasoning: WriteThrottleEvents in DynamoDB indicates write capacity bottlenecks, preventing timely order status updates. Even with auto scaling, there’s a max limit. Increasing the maximum WCUs for the table’s scaling policy allows DynamoDB to handle higher write loads, preventing throttling and resolving delays in status reflection.

❌ Why the other choices are incorrect:

  • Option B is incorrect: A redrive policy (DLQ) manages messages that fail processing, not those causing general processing delays due to throughput issues. It doesn’t speed up successful message consumption.
  • Option C is incorrect: NumberOfMessagesSent tracks ingress, not processing status or backlog. Increasing SQS visibility timeout prevents duplicate processing but does not accelerate message consumption; it can even impede overall throughput.
  • Option E is incorrect: Lambda’s Throttles indicates concurrency limits (addressed by A). Increasing Lambda timeout allows individual invocations to run longer, but it doesn’t increase overall throughput or resolve a backlog if the issue is insufficient concurrent workers or downstream bottlenecks.

QUESTION 41

A company has a single AWS account that runs hundreds of Amazon EC2 instances in a single AWS Region. New EC2 instances are launched and terminated each hour in the account. The account also includes existing EC2 instances that have been running for longer than a week.

The company’s security policy requires all running EC2 instances to use an EC2 instance profile. If an EC2 instance does not have an instance profile attached, the EC2 instance must use a default instance profile that has no IAM permissions assigned.

A DevOps engineer reviews the account and discovers EC2 instances that are running without an instance profile. During the review, the DevOps engineer also observes that new EC2 instances are being launched without an instance profile.

Which solution will ensure that an instance profile is attached to all existing and future EC2 instances in the Region?

  • A. Configure an Amazon EventBridge rule that reacts to EC2 RunInstances API calls. Configure the rule to invoke an AWS Lambda function to attach the default instance profile to the EC2 instances.
  • B. Configure the ec2-instance-profile-attached AWS Config managed rule with a trigger type of configuration changes. Configure an automatic remediation action that invokes an AWS Systems Manager Automation runbook to attach the default instance profile to the EC2 instances.
  • C. Configure an Amazon EventBridge rule that reacts to EC2 StartInstances API calls. Configure the rule to invoke an AWS Systems Manager Automation runbook to attach the default instance profile to the EC2 instances.
  • D. Configure the iam-role-managed-policy-check AWS Config managed rule with a trigger type of configuration changes. Configure an automatic remediation action that invokes an AWS Lambda function to attach the default instance profile to the EC2 instances.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: The ec2-instance-profile-attached AWS Config rule specifically monitors EC2 instances for attached instance profiles. Triggering on configuration changes ensures continuous evaluation of both existing and newly launched instances. Automatic remediation via Systems Manager Automation directly attaches the default instance profile, ensuring all compliant and future instances meet the security policy.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Reacting to RunInstances API calls only addresses new instance launches. It fails to identify and remediate existing EC2 instances that are already running without an instance profile, thus not ensuring compliance for all instances.
  • Option C is incorrect: Reacting to StartInstances API calls only triggers when a stopped EC2 instance is started. It will not detect newly launched instances or existing running instances that were never stopped, failing to ensure overall compliance.
  • Option D is incorrect: The iam-role-managed-policy-check AWS Config rule monitors IAM role policy compliance, not whether an EC2 instance profile is attached to an instance. This rule is irrelevant to the specific problem of missing instance profiles.

QUESTION 42

A development team is using AWS CodeCommit to version control application code and AWS CodePipeline to orchestrate software deployments. The team has decided to use a remote main branch as the trigger for the pipeline to integrate code changes. A developer has pushed code changes to the CodeCommit repository, but noticed that the pipeline had no reaction, even after 10 minutes.

Which of the following actions should be taken to troubleshoot this issue?

  • A. Check that an Amazon EventBridge rule has been created for the main branch to trigger the pipeline.
  • B. Check that the CodePipeline service role has permission to access the CodeCommit repository.
  • C. Check that the developer’s IAM role has permission to push to the CodeCommit repository.
  • D. Check to see if the pipeline failed to start because of CodeCommit errors in Amazon CloudWatch Logs.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: To automatically trigger CodePipeline from CodeCommit changes, an Amazon EventBridge (formerly CloudWatch Events) rule must be configured. This rule monitors CodeCommit repository events (e.g., pushes to a specific branch like main) and invokes the CodePipeline. If this rule is missing or misconfigured for the main branch, the pipeline will not react to pushes.

❌ Why the other choices are incorrect:

  • Option B is incorrect: CodePipeline’s service role permissions are crucial for pipeline execution (e.g., fetching source). If missing, the pipeline would likely start but fail in the source stage, not "have no reaction" to the push.
  • Option C is incorrect: The problem states the developer "has pushed code changes," implying the push was successful. If the developer lacked push permissions, the push itself would have failed.
  • Option D is incorrect: If the pipeline "had no reaction," it means it didn’t even start. CloudWatch Logs typically contain execution logs for pipelines that do start. The issue here is the absence of a trigger, not an execution failure.

QUESTION 43

A company uses AWS Organizations and AWS Control Tower to manage all the company’s AWS accounts. The company uses the Enterprise Support plan.

A DevOps engineer is using Account Factory for Terraform (AFT) to provision new accounts. When new accounts are provisioned, the DevOps engineer notices that the support plan for the new accounts is set to the Basic Support plan. The DevOps engineer needs to implement a solution to provision the new accounts with the Enterprise Support plan.

Which solution will meet these requirements?

  • A. Use an AWS Config conformance pack to deploy the account-part-of-organizations AWS Config rule and to automatically remediate any noncompliant accounts.
  • B. Create an AWS Lambda function to create a ticket for AWS Support to add the account to the Enterprise Support plan. Grant the Lambda function the support:ResolveCase permission.
  • C. Add an additional value to the control_tower_parameters input to set the AWSEnterpriseSupport parameter as the organization's management account number.
  • D. Set the aft_feature_enterprise_support feature flag to True in the AFT deployment input configuration. Redeploy AFT and apply the changes.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Account Factory for Terraform (AFT) includes a dedicated feature flag, aft_feature_enterprise_support, specifically designed to ensure newly provisioned accounts inherit the organization’s Enterprise Support plan. Enabling this flag configures AFT to apply the correct support plan during account creation.

❌ Why the other choices are incorrect:

  • Option A is incorrect: The account-part-of-organizations Config rule only verifies if an account belongs to an organization, not its support plan level. AWS Config cannot directly set an account’s support plan.
  • Option B is incorrect: There is no direct AWS API to programmatically change an account’s support plan via a Lambda function. Creating support tickets is a manual workaround, not an automated provisioning solution.
  • Option C is incorrect: Control Tower parameters do not include a standard AWSEnterpriseSupport parameter to set the support plan using the management account number. AFT has its own configuration for this feature.

QUESTION 44

A company’s DevOps engineer uses AWS Systems Manager to perform maintenance tasks during maintenance windows. The company has a few Amazon EC2 instances that require a restart after notifications from AWS Health. The DevOps engineer needs to implement an automated solution to remediate these notifications. The DevOps engineer creates an Amazon EventBridge rule.

How should the DevOps engineer configure the EventBridge rule to meet these requirements?

  • A. Configure an event source of AWS Health, a service of EC2. and an event type that indicates instance maintenance. Target a Systems Manager document to restart the EC2 instance.
  • B. Configure an event source of Systems Manager and an event type that indicates a maintenance window. Target a Systems Manager document to restart the EC2 instance.
  • C. Configure an event source of AWS Health, a service of EC2, and an event type that indicates instance maintenance. Target a newly created AWS Lambda function that registers an automation task to restart the EC2 instance during a maintenance window.
  • D. Configure an event source of EC2 and an event type that indicates instance maintenance. Target a newly created AWS Lambda function that registers an automation task to restart the EC2 instance during a maintenance window.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: AWS Health delivers instance maintenance notifications. EventBridge can directly capture these specific AWS Health events. Targeting a Systems Manager document provides a robust, automated way to restart the EC2 instance.

❌ Why the other choices are incorrect:

  • Option B is incorrect: The primary trigger for remediation is an AWS Health notification about an instance, not a Systems Manager event indicating a maintenance window.
  • Option C is incorrect: While the event source is correct, using a Lambda function solely to "register an automation task" is an unnecessary abstraction. EventBridge can directly target Systems Manager Documents for automated actions.
  • Option D is incorrect: EC2 instances do not directly emit "instance maintenance" events in this context; AWS Health is the service that provides these consolidated notifications.

QUESTION 45 (Multi-Select)

A company has an AWS CodePipeline pipeline that is configured with an Amazon S3 bucket in the eu-west-1 Region. The pipeline deploys an AWS Lambda application to the same Region. The pipeline consists of an AWS CodeBuild project build action and an AWS CloudFormation deploy action.

The CodeBuild project uses the aws cloudformation package AWS CLI command to build an artifact that contains the Lambda function code’s .zip file and the CloudFormation template. The CloudFormation deploy action references the CloudFormation template from the output artifact of the CodeBuild project’s build action.

The company wants to also deploy the Lambda application to the us-east-1 Region by using the pipeline in eu-west-1. A DevOps engineer has already updated the CodeBuild project to use the aws cloudformation package command to produce an additional output artifact for us-east-1.

Which combination of additional steps should the DevOps engineer take to meet these requirements? (Choose two.)

  • A. Modify the CloudFormation template to include a parameter for the Lambda function code’s zip file location. Create a new CloudFormation deploy action for us-east-1 in the pipeline. Configure the new deploy action to pass in the us-east-1 artifact location as a parameter override.
  • B. Create a new CloudFormation deploy action for us-east-1 in the pipeline. Configure the new deploy action to use the CloudFormation template from the us-east-1 output artifact.
  • C. Create an S3 bucket in us-east-1. Configure the S3 bucket policy to allow CodePipeline to have read and write access.
  • D. Create an S3 bucket in us-east-1. Configure S3 Cross-Region Replication (CRR) from the S3 bucket in eu-west-1 to the S3 bucket in us-east-1.
  • E. Modify the pipeline to include the S3 bucket for us-east-1 as an artifact store. Create a new CloudFormation deploy action for us-east-1 in the pipeline. Configure the new deploy action to use the CloudFormation template from the us-east-1 output artifact.
Click to View Verified Solution & Explanation

Correct Option: A,B

Explanation: ✅ Option A (Correct)
Reasoning: To deploy a CloudFormation stack to a new region, it’s best practice to parameterize region-specific values like S3 bucket names where Lambda code or other artifacts are stored. This allows the same template to be used across regions by overriding parameters with us-east-1 specific values during deployment.


✅ Option B (Correct)
Reasoning: Deploying to a new AWS Region (us-east-1) requires a dedicated deployment action in the pipeline. Since CodeBuild already produced a us-east-1 specific output artifact (containing the packaged CloudFormation template and Lambda code), this new deploy action should utilize that artifact directly.

❌ Why the other choices are incorrect:

  • Option C is incorrect: The aws cloudformation package command requires an S3 bucket in the target region for artifact uploads. If CodeBuild is already producing a us-east-1 artifact, this S3 bucket implicitly exists and has appropriate permissions.
  • Option D is incorrect: S3 Cross-Region Replication would simply copy the eu-west-1 packaged template. This template would still reference eu-west-1 S3 URIs for Lambda code, causing deployment failures in us-east-1. aws cloudformation package must be run for the target region to embed correct S3 URIs.
  • Option E is incorrect: CodePipeline uses a single artifact store (S3 bucket) located in the pipeline’s region (eu-west-1). You do not configure additional region-specific artifact stores within the pipeline itself for cross-region deployments. The us-east-1 artifact is stored within the eu-west-1 pipeline’s artifact store.

QUESTION 46

A company hosts a security auditing application in an AWS account. The auditing application uses an IAM role to access other AWS accounts. All the accounts are in the same organization in AWS Organizations.

A recent security audit revealed that users in the audited AWS accounts could modify or delete the auditing application’s IAM role. The company needs to prevent any modification to the auditing application’s IAM role by any entity other than a trusted administrator IAM role.

Which solution will meet these requirements?

  • A. Create an SCP that includes a Deny statement for changes to the auditing application's IAM role. Include a condition that allows the trusted administrator IAM role to make changes. Attach the SCP to the root of the organization.
  • B. Create an SCP that includes an Allow statement for changes to the auditing application's IAM role by the trusted administrator IAM role. Include a Deny statement for changes by all other IAM principals. Attach the SCP to the IAM service in each AWS account where the auditing application has an IAM role.
  • C. Create an IAM permissions boundary that includes a Deny statement for changes to the auditing application's IAM role. Include a condition that allows the trusted administrator IAM role to make changes. Attach the permissions boundary to the audited AWS accounts.
  • D. Create an IAM permissions boundary that includes a Deny statement for changes to the auditing application’s IAM role. Include a condition that allows the trusted administrator IAM role to make changes. Attach the permissions boundary to the auditing application's IAM role in the AWS accounts.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: An SCP attached to the organization root provides a centralized, enforceable guardrail. An explicit Deny in an SCP overrides any Allow statements in IAM policies, ensuring only the specified trusted administrator role can modify the auditing role, preventing unauthorized changes across all accounts.

❌ Why the other choices are incorrect:

  • Option B is incorrect: SCPs are attached to OUs or accounts, not directly to AWS services like IAM. Also, an SCP’s "Allow" statement defines maximum permissions, it doesn’t grant them. The attachment method is fundamentally flawed.
  • Option C is incorrect: IAM permissions boundaries are attached to IAM users or roles, not to AWS accounts. They limit what the attached identity itself can do, not who can modify that identity. This solution would not prevent users from modifying the role.
  • Option D is incorrect: Attaching a permissions boundary to the auditing application’s IAM role restricts what that specific role can perform. It does not prevent other users or roles in the AWS accounts from modifying or deleting the auditing application’s role.

QUESTION 47

A company has an on-premises application that is written in Go. A DevOps engineer must move the application to AWS. The company’s development team wants to enable blue/green deployments and perform A/B testing.

Which solution will meet these requirements?

  • A. Deploy the application on an Amazon EC2 instance, and create an AMI of the instance. Use the AMI to create an automatic scaling launch configuration that is used in an Auto Scaling group. Use Elastic Load Balancing to distribute traffic. When changes are made to the application, a new AMI will be created, which will initiate an EC2 instance refresh.
  • B. Use Amazon Lightsail to deploy the application. Store the application in a zipped format in an Amazon S3 bucket. Use this zipped version to deploy new versions of the application to Lightsail. Use Lightsail deployment options to manage the deployment.
  • C. Use AWS CodeArtifact to store the application code. Use AWS CodeDeploy to deploy the application to a fleet of Amazon EC2 instances. Use Elastic Load Balancing to distribute the traffic to the EC2 instances. When making changes to the application, upload a new version to CodeArtifact and create a new CodeDeploy deployment.
  • D. Use AWS Elastic Beanstalk to host the application. Store a zipped version of the application in Amazon S3. Use that location to deploy new versions of the application. Use Elastic Beanstalk to manage the deployment options.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: AWS Elastic Beanstalk natively supports blue/green deployments, allowing a new application version to run independently before swapping traffic. It integrates with load balancers, enabling traffic splitting necessary for A/B testing, meeting both requirements with a managed service.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While EC2, AMIs, Auto Scaling, and ELB are foundational, this solution describes rolling updates via instance refresh, not native blue/green deployments or A/B testing capabilities without significant custom orchestration.
  • Option B is incorrect: Amazon Lightsail is a simpler, more limited service for basic web applications. It does not offer native blue/green deployment or A/B testing features, making it unsuitable for the advanced requirements.
  • Option C is incorrect: AWS CodeArtifact is for storing package dependencies (e.g., npm, Maven), not application deployable artifacts. While CodeDeploy supports blue/green, the premise of using CodeArtifact for application code is fundamentally incorrect for this use case.

QUESTION 48

A developer is maintaining a fleet of 50 Amazon EC2 Linux servers. The servers are part of an Amazon EC2 Auto Scaling group, and also use Elastic Load Balancing for load balancing.

Occasionally, some application servers are being terminated after failing ELB HTTP health checks. The developer would like to perform a root cause analysis on the issue, but before being able to access application logs, the server is terminated.

How can log collection be automated?

  • A. Use Auto Scaling lifecycle hooks to put instances in a Pending:Wait state. Create an Amazon CloudWatch alarm for EC2 Instance Terminate Successful and trigger an AWS Lambda function that invokes an SSM Run Command script to collect logs, push them to Amazon S3, and complete the lifecycle action once logs are collected.
  • B. Use Auto Scaling lifecycle hooks to put instances in a Terminating:Wait state. Create an AWS Config rule for EC2 Instance-terminate Lifecycle Action and trigger a step function that invokes a script to collect logs, push them to Amazon S3, and complete the lifecycle action once logs are collected.
  • C. Use Auto Scaling lifecycle hooks to put instances in a Terminating:Wait state. Create an Amazon CloudWatch subscription filter for EC2 Instance Terminate Successful and trigger a CloudWatch agent that invokes a script to collect logs, push them to Amazon S3, and complete the lifecycle action once logs are collected.
  • D. Use Auto Scaling lifecycle hooks to put instances in a Terminating:Wait state. Create an Amazon EventBridge rule for EC2 Instance-terminate Lifecycle Action and trigger an AWS Lambda function that invokes an SSM Run Command script to collect logs, push them to Amazon S3, and complete the lifecycle action once logs are collected.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Terminating:Wait is essential to pause termination for log collection. An EventBridge rule is the correct, event-driven service to detect EC2 Instance-terminate Lifecycle Action events. Lambda can then trigger SSM Run Command to execute scripts on the instance, collect logs to S3, and complete the lifecycle action, allowing termination.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Pending:Wait is for launch, not termination. CloudWatch alarm for EC2 Instance Terminate Successful is not the correct event source for detecting lifecycle hooks.
  • Option B is incorrect: AWS Config rule monitors resource configurations and changes, it is not designed to trigger on EC2 Instance-terminate Lifecycle Action events directly to initiate log collection.
  • Option C is incorrect: CloudWatch subscription filter for EC2 Instance Terminate Successful targets log group events, not lifecycle action events. A CloudWatch agent is for collecting logs from an instance, not for invoking a remote script in response to a termination event.

QUESTION 49 (Multi-Select)

A company has an organization in AWS Organizations. The organization includes workload accounts that contain enterprise applications. The company centrally manages users from an operations account. No users can be created in the workload accounts. The company recently added an operations team and must provide the operations team members with administrator access to each workload account.

Which combination of actions will provide this access? (Choose three.)

  • A. Create a SysAdmin role in the operations account. Attach the AdministratorAccess policy to the role. Modify the trust relationship to allow the sts:AssumeRole action from the workload accounts.
  • B. Create a SysAdmin role in each workload account. Attach the AdministratorAccess policy to the role. Modify the trust relationship to allow the sts:AssumeRole action from the operations account.
  • C. Create an Amazon Cognito identity pool in the operations account. Attach the SysAdmin role as an authenticated role.
  • D. In the operations account, create an IAM user for each operations team member.
  • E. In the operations account, create an IAM user group that is named SysAdmins. Add an IAM policy that allows the sts:AssumeRole action for the SysAdmin role in each workload account. Add all operations team members to the group.
  • F. Create an Amazon Cognito user pool in the operations account. Create an Amazon Cognito user for each operations team member.
Click to View Verified Solution & Explanation

Correct Option: B,D,E

Explanation: ✅ Option B (Correct)
Reasoning: Creating an AdministratorAccess role in each target workload account, with a trust policy allowing sts:AssumeRole from the operations account, is the standard and secure AWS mechanism for granting cross-account administrative access.


✅ Option D (Correct)
Reasoning: The scenario states users are centrally managed in the operations account. To provide access to team members, creating individual IAM users for each in the operations account is the fundamental first step for their authentication and identity.


✅ Option E (Correct)
Reasoning: Creating an IAM group in the operations account, adding users to it, and attaching a policy that explicitly permits sts:AssumeRole for the specific SysAdmin roles in each workload account, grants the necessary permissions to assume the roles created in step B.

❌ Why the other choices are incorrect:

  • Option A is incorrect: The administrative role with AdministratorAccess must reside in the target workload accounts, not the source operations account. The trust policy should allow assumption from the operations account.
  • Option C is incorrect: Amazon Cognito identity pools are typically used for federating identities for web/mobile applications, not for direct IAM user-based cross-account administrative access within AWS Organizations.
  • Option F is incorrect: Amazon Cognito user pools manage directories for web/mobile application users. For internal AWS administrative access, IAM users in the operations account are the correct and standard identity type.

QUESTION 50 (Multi-Select)

A company is implementing an Amazon Elastic Container Service (Amazon ECS) cluster to run its workload. The company architecture will run multiple ECS services on the cluster. The architecture includes an Application Load Balancer on the front end and uses multiple target groups to route traffic.

A DevOps engineer must collect application and access logs. The DevOps engineer then needs to send the logs to an Amazon S3 bucket for near-real-time analysis.

Which combination of steps must the DevOps engineer take to meet these requirements? (Choose three.)

  • A. Download the Amazon CloudWatch Logs container instance from AWS. Configure this instance as a task. Update the application service definitions to include the logging task.
  • B. Install the Amazon CloudWatch Logs agent on the ECS instances. Change the logging driver in the ECS task definition to awslogs.
  • C. Use Amazon EventBridge to schedule an AWS Lambda function that will run every 60 seconds and will run the Amazon CloudWatch Logs create-export-task command. Then point the output to the logging S3 bucket.
  • D. Activate access logging on the ALB. Then point the ALB directly to the logging S3 bucket.
  • E. Activate access logging on the target groups that the ECS services use. Then send the logs directly to the logging S3 bucket.
  • F. Create an Amazon Kinesis Data Firehose delivery stream that has a destination of the logging S3 bucket. Then create an Amazon CloudWatch Logs subscription filter for Kinesis Data Firehose.
Click to View Verified Solution & Explanation

Correct Option: B,D,F

Explanation: ✅ Option B (Correct)
Reasoning: The awslogs logging driver configured in ECS task definitions is the standard way to send application logs (stdout/stderr) from containers directly to Amazon CloudWatch Logs. This is a foundational step for centralized container log collection, even if the CloudWatch Logs agent isn’t strictly necessary for container logs specifically.


✅ Option D (Correct)
Reasoning: Application Load Balancers (ALB) offer native access logging functionality. Enabling this feature configures the ALB to directly deliver detailed access logs to a specified Amazon S3 bucket, fulfilling the requirement for near-real-time analysis of front-end traffic.


✅ Option F (Correct)
Reasoning: To achieve near-real-time analysis of CloudWatch Logs in S3, an Amazon Kinesis Data Firehose delivery stream is used. A CloudWatch Logs subscription filter sends the log events to Firehose, which then delivers them continuously to the designated S3 bucket.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Running a "CloudWatch Logs container instance as a task" to collect application logs from other tasks is not a standard or efficient pattern. The awslogs driver is the direct and preferred method.
  • Option C is incorrect: create-export-task is for bulk, historical export of CloudWatch Logs to S3, not near-real-time streaming. Scheduling it every 60 seconds via Lambda is inefficient and not truly near-real-time.
  • Option E is incorrect: Target Groups themselves do not have direct access logging capabilities to S3. Access logging for traffic routed by an ALB is handled directly by the ALB component.

QUESTION 51

A company that uses electronic health records is running a fleet of Amazon EC2 instances with an Amazon Linux operating system. As part of patient privacy requirements, the company must ensure continuous compliance for patches for operating system and applications running on the EC2 instances.

How can the deployments of the operating system and application patches be automated using a default and custom repository?

  • A. Use AWS Systems Manager to create a new patch baseline including the custom repository. Run the AWS-RunPatchBaseline document using the run command to verify and install patches.
  • B. Use AWS Direct Connect to integrate the corporate repository and deploy the patches using Amazon CloudWatch scheduled events, then use the CloudWatch dashboard to create reports.
  • C. Use yum-config-manager to add the custom repository under /etc/yum.repos.d and run yum-config-manager-enable to activate the repository.
  • D. Use AWS Systems Manager to create a new patch baseline including the corporate repository. Run the AWS-AmazonLinuxDefaultPatchBaseline document using the run command to verify and install patches.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: AWS Systems Manager Patch Manager is purpose-built for automating OS and application patching across EC2 fleets. Creating a new patch baseline allows specifying custom repositories in addition to default ones. The AWS-RunPatchBaseline document then executes the scanning and installation process on managed instances according to this baseline, ensuring continuous compliance.

❌ Why the other choices are incorrect:

  • Option B is incorrect: AWS Direct Connect provides network connectivity, not patching automation. CloudWatch events can schedule tasks, but they don’t manage patch baselines, custom repositories, or the actual patch installation process for EC2 instances.
  • Option C is incorrect: These are manual commands executed on an individual instance. They do not provide automated, centralized management, compliance enforcement, or reporting for a fleet of EC2 instances, which is essential for continuous compliance in a company environment.
  • Option D is incorrect: While AWS Systems Manager is the correct service, the AWS-AmazonLinuxDefaultPatchBaseline exclusively uses Amazon’s default repositories. It cannot be configured to include a custom repository, which is a specific requirement in the question. A new custom baseline is necessary.

QUESTION 52 (Multi-Select)

A DevOps engineer needs to back up sensitive Amazon S3 objects that are stored within an S3 bucket with a private bucket policy using S3 cross-Region replication functionality. The objects need to be copied to a target bucket in a different AWS Region and account.

Which combination of actions should be performed to enable this replication? (Choose three.)

  • A. Create a replication IAM role in the source account.
  • B. Create a replication IAM role in the target account.
  • C. Add statements to the source bucket policy allowing the replication IAM role to replicate objects.
  • D. Add statements to the target bucket policy allowing the replication IAM role to replicate objects.
  • E. Create a replication rule in the source bucket to enable the replication.
  • F. Create a replication rule in the target bucket to enable the replication.
Click to View Verified Solution & Explanation

Correct Option: A,D,E

Explanation: ✅ Option A (Correct)
Reasoning: For S3 replication, an IAM role is required to grant S3 permissions to the S3 service itself. This role must be created in the source AWS account and have permissions to read objects from the source bucket and replicate them to the target. The S3 service assumes this role to perform replication tasks.


✅ Option D (Correct)
Reasoning: Since the target bucket resides in a different AWS account, its bucket policy must explicitly grant the replication IAM role (created in the source account) permissions to perform actions like s3:ReplicateObject, s3:ReplicateDelete, and s3:ReplicateTags. This ensures cross-account access for the replication process.


✅ Option E (Correct)
Reasoning: To enable S3 cross-Region replication, a replication rule must be configured on the source bucket. This rule specifies the destination bucket (including its Region and account), the IAM role to use, and object filters (e.g., prefix, tags) if only specific objects should be replicated.

❌ Why the other choices are incorrect:

  • Option B is incorrect: The replication IAM role must be created in the source account because the S3 service in the source account assumes this role to perform the replication.
  • Option C is incorrect: The replication IAM role itself typically gets s3:GetObject permissions via its own IAM policy. While a source bucket policy could grant this, it’s not the primary or required action; the role’s policy is key.
  • Option F is incorrect: Replication rules are always configured on the source bucket to initiate and manage the replication of objects to a specified destination.

QUESTION 53

A company has an application that runs on Amazon EC2 instances that are in an Auto Scaling group. When the application starts up, the application needs to process data from an Amazon S3 bucket before the application can start to serve requests.

The size of the data that is stored in the S3 bucket is growing. When the Auto Scaling group adds new instances, the application now takes several minutes to download and process the data before the application can serve requests. The company must reduce the time that elapses before new EC2 instances are ready to serve requests.

Which solution is the MOST cost-effective way to reduce the application startup time?

  • A. Configure a warm pool for the Auto Scaling group with warmed EC2 instances in the Stopped state. Configure an autoscaling:EC2_INSTANCE_LAUNCHING lifecycle hook on the Auto Scaling group. Modify the application to complete the lifecycle hook when the application is ready to serve requests.
  • B. Increase the maximum instance count of the Auto Scaling group. Configure an autoscaling:EC2_INSTANCE_LAUNCHING lifecycle hook on the Auto Scaling group. Modify the application to complete the lifecycle hook when the application is ready to serve requests.
  • C. Configure a warm pool for the Auto Scaling group with warmed EC2 instances in the Running state. Configure an autoscaling:EC2_INSTANCE_LAUNCHING lifecycle hook on the Auto Scaling group. Modify the application to complete the lifecycle hook when the application is ready to serve requests.
  • D. Increase the maximum instance count of the Auto Scaling group. Configure an autoscaling:EC2_INSTANCE_LAUNCHING lifecycle hook on the Auto Scaling group. Modify the application to complete the lifecycle hook and to place the new instance in the Standby state when the application is ready to serve requests.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: A warm pool with stopped instances is highly cost-effective, incurring only EBS storage costs for pre-warmed instances. These instances have already processed S3 data, drastically reducing startup time when launched. The lifecycle hook ensures instances are fully ready before serving requests.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Increasing the maximum instance count doesn’t accelerate individual instance startup. Each new instance still undergoes the slow download/processing. This doesn’t solve the core latency problem or offer cost savings for faster readiness.
  • Option C is incorrect: Keeping warm pool instances in the Running state provides fast readiness but is significantly less cost-effective. Running instances incur full EC2 compute costs even when idle, making it much more expensive than the Stopped state.
  • Option D is incorrect: Increasing the maximum instance count doesn’t reduce startup time. Placing instances in Standby after processing means they are still running and incurring full EC2 costs. This isn’t a cost-effective solution for faster initial instance readiness.

QUESTION 54

A development team uses AWS CodeCommit for version control for applications. The development team uses AWS CodePipeline, AWS CodeBuild. and AWS CodeDeploy for CI/CD infrastructure. In CodeCommit, the development team recently merged pull requests that did not pass long-running tests in the code base. The development team needed to perform rollbacks to branches in the codebase, resulting in lost time and wasted effort.

A DevOps engineer must automate testing of pull requests in CodeCommit to ensure that reviewers more easily see the results of automated tests as part of the pull request review.

What should the DevOps engineer do to meet this requirement?

  • A. Create an Amazon EventBridge rule that reacts to the pullRequestStatusChanged event. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild badge as a comment on the pull request so that developers will see the badge in their code review.
  • B. Create an Amazon EventBridge rule that reacts to the pullRequestCreated event. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild test results as a comment on the pull request when the test results are complete.
  • C. Create an Amazon EventBridge rule that reacts to pullRequestCreated and pullRequestSourceBranchUpdated events. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild badge as a comment on the pull request so that developers will see the badge in their code review.
  • D. Create an Amazon EventBridge rule that reacts to the pullRequestStatusChanged event. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild test results as a comment on the pull request when the test results are complete.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Reacting to pullRequestCreated ensures initial tests run. pullRequestSourceBranchUpdated is critical to re-run tests if new commits are pushed, preventing merging untested code. Posting a CodeBuild badge provides clear, immediate status visibility to reviewers within the pull request.

❌ Why the other choices are incorrect:

  • Option A is incorrect: The pullRequestStatusChanged event triggers after a PR’s status changes (e.g., merged). This is too late to prevent merging code that failed tests, directly contradicting the problem’s goal.
  • Option B is incorrect: Reacting only to pullRequestCreated is insufficient. If new commits are pushed to the source branch after PR creation, tests won’t re-run on these changes, potentially leading to merging untested code.
  • Option D is incorrect: Similar to Option A, pullRequestStatusChanged is too late for proactive testing before merging. The tests must run prior to any status change that would allow merging.

QUESTION 55 (Multi-Select)

A company has its AWS accounts in an organization in AWS Organizations. AWS Config is manually configured in each AWS account. The company needs to implement a solution to centrally configure AWS Config for all accounts in the organization. The solution also must record resource changes to a central account.

Which combination of actions should a DevOps engineer perform to meet these requirements? (Choose two.)

  • A. Configure a delegated administrator account for AWS Config. Enable trusted access for AWS Config in the organization.
  • B. Configure a delegated administrator account for AWS Config. Create a service-linked role for AWS Config in the organization’s management account.
  • C. Create an AWS CloudFormation template to create an AWS Config aggregator. Configure a CloudFormation stack set to deploy the template to all accounts in the organization.
  • D. Create an AWS Config organization aggregator in the organization's management account. Configure data collection from all AWS accounts in the organization and from all AWS Regions.
  • E. Create an AWS Config organization aggregator in the delegated administrator account. Configure data collection from all AWS accounts in the organization and from all AWS Regions.
Click to View Verified Solution & Explanation

Correct Option: A,E

Explanation: ✅ Option A (Correct)
Reasoning: To centrally configure AWS Config across an organization, a delegated administrator account must first be designated. Enabling trusted access for AWS Config in AWS Organizations grants the necessary permissions for the service to manage and aggregate configuration data across all member accounts from this central delegated account.


✅ Option E (Correct)
Reasoning: An AWS Config organization aggregator deployed in the delegated administrator account allows for centralized collection of AWS Config data. Configuring it to collect from all accounts and AWS Regions ensures all resource changes across the entire organization are recorded in the specified central account, fulfilling the requirement.

❌ Why the other choices are incorrect:

  • Option B is incorrect: A service-linked role for AWS Config is automatically created when Config is enabled or a delegated administrator is set. Manually creating it in the management account specifically for an aggregator is not the correct action for centralizing Config via a delegated admin.
  • Option C is incorrect: While CloudFormation can deploy Config resources, an organization aggregator is a single resource configured in a central account (the delegated admin). CloudFormation Stack Sets deploy resources to multiple accounts, which is not how the central organization aggregator itself is implemented or configured to collect data.
  • Option D is incorrect: While an organization aggregator is needed, deploying it in the organization’s management account is against AWS best practices. The delegated administrator account is specifically designed and recommended for such centralized management tasks to maintain a clean management account.

QUESTION 56 (Multi-Select)

A company is performing vulnerability scanning for all Amazon EC2 instances across many accounts. The accounts are in an organization in AWS Organizations. Each account’s VPCs are attached to a shared transit gateway. The VPCs send traffic to the internet through a central egress VPC. The company has enabled Amazon Inspector in a delegated administrator account and has enabled scanning for all member accounts.

A DevOps engineer discovers that some EC2 instances are listed in the "not scanning" tab in Amazon Inspector.

Which combination of actions should the DevOps engineer take to resolve this issue? (Choose three.)

  • A. Verify that AWS Systems Manager Agent is installed and is running on the EC2 instances that Amazon Inspector is not scanning.
  • B. Associate the target EC2 instances with security groups that allow outbound communication on port 443 to the AWS Systems Manager service endpoint.
  • C. Grant inspector:StartAssessmentRun permissions to the IAM role that the DevOps engineer is using.
  • D. Configure EC2 Instance Connect for the EC2 instances that Amazon Inspector is not scanning.
  • E. Associate the target EC2 instances with instance profiles that grant permissions to communicate with AWS Systems Manager.
  • F. Create a managed-instance activation. Use the Activation Code and the Activation ID to register the EC2 instances.
Click to View Verified Solution & Explanation

Correct Option: A,B,E

Explanation: ✅ Option A (Correct)
Reasoning: Amazon Inspector relies on the AWS Systems Manager Agent (SSM Agent) installed and running on EC2 instances to collect vulnerability data. If the agent is missing or inactive, Inspector cannot gather necessary information, leading to instances being listed as "not scanning."


✅ Option B (Correct)
Reasoning: EC2 instances require network connectivity to communicate with AWS Systems Manager service endpoints. This communication happens over outbound port 443 (HTTPS). Security groups must permit this outbound access for the SSM Agent to register and send data to the SSM service, which Inspector utilizes.


✅ Option E (Correct)
Reasoning: For an EC2 instance to be managed by AWS Systems Manager (and thus scannable by Inspector), it must be associated with an instance profile. This profile grants the SSM Agent the necessary IAM permissions (e.g., AmazonSSMManagedInstanceCore) to communicate with the SSM service.

❌ Why the other choices are incorrect:

  • Option C is incorrect: inspector:StartAssessmentRun permissions are for initiating an Inspector scan, not for enabling instances to be scanned. The problem indicates instances are "not scanning," implying a setup issue, not a permission issue to start a scan.
  • Option D is incorrect: EC2 Instance Connect is a feature for secure SSH access to EC2 instances. It is unrelated to Amazon Inspector’s mechanism for vulnerability scanning, which uses AWS Systems Manager.
  • Option F is incorrect: Managed-instance activation is primarily used to register on-premises servers or virtual machines with AWS Systems Manager. For EC2 instances, registration typically occurs automatically when an instance profile with SSM permissions is attached.

QUESTION 57

A space exploration company receives telemetry data from multiple satellites. Small packets of data are received through Amazon API Gateway and are placed directly into an Amazon Simple Queue Service (Amazon SQS) standard queue. A custom application is subscribed to the queue and transforms the data into a standard format.

Because of inconsistencies in the data that the satellites produce, the application is occasionally unable to transform the data. In these cases, the messages remain in the SQS queue. A DevOps engineer must develop a solution that retains the failed messages and makes them available to scientists for review and future processing.

Which solution will meet these requirements?

  • A. Configure AWS Lambda to poll the SQS queue and invoke a Lambda function to check whether the queue messages are valid. If validation fails, send a copy of the data that is not valid to an Amazon S3 bucket so that the scientists can review and correct the data. When the data is , amend the message in the SQS queue by using a replay Lambda function with the data.
  • B. Convert the SQS standard queue to an SQS FIFO queue. Configure AWS Lambda to poll the SQS queue every 10 minutes by using an Amazon EventBridge schedule. Invoke the Lambda function to identify any messages with a SentTimestamp value that is older than 5 minutes, push the data to the same location as the application's output location, and remove the messages from the queue.
  • C. Create an SQS dead-letter queue. Modify the existing queue by including a redrive policy that sets the Maximum Receives setting to 1 and sets the dead-letter queue ARN to the ARN of the newly created queue. Instruct the scientists to use the dead-letter queue to review the data that is not valid. Reprocess this data at a later time.
  • D. Configure API Gateway to send messages to different SQS virtual queues that are named for each of the satellites. Update the application to use a new virtual queue for any data that it cannot transform, and send the message to the new virtual queue. Instruct the scientists to use the virtual queue to review the data that is not valid. Reprocess this data at a later time.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Creating an SQS dead-letter queue (DLQ) with a redrive policy and setting Maximum Receives to 1 is the canonical solution. This immediately moves messages the application fails to process (cannot transform) to the DLQ, preventing them from blocking the main queue. Scientists can then easily review and reprocess these failed messages from the dedicated DLQ.

❌ Why the other choices are incorrect:

  • Option A is incorrect: SQS messages are immutable; you cannot "amend" a message in the queue. This solution also introduces unnecessary Lambda polling and custom validation logic when DLQs offer a simpler, built-in mechanism.
  • Option B is incorrect: Converting to FIFO is unnecessary as ordering is not a requirement. Polling every 10 minutes for old messages is an inefficient and reactive approach compared to the proactive DLQ mechanism. The solution does not clearly provide a dedicated review location for scientists.
  • Option D is incorrect: "SQS virtual queues" are not a native AWS SQS feature. This option requires custom application logic to handle failures and send to a non-existent queue type, which is overly complex and deviates from standard SQS capabilities.

QUESTION 58

A company’s production environment uses an AWS CodeDeploy blue/green deployment to deploy an application. The deployment includes Amazon EC2 Auto Scaling groups that launch instances that run Amazon Linux 2.

A working appspec.yml file exists in the code repository and contains the following text:

A DevOps engineer needs to ensure that a script downloads and installs a license file onto the instances before the replacement instances start to handle request traffic. The DevOps engineer adds a hooks section to the appspec.yml file.

Which hook should the DevOps engineer use to run the script that downloads and installs the license file?

  • A. AfterBlockTraffic
  • B. BeforeBlockTraffc
  • C. Beforelnstall
  • D. DownloadBundle
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: The BeforeInstall hook executes scripts on the replacement instances after the application bundle is downloaded but before the application files are copied. This is the ideal stage to install prerequisites like a license file, ensuring it’s in place before the application is installed or starts, and well before instances handle traffic.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AfterBlockTraffic runs on the original instances after traffic is diverted, not the new instances.
  • Option B is incorrect: BeforeBlockTraffic runs on the original instances before traffic is diverted, not the new instances.
  • Option D is incorrect: DownloadBundle is a deployment step where the application bundle is downloaded; it’s not a configurable hook for running custom scripts.

QUESTION 59

A company has an application that includes AWS Lambda functions. The Lambda functions run Python code that is stored in an AWS CodeCommit repository. The company has recently experienced failures in the production environment because of an error in the Python code. An engineer has written unit tests for the Lambda functions to help avoid releasing any future defects into the production environment.

The company’s DevOps team needs to implement a solution to integrate the unit tests into an existing AWS CodePipeline pipeline. The solution must produce reports about the unit tests for the company to view.

Which solution will meet these requirements?

  • A. Associate the CodeCommit repository with Amazon CodeGuru Reviewer. Create a new AWS CodeBuild project. In the CodePipeline pipeline, configure a test stage that uses the new CodeBuild project. Create a buildspec yml file in the CodeCommit repository. In the buildspec.yml file, define the actions to run a Codeguru review.
  • B. Create a new AWS CodeBuild project in the pipeline, configure a test that uses the new project Create a CodeBuild report group. Create a buildspec yml file in the CodeCommit repository. In the buildspec yml file, define the actions to run the unit tests with an output of JUNITXML in the build phase section. Configure the test reports to be uploaded to the new report group.
  • C. Create a new AWS CodeArtifact repository Create a new AWS CodeBuild project. In the pipeline, configure a test stage that uses the new CodeBuild project. Create an appspec.yml file in the original CodeCommit repository. In the appspec yml file, define the actions to run the unit tests with an output of CUCUMBERJSON In the build phase section. Configure the tests reports to be sent to the new CodeArtlfact repository.
  • D. Create a new AWS CodeBuild project. In the CodePipeline pipeline, configure a test that uses the new project. Create a new Amazon S3 bucket Create a buildspec yml file in the CodeCommit repository. In the buildspec yml file, define the actions to run the unit tests with an output of HTML in the phases section. In the reports section, upload the test reports to the S3 bucket.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: CodeBuild is the appropriate service for running unit tests within a CodePipeline. A buildspec.yml file defines test execution, and CodeBuild Report Groups are designed for aggregating and viewing structured test reports, with JUNITXML being a widely supported format for unit tests. This fully meets the requirements.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Amazon CodeGuru Reviewer performs automated code reviews for quality and security, not for executing unit tests. Defining CodeGuru review actions in buildspec.yml does not address running the unit tests.
  • Option C is incorrect: AWS CodeArtifact manages software packages, not test reports. An appspec.yml file is used for CodeDeploy, not CodeBuild test stages. CUCUMBERJSON is typically for BDD frameworks, not standard Python unit test reporting.
  • Option D is incorrect: While CodeBuild can run tests, CodeBuild Report Groups (as in Option B) are the dedicated, integrated solution for structured test reporting. Storing raw HTML output in S3, while possible, doesn’t provide the same structured viewing and analysis capabilities as CodeBuild Report Groups.

QUESTION 60

A DevOps engineer is designing an application that integrates with a legacy REST API. The application has an AWS Lambda function that reads records from an Amazon Kinesis data stream. The function sends the records to the legacy REST API.

Approximately 10% of the records that the Lambda function sends the Kinesis data stream have data errors and must be processed manually. The function event source configuration has an Amazon Simple Queue Service (Amazon SQS) dead-letter queue as an on-failure destination. The DevOps engineer has configured the Lambda function to process records in batches and has Implemented retries in case of failure.

During testing, the DevOps engineer notices that the dead-letter queue contains many records that have no data errors and that already have been processed by the legacy REST API. The DevOps engineer needs to configure the Lambda function’s event source options to reduce the number of errorless records that are sent to the dead-letter queue.

Which solution will meet these requirements?

  • A. Increase the retry attempts.
  • B. Configure the setting to split the batch when an error.
  • C. Increase the concurrent batches per shard.
  • D. Decrease the maximum age of record.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Configuring to split the batch on error (or enabling ReportBatchItemFailures and returning specific item failures) allows Lambda to process successful records and only send problematic ones to the DLQ. This prevents an entire batch, including errorless records, from being marked as failed and routed to the DLQ unnecessarily, directly addressing the observed issue.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Increasing retry attempts only postpones sending the batch to the DLQ. It doesn’t help distinguish good records from bad within a failing batch, so errorless records would still end up in the DLQ after exhausting all retries.
  • Option C is incorrect: Increasing concurrent batches per shard enhances parallelism but does not change how errors are handled within a single batch. It would not prevent errorless records from being sent to the DLQ if a batch fails due to other records.
  • Option D is incorrect: Decreasing the maximum age of a record helps discard old records but has no impact on preventing errorless, currently processed records from being sent to the DLQ due to batch processing failures.

QUESTION 61

A company has deployed an application in a production VPC in a Single AWS account. The application s popular and IS experiencing heavy usage The company’s security team wants to add additional security, such as AWS WAF, to the application deployment However, the application’s product manager is concerned about cost and does not want to approve the change unless the security team can prove that additional security is necessary.

The security team believes that some of the application’s demand might come from users that have IP addresses that are on a deny list. The security team provides the deny list to a DevOps engineer. If any of the IP addresses on the deny list access the application, the security team wants to receive automated notification in near real time so that the security team can that the application needs additional security. The DevOps engineer creates a VPC flow log for the production VPC.

Which set of additional steps should the DevOps engineer take to meet these requirements MOST cost-effectively?

  • A. Create a Iog group in Amazon CloudWatch Logs. Configure the VPC flow to capture accepted traffic and to send the data to the group. Create an Amazon CloudWatch metric filter for IP addresses on the deny 1st. Create a CloudWatch alarm with the metric filter as input. Set the period to 5 minutes and the datapoints toalarm to 1. Use an Amazon Simple Notification Service (Amazon SNS) topic to send alarm notices to the security team.
  • B. Create an Amazon S3 bucket for files. Configure the VPC flow to capture all traffic and to send the data to the S3 bucket Configure Amazon Athena to return all log files in the S3 bucket for IP addresses on the deny list. Configure Amazon QuickSight to accept data from Athena and to publish the data as a dashboard the security team can access Create a threshold alert of 1 for successful access. Configure the alert to automatically notify the security team as frequently as possible when the alert threshold is met.
  • C. Create an Amazon S3 bucket for files. Configure the VPC flow to capture accepted traffic and to send the data to the S3 bucket Configure an Amazon OpenSearch Service cluster and domain for the log files. Create an AWS Lambda function to retrieve the logs from the S3 bucket, format the logs, and load the logs into the OpenSearch Service cluster Schedule the Lambda function to run every 5 minutes. Configure an alert and condition in OpenSearch Service to send alerts to the security team through an Amazon Simple Notification Service (Amazon SNS) topic when access from the IP addresses on the deny list is detected.
  • D. Create a log group in Amazon CloudWatch Logs. Create an Amazon S3 bucket to hold query results. Configure the VPC flow Iog to capture all traffic and to send the data to the log group. Deploy an Amazon Athena CloudWatch connector in AWS Lambda Connect the connector to the log group. Athena to periodically query for all accepted traffic from the IP addresses on the deny list and to store the results in the S3 bucket. Configure an S3 event notification to automatically notify the security team through an Amazon Simple Notification Service (Amazon SNS) topic when new objects are added to the S3 bucket.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: This approach is highly cost-effective and provides near real-time notification. CloudWatch Logs, Metric Filters, and Alarms efficiently process accepted VPC Flow Logs for specific IP addresses, triggering an SNS notification without provisioning complex or expensive analysis services.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Amazon QuickSight, while powerful for dashboards, is an expensive and overly complex solution for simply alerting on a few IP addresses. Athena scans can also be costly, and capturing all traffic (not just accepted) increases processing.
  • Option C is incorrect: Amazon OpenSearch Service is a powerful, but significantly more expensive and complex solution for log analysis, especially for this specific, simple alerting requirement. The Lambda function adds further cost and operational overhead.
  • Option D is incorrect: Using an Athena CloudWatch connector and periodic Athena queries is less "near real-time" and more complex than CloudWatch Metric Filters. Capturing all traffic and storing query results in S3 adds unnecessary costs compared to Option A.

QUESTION 62

A company uses AWS CloudFormation stacks to deploy updates to its ap include AWS Auto Scaling groups, Amazon EC2 instances, Application Load Balancers (ALBs). and other resources that are necessary to launch and maintain independent stacks. Changes to application resources outside of CloudFormation stack updates are not allowed.

The company recently attempted to update the application stack by using the AWS CLI. The stack failed to update and produced the following error message: "ERROR: both the deployment and the CloudFormation stack rollback failed. The deployment failed because the following resource(s) failed to update: [AutoScalingGroup1].”

The stack remains in a status of UPDATE ROLLBACK FAILED.

Which solution will resolve this issue?

  • A. Update the subnet mappings that are configured for the ALBs. Run the aws cloudformation update-stack-set AWS CLI command.
  • B. Update the IAM role by providing the necessary permissions to the stack. Run the aws cloudformation CLI command.
  • C. Submit a request for a quota increase for the number of EC2 instances for the account Run the aws cloudformation cancel-update-stack AWS CLI command.
  • D. Delete the Auto Scaling group resource. Run the aws cloudformation rollback-stack AWS CLI command.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: The UPDATE_ROLLBACK_FAILED status, coupled with an AutoScalingGroup update failure, strongly indicates a permissions issue. The CloudFormation service role likely lacked the necessary IAM permissions to modify or roll back the Auto Scaling group. Updating the IAM role to grant these permissions allows CloudFormation to proceed, potentially by retrying or continuing the rollback.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Subnet mappings for ALBs are unrelated to an Auto Scaling group failing an update and rollback. Furthermore, update-stack-set is for CloudFormation StackSets, not a single stack.
  • Option C is incorrect: Quota issues typically produce "limit exceeded" errors. cancel-update-stack is used for ongoing updates, not for a stack already in the UPDATE_ROLLBACK_FAILED state.
  • Option D is incorrect: Manually deleting a CloudFormation-managed resource can cause stack drift and further complicate recovery. There is no rollback-stack AWS CLI command, and manual deletion does not resolve the underlying UPDATE_ROLLBACK_FAILED state.

QUESTION 63

A company uses AWS Organizations to manage its AWS accounts. The organization has root has an OU that is named environments. The environments OU has two child OUS that are named Development and Production, respectively.

The Environments OU and the child OUs have the default FullAWSAccess policy in place. A DevOps engineer plans to remove the FullAWSAccess policy from the Development OU and replace the policy with a policy that allows all actions on Amazon EC2 resources.

What will be the outcome of this policy replacement?

  • A. All users in the Development OU will be allowed all API actions on all resources.
  • B. All users in the Development OU will be allowed all API actions on EC2 resources. All other API actions will be denied.
  • C. All users in the Development OU will be denied all API actions on all resources.
  • D. All users in the Development OU will be denied all API actions on EC2 resources. All other API actions will be allowed.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Service Control Policies (SCPs) define the maximum permissions. By replacing FullAWSAccess with an EC2:* policy on the Development OU, only EC2 actions are explicitly allowed at that level. All other API actions, no longer having an explicit ALLOW, become implicitly denied for users within the Development OU accounts.

❌ Why the other choices are incorrect:

  • Option A is incorrect: The FullAWSAccess policy was explicitly removed from the Development OU and replaced with a more restrictive policy, thus denying all other actions.
  • Option C is incorrect: The new policy explicitly allows all actions on EC2 resources, so not all actions are denied.
  • Option D is incorrect: The new policy allows EC2 actions, it does not deny them. Furthermore, other API actions will be denied, not allowed, due to the removal of the broader FullAWSAccess.

QUESTION 64

A company manually provisions IAM access for its employees. The company wants to replace the manual process with an automated process. The company has an existing Active Directory system configured with an external SAML 2.0 identity provider (ldP).

The company wants employees to use their existing corporate credentials to access AWS. The groups from the existing Active Directory system must be available for permission management in AWS Identity and Access Management (IAM). A DevOps engineer has completed the initial configuration of AWS IAM Identity Center (AWS Single Sign-On) in the company’s AWS account.

What should the DevOps engineer do next to meet the requirements?

  • A. Configure an external ldP as an identity source. Configure automatic provisioning of users and groups by using the SCIM protocol.
  • B. Configure AWS Directory Service as an identity source. Configure automatic provisioning of users and groups by using the SAML protocol.
  • C. Configure an AD Connector as an identity source. Configure automatic provisioning of users and groups by using the SCIM protocol.
  • D. Configure an external ldP as an identity source. Configure automatic provisioning of users and groups by using the SAML protocol.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: The existing external SAML 2.0 IdP should be configured as the identity source in AWS IAM Identity Center to use corporate credentials. SCIM (System for Cross-domain Identity Management) is the standard protocol for automatically provisioning users and groups from an external IdP into IAM Identity Center, fulfilling the automation and group management requirements.

❌ Why the other choices are incorrect:

  • Option B is incorrect: While AWS Directory Service can be an identity source, the company already has an external SAML IdP. SAML is used for authentication (single sign-on), not for automatic provisioning of users and groups; SCIM is used for provisioning.
  • Option C is incorrect: An AD Connector could link to the AD, but the scenario specifies an external SAML 2.0 IdP as the front-end. When integrating with an external IdP, the IdP itself is configured as the identity source.
  • Option D is incorrect: SAML is for user authentication and authorization (single sign-on) with IAM Identity Center, not for automatically provisioning (syncing) user and group identities. SCIM is the correct protocol for provisioning.

QUESTION 65

A company has chosen AWS to host a new application. The company needs to implement a multi-account strategy. A DevOps engineer creates a new AWS account and an organization in AWS Organizations. The DevOps engineer also creates the OU structure for the organization and sets up a landing zone by using AWS Control Tower.

The DevOps engineer must implement a solution that automatically deploys resources for new accounts that users create through AWS Control Tower Account Factory. When a user creates a new account, the solution must apply AWS CloudFormation templates and SCPs that are customized for the OU or the account to automatically deploy all the resources that are attached to the account. All the OUS are enrolled in AWS Control Tower.

Which solution will meet these requirements in the MOST automated way?

  • A. Use AWS Service Catalog with AWS Control Tower. Create portfolios and products in AWS Service Catalog. Grant granular permissions to provision these resources. Deploy SCPs by using the AWS CLI and JSON documents.
  • B. Deploy CloudFormation stack sets by using the required templates. Enable automatic deployment. Deploy stack instances to the required accounts. Deploy a CloudFormation stack set to the organization's management account to deploy SCPs.
  • C. Create an Amazon EventBridge rule to detect the CreateManagedAccount event. Configure AWS Service Catalog as the target to deploy resources to any new accounts. Deploy SCPs by using the AWS CLI and JSON documents.
  • D. Deploy the Customizations for AWS Control Tower (CfCT) solution. Use an AWS CodeCommit repository as the source. In the repository, create a custom package that includes the CloudFormation templates and the SCP JSON documents.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Customizations for AWS Control Tower (CfCT) is purpose-built to deploy custom CloudFormation templates and SCPs to new and existing Control Tower accounts based on OU. It uses a CodeCommit repository, CodePipeline, and CloudFormation Stack Sets/Organizations API for integrated, automated deployment triggered by Control Tower lifecycle events.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS Service Catalog can provision resources, but doesn’t inherently trigger customized CloudFormation based on OU for new accounts. Deploying SCPs via AWS CLI is a manual/scripted process, not integrated into Control Tower’s automated provisioning.
  • Option B is incorrect: CloudFormation Stack Sets with automatic deployment can deploy resources to new accounts in OUs. However, deploying SCPs via a separate Stack Set to the management account is not the most integrated or common approach within a Control Tower environment, which typically manages SCPs via guardrails or CfCT.
  • Option C is incorrect: An EventBridge rule can detect new account events, providing a trigger. However, targeting AWS Service Catalog might not efficiently deploy customized CloudFormation based on OU. SCP deployment via AWS CLI is manual, not part of a fully automated Control Tower integration.

QUESTION 66

A company is using AWS Organizations to centrally manage its AWS account by using AWS CloudFormation StackSets. The company has configured trusted access in Organizations for AWS Config and has configured a member account as a delegated administrator account for AWS Config.

A DevOps engineer needs to implement a new security policy. The policy must require all current and future AWS member accounts to use a common baseline of AWS Contig rules that contain remediation actions that are managed from a central account. Non-administrator users who can access member accounts must not be able to modify this common baseline of AWS Config rules that are deployed into each member account.

Which solution will meet these requirements?

  • A. Create a CloudFormation template that contains the AWS Config rules and remediation actions. Deploy the template from the Organizations management account by using CloudFormation StackSets.
  • B. Create an AWS Config conformance pack that contains the AWS Config rules and remediation actions. Deploy the pack from the Organizations management account by using CloudFormation StackSets
  • C. Create a CloudFormation template that contains the AWS Config rules and remediation actions. Deploy the template from the delegated administrator account by using AWS Config.
  • D. Create an AWS Config conformance pack that contains the AWS Config rules and remediation actions. Deploy the pack from the delegated administrator account by using AWS Config.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: AWS Config conformance packs bundle rules and remediation actions, ensuring a common baseline. Deploying from the delegated administrator account using AWS Config is the native method for organizational conformance packs, providing central management and making the rules immutable by non-administrator users in member accounts.

❌ Why the other choices are incorrect:

  • Option A is incorrect: CloudFormation StackSets from the management account can deploy resources but doesn’t leverage the dedicated AWS Config delegated administrator feature. Individual CloudFormation Config rules lack the inherent immutability of an organizational conformance pack against modification by member account users.
  • Option B is incorrect: While a conformance pack is the right choice, deploying it via CloudFormation StackSets from the Organizations management account bypasses the specific organizational capabilities of AWS Config’s delegated administrator, which is designed for this central management and immutability.
  • Option C is incorrect: AWS Config is not a deployment mechanism for raw CloudFormation templates. Furthermore, CloudFormation templates for individual Config rules do not offer the same centrally managed, immutable baseline benefits as an organizational conformance pack.

QUESTION 67

A company wants to use a grid system for a proprietary enterprise in-memory data store on top of AWS. This system can run in multiple server nodes in any Linux-based distribution. The system must be able to reconfigure the entire cluster every time a node is added or removed. When adding or removing nodes, an / etc./cluster/nodes.config file must be updated, listing the IP addresses of the current node members of that cluster. The company wants to automate the task of adding new nodes to a cluster.

What can a DevOps Engineer do to meet these requirements?

  • A. Use AWS OpsWorks Stacks to layer the server nodes of that cluster. Create a Chef recipe that populates the content of the /etc/cluster/nodes.config file and restarts the service by using the current members of the layer. Assign that recipe to the Configure lifecycle event.
  • B. Put the file nodes.config in version control. Create an AWS CodeDeploy deployment configuration and deployment group based on an Amazon EC2 tag value for the cluster nodes. When adding a new node to the cluster, update the file with all tagged instances, and make a commit in version control. Deploy the new file and restart the services.
  • C. Create an Amazon S3 bucket and upload a version of the etc/cluster/nodes.config file. Create a crontab script that will poll for that S3 file and download it frequently. Use a process manager, such as Monit or systemd, to restart the cluster services when it detects that the new file was modified. When adding a node to the cluster, edit the file's most recent members. Upload the new file to the S3 bucket.
  • D. Create a user data script that lists all members of the current security group of the cluster and automatically updates the /etc/cluster/nodes.config file whenever a new instance is added to the cluster.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: AWS OpsWorks Stacks with Chef recipes automates infrastructure configuration. The "Configure" lifecycle event triggers on instance changes (add/remove), allowing Chef to dynamically populate /etc/cluster/nodes.config with current layer member IPs and restart the service across all nodes. This directly meets the automation and reconfiguration requirements.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Updating the nodes.config file in version control and committing changes is a manual step. CodeDeploy deploys existing files; it doesn’t dynamically generate the file content based on real-time cluster membership changes.
  • Option C is incorrect: Manually editing and uploading nodes.config to S3 every time a node is added/removed is not automated. Polling S3 with a crontab script is inefficient and reactive, not proactive or dynamic for cluster re-configuration.
  • Option D is incorrect: User data scripts run only once at instance launch. They do not trigger on existing instances when a new instance is added or removed from the cluster, nor do they inherently provide a mechanism for other nodes to react and update their configurations.

QUESTION 68

An online retail company based in the United States plans to expand its operations to Europe and Asia in the next six months. Its product currently runs on Amazon EC2 instances behind an Application Load Balancer. The instances run in an Amazon EC2 Auto Scaling group across multiple Availability Zones. All data is stored in an Amazon Aurora database instance.

When the product is deployed in multiple regions, the company wants a single product catalog across all regions, but for compliance purposes, its customer information and purchases must be kept in each region.

How should the company meet these requirements with the LEAST amount of application changes?

  • A. Use Amazon Redshift for the product catalog and Amazon DynamoDB tables for the customer information and purchases.
  • B. Use Amazon DynamoDB global tables for the product catalog and regional tables for the customer information and purchases
  • C. Use Aurora with read replicas for the product catalog and additional local Aurora instances in each region for the customer information and purchases.
  • D. Use Aurora for the product catalog and Amazon DynamoDB global tables for the customer information and purchases.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Aurora Global Database with cross-region read replicas effectively supports a single, consistent product catalog view globally with low-latency reads. Separate regional Aurora instances ensure customer data remains localized for compliance. This approach minimizes application changes as the existing application already uses Aurora.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Redshift is an analytical database, unsuitable for a transactional product catalog, requiring significant application changes. Introducing DynamoDB also means more changes.
  • Option B is incorrect: Migrating the product catalog and customer data from Aurora (relational) to DynamoDB (NoSQL) would require substantial application changes, not the "least amount."
  • Option D is incorrect: DynamoDB global tables replicate data across regions, violating the compliance requirement that customer information and purchases must be kept in each region.

QUESTION 69 (Multi-Select)

A DevOps Engineer is working on a project that is hosted on Amazon Linux and has failed a security review. The DevOps Manager has been asked to review the company buildspec.yaml file for an AWS CodeBuild project and provide recommendations. The buildspec.yaml file is configured as follows:

What changes should be recommended to comply with AWS security best practices? (Choose three.)

  • A. Add a post-build command to remove the temporary files from the container before termination to ensure they cannot be seen by other CodeBuild users.
  • B. Update the CodeBuild project role with the necessary permissions and then remove the AWS credentials from the environment variable.
  • C. Store the DB_PASSWORD as a SecureString value in AWS Systems Manager Parameter Store and then remove the DB_PASSWORD from the environment variables.
  • D. Move the environment variables to the ‘db-deploy-bucket’ Amazon S3 bucket, add a prebuild stage to download, then export the variables.
  • E. Use AWS Systems Manager run command versus scp and ssh commands directly to the instance.
  • F. Scramble the environment variables using XOR followed by Base64, add a section to install, and then run XOR and Base64 to the build phase.
Click to View Verified Solution & Explanation

Correct Option: A,B,C

Explanation: ✅ Option A (Correct)
Reasoning: Sensitive files like instance.key and my.cnf (containing the DB password) are downloaded to /tmp. Removing these in a post-build phase prevents potential exposure to subsequent builds or unauthorized access, aligning with the principle of least privilege and data hygiene.


✅ Option B (Correct)
Reasoning: Hardcoding AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY is a critical security vulnerability. CodeBuild projects should leverage an IAM service role with fine-grained permissions to interact with AWS services, eliminating the need for hardcoded credentials.


✅ Option C (Correct)
Reasoning: Hardcoding DB_PASSWORD in the buildspec is highly insecure. Storing it as a SecureString in AWS Systems Manager Parameter Store (or AWS Secrets Manager) and retrieving it at runtime is an AWS security best practice for managing sensitive application secrets.

❌ Why the other choices are incorrect:

  • Option D is incorrect: Storing sensitive environment variables in an S3 bucket, even if downloaded, is not a secure secret management practice. S3 itself is not designed for secret storage with the same level of security controls as Parameter Store or Secrets Manager.
  • Option E is incorrect: While using AWS Systems Manager Run Command instead of scp and ssh with a downloaded key is a strong security best practice, it’s a broader architectural change. The question focuses on buildspec.yaml recommendations, and A, B, C address more direct hardcoded secrets and temporary file cleanup within the existing buildspec context.
  • Option F is incorrect: Obfuscation methods like XOR and Base64 are not encryption. They can be easily reversed, offering no real security for sensitive environment variables like passwords or keys. True encryption or secure secret management services are required.

QUESTION 70

A company is implementing AWS CodePipeline to automate its testing process. The company wants to be notified when the execution state fails and used the following custom event pattern in Amazon EventBridge:

 

 

Which type of events will match this event pattern?

  • A. Failed deploy and build actions across all the pipelines.
  • B. All rejected or failed approval actions across all the pipelines.
  • C. All the events across all pipelines.
  • D. Approval actions across all the pipelines.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: The event pattern filters for aws.codepipeline events where an Approval action’s state changes to FAILED. In CodePipeline, an explicitly failed or rejected approval action both result in a FAILED state. The pattern applies to all pipelines as no specific ARN is provided.

❌ Why the other choices are incorrect:

  • Option A is incorrect: The event pattern explicitly filters for Approval category actions ("type": { "category": ["Approval"] }), not Deploy or Build actions.
  • Option C is incorrect: The pattern includes specific filters for source, detail-type, state, and type.category. It does not match all events; it matches a very specific subset.
  • Option D is incorrect: The pattern specifically requires the action state to be FAILED ("detail": { "state": ["FAILED"] }). It will not match successful or pending approval actions, only those that fail.

QUESTION 71

A business has an application that consists of five independent AWS Lambda functions. The DevOps Engineer has built a CI/CD pipeline using AWS CodePipeline and AWS CodeBuild that builds, tests, packages, and deploys each Lambda function in sequence. The pipeline uses an Amazon CloudWatch Events rule to ensure the pipeline execution starts as quickly as possible after a change is made to the application source code.

After working with the pipeline for a few months, the DevOps Engineer has noticed the pipeline takes too long to complete.

What should the DevOps Engineer implement to BEST improve the speed of the pipeline?

  • A. Modify the CodeBuild projects within the pipeline to use a compute type with more available network throughput.
  • B. Create a custom CodeBuild execution environment that includes a symmetric multiprocessing configuration to run the builds in parallel.
  • C. Modify the CodePipeline configuration to execute actions for each Lambda function in parallel by specifying the same runOrder.
  • D. Modify each CodeBuild project to run within a VPC and use dedicated instances to increase throughput.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: Modifying CodePipeline to use the same runOrder for independent Lambda function actions enables parallel execution. Since the functions are independent, running them concurrently dramatically reduces the total pipeline duration, directly addressing the "takes too long" issue. This is a native CodePipeline feature designed for such scenarios.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While higher network throughput might slightly speed up individual CodeBuild projects, it does not address the fundamental bottleneck of sequentially building and deploying five independent functions. The gain would be marginal compared to true parallelization.
  • Option B is incorrect: This option focuses on optimizing parallelism within a single CodeBuild project. Each Lambda likely has its own CodeBuild project. It doesn’t enable multiple Lambda functions’ build/deploy actions to run in parallel across the pipeline, which is the primary inefficiency.
  • Option D is incorrect: Running CodeBuild in a VPC primarily enables access to private network resources, not inherently to increase build throughput or speed. "Dedicated instances" is not a standard CodeBuild compute type option and would add complexity without solving the sequential execution problem of independent components.

QUESTION 72 (Multi-Select)

An Amazon EC2 instance with no internet access is running in a Virtual Private Cloud (VPC) and needs to download an object from a restricted Amazon S3 bucket. When the DevOps Engineer tries to gain access to the object, an AccessDenied error is received.

What are the possible causes for this error? (Choose three.)

  • A. The S3 bucket default encryption is enabled.
  • B. There is an error in the S3 bucket policy.
  • C. There is an error in the VPC endpoint policy.
  • D. The object has been moved to Amazon Glacier.
  • E. There is an error in the IAM role configuration.
  • F. S3 versioning is enabled
Click to View Verified Solution & Explanation

Correct Option: B,C,E

Explanation: ✅ Option B (Correct)
Reasoning: An S3 bucket policy explicitly defines who can access objects within the bucket. If the policy is configured incorrectly, it can deny access to the IAM principal used by the EC2 instance, leading to an AccessDenied error.


✅ Option C (Correct)
Reasoning: Since the EC2 instance has no internet access, it uses a VPC endpoint for S3. The VPC endpoint policy can restrict actions (like s3:GetObject) or principals, independently causing an AccessDenied error even if other policies permit access.


✅ Option E (Correct)
Reasoning: The IAM role attached to the EC2 instance must have s3:GetObject permissions for the specific S3 bucket and object. If the IAM role’s policy is missing these necessary permissions, an AccessDenied error will occur.

❌ Why the other choices are incorrect:

  • Option A is incorrect: S3 default encryption (e.g., SSE-S3) enables encryption but doesn’t inherently cause an "AccessDenied" error for GetObject unless there are specific KMS key policy issues when using SSE-KMS, which is a different class of error.
  • Option D is incorrect: If an object is moved to Amazon Glacier, attempting to retrieve it before restoration would result in an InvalidObjectState error, not AccessDenied.
  • Option F is incorrect: S3 versioning tracks object changes but does not, by itself, cause an "AccessDenied" error for a valid GetObject request.

QUESTION 73

A large enterprise is deploying a web application on AWS. The application runs on Amazon EC2 instances behind an Application Load Balancer. The instances run in an Auto Scaling group across multiple Availability Zones. The application stores data in an Amazon RDS Oracle DB instance and Amazon DynamoDB. There are separate environments for development, testing, and production.

What is the MOST secure and flexible way to obtain password credentials during deployment?

  • A. Retrieve an access key from an AWS Systems Manager SecureString parameter to access AWS services. Retrieve the database credentials from a Systems Manager SecureString parameter.
  • B. Launch the EC2 instances with an EC2 IAM role to access AWS services. Retrieve the database credentials from AWS Secrets Manager.
  • C. Retrieve an access key from an AWS Systems Manager plaintext parameter to access AWS services. Retrieve the database credentials from a Systems Manager SecureString parameter.
  • D. Launch the EC2 instances with an EC2 IAM role to access AWS services. Store the database passwords in an encrypted config file with the application artifacts.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Launching EC2 instances with an IAM role is the most secure way to grant them permissions to AWS services, eliminating the need for static credentials. AWS Secrets Manager is the recommended and most flexible service for storing, managing, and automatically rotating database credentials, ensuring secure access and adherence to best practices.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Using access keys, even in SecureString, for EC2 instances is less secure and flexible than IAM roles, which provide temporary credentials. While SecureString can store secrets, AWS Secrets Manager offers superior features for database credential lifecycle management, including automatic rotation.
  • Option C is incorrect: Storing access keys in a plaintext Systems Manager parameter is a severe security vulnerability, as it exposes sensitive credentials. Even with SecureString for database credentials, this approach fails on the fundamental security requirement for AWS service access.
  • Option D is incorrect: Although IAM roles are correct for AWS service access, storing database passwords in encrypted config files within application artifacts is less secure and flexible than using a dedicated secrets management service. It complicates credential rotation, auditing, and granular access control compared to AWS Secrets Manager.

QUESTION 74

The Security team depends on AWS CloudTrail to detect sensitive security issues in the company’s AWS account. The DevOps Engineer needs a solution to auto-remediate CloudTrail being turned off in an AWS account.

What solution ensures the LEAST amount of downtime for the CloudTrail log deliveries?

  • A. Create an Amazon CloudWatch Events rule for the CloudTrail StopLogging event. Create an AWS Lambda function that uses the AWS SDK to call StartLogging on the ARN of the resource in which StopLogging was called. Add the Lambda function ARN as a target to the CloudWatch Events rule.
  • B. Deploy the AWS-managed CloudTrail-enabled AWS Config rule, set with a periodic interval of 1 hour. Create an Amazon CloudWatch Events rule for AWS Config rules compliance change. Create an AWS Lambda function that uses the AWS SDK to call StartLogging on the ARN of the resource in which StopLogging was called. Add the Lambda function ARN as a target to the CloudWatch Events rule.
  • C. Create an Amazon CloudWatch Events rule for a scheduled event every 5 minutes. Create an AWS Lambda function that uses the AWS SDK to call StartLogging on a CloudTrail trail in the AWS account. Add the Lambda function ARN as a target to the CloudWatch Events rule.
  • D. Launch a t2.nano instance with a script running every 5 minutes that uses the AWS SDK to query CloudTrail in the current account. If the CloudTrail trail is disabled, have the script re-enable the trail.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: This solution uses CloudWatch Events to react immediately to the StopLogging event emitted by CloudTrail. Triggering a Lambda function directly from this event allows for near real-time remediation by calling StartLogging, minimizing downtime for log deliveries.

❌ Why the other choices are incorrect:

  • Option B is incorrect: This method relies on AWS Config’s periodic evaluation (up to 1 hour). This introduces significant delay for detection and remediation, resulting in much higher downtime compared to an event-driven approach.
  • Option C is incorrect: A scheduled event every 5 minutes means CloudTrail could be off for up to 5 minutes before the Lambda function even attempts to check or re-enable it, leading to increased downtime.
  • Option D is incorrect: Launching an EC2 instance with a script polling every 5 minutes introduces operational overhead and a similar 5-minute detection delay as Option C, resulting in more downtime and less efficient operation.

QUESTION 75

A company is testing a web application that runs on Amazon EC2 instances behind an Application Load Balancer. The instances run in an Auto Scaling group across multiple Availability Zones. The company uses a blue/green deployment process with immutable instances when deploying new software.

During testing, users are being automatically logged out of the application at random times. Testers also report that, when a new version of the application is deployed, all users are logged out. The Development team needs a solution to ensure users remain logged in across scaling events and application deployments.

What is the MOST efficient way to ensure users remain logged in?

  • A. Enable smart sessions on the load balancer and modify the application to check for an existing session.
  • B. Enable session sharing on the load balancer and modify the application to read from the session store.
  • C. Store user session information in an Amazon S3 bucket and modify the application to read session information from the bucket.
  • D. Modify the application to store user session information in an Amazon ElastiCache cluster.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Storing user session information in an Amazon ElastiCache cluster (Redis or Memcached) externalizes session state from the EC2 instances. This ensures sessions persist independently of individual instance lifecycles, allowing users to remain logged in across scaling events and immutable application deployments, resolving both reported issues efficiently.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Load balancer sticky sessions (not "smart sessions") bind users to specific instances. This approach fails when those instances are replaced during scaling or immutable blue/green deployments, as the session tied to the old instance is lost.
  • Option B is incorrect: Application Load Balancers do not provide native "session sharing" or a centralized session store that applications can read from directly. Its sticky session feature is instance-based, not shared state.
  • Option C is incorrect: Amazon S3 is object storage, designed for durability, not for high-performance, low-latency, transactional session data management. Using S3 for sessions would be inefficient, slow, and unsuitable for web application session persistence.

QUESTION 76

A DevOps Engineer manages a large commercial website that runs on Amazon EC2. The website uses Amazon Kinesis Data Streams to collect and process web logs. The DevOps Engineer manages the Kinesis consumer application, which also runs on Amazon EC2.

Sudden increases of data cause the Kinesis consumer application to fall behind, and the streams drop records before they can be processed. The DevOps engineer must implement a solution to improve stream handling.

What is the FASTEST method to improve stream handling?

  • A. Modify the Kinesis consumer application to store the logs durably in Amazon S3. Use Amazon EMR to process the data directly on S3 to derive customer insights and store the results in S3.
  • B. Horizontally scale the Kinesis consumer application by adding more EC2 instances based on the GetRecord.IteratorAgeMilliseconds Amazon CloudWatch metric. Increase the Kinesis Data Streams retention period.
  • C. Convert the Kinesis consumer application to run as an AWS Lambda function. Configure the Kinesis Data Streams as the event source for the Lambda function to process the data streams.
  • D. Increase the number of shards in the Kinesis Data Streams to increase the overall throughput so that the consumer processes data faster.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Horizontally scaling the consumer EC2 instances based on GetRecord.IteratorAgeMilliseconds directly addresses the processing bottleneck. This metric indicates how far behind the consumer is. Increasing Kinesis retention period prevents data loss while the consumer scales up or during temporary spikes, ensuring no records are dropped. This approach quickly scales the existing consumer capacity.

❌ Why the other choices are incorrect:

  • Option A is incorrect: This is a major architectural change involving S3 and EMR. It’s a significant development effort, not the fastest method to improve an existing consumer’s stream handling. It doesn’t solve the immediate problem of the current consumer falling behind.
  • Option C is incorrect: Migrating an existing EC2 application to AWS Lambda requires re-architecting and code changes, which is time-consuming. While Lambda offers scaling benefits, it’s not the fastest immediate fix for the current EC2-based consumer issue.
  • Option D is incorrect: Increasing Kinesis shards boosts stream capacity but doesn’t automatically solve a consumer application bottleneck. If the consumer itself isn’t scaled or re-architected to process data from more shards, it will still fall behind. The problem is with the consumer’s processing capacity, not the stream’s.

QUESTION 77

A company is using an AWS CodeBuild project to build and package an application. The packages are copied to a shared Amazon S3 bucket before being deployed across multiple AWS accounts.

The buildspec.yml file contains the following:

The DevOps Engineer has noticed that anybody with an AWS account is able to download the artifacts.

What steps should the DevOps Engineer take to stop this?

  • A. Modify the post_build to command to use –-acl public-read and configure a bucket policy that grants read access to the relevant AWS accounts only.
  • B. Configure a default ACL for the S3 bucket that defines the set of authenticated users as the relevant AWS accounts only and grants read-only access.
  • C. Create an S3 bucket policy that grants read access to the relevant AWS accounts and denies read access to the principal “*”
  • D. Modify the post_build command to remove –-acl authenticated-read and configure a bucket policy that allows read access to the relevant AWS accounts only.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: The --acl authenticated-read flag grants read access to any authenticated AWS user. Removing this flag makes objects private. A bucket policy then precisely grants read access only to specified AWS accounts, achieving the desired restriction.

❌ Why the other choices are incorrect:

  • Option A is incorrect: --acl public-read would make the artifacts accessible to everyone on the internet, worsening the security issue.
  • Option B is incorrect: The "authenticated users" group in S3 refers to any AWS account and cannot be redefined to include only specific relevant accounts.
  • Option C is incorrect: While a bucket policy is good, an explicit Deny for * could block everyone. Crucially, object ACLs like authenticated-read often take precedence or require specific Deny statements to override, making removing the problematic object ACL (as in D) the more direct solution.

QUESTION 78

A company has developed an AWS Lambda function that handles orders received through an API. The company is using AWS CodeDeploy to deploy the Lambda function as the final stage of a CI/CD pipeline.

A DevOps Engineer has noticed there are intermittent failures of the ordering API for a few seconds after deployment. After some investigation, the DevOps Engineer believes the failures are due to database changes not having fully propagated before the Lambda function begins executing.

How should the DevOps Engineer overcome this?

  • A. Add a BeforeAllowTraffic hook to the AppSpec file that tests and waits for any necessary database changes before traffic can flow to the new version of the Lambda function.
  • B. Add an AfterAllowTraffic hook to the AppSpec file that forces traffic to wait for any pending database changes before allowing the new version of the Lambda function to respond.
  • C. Add a BeforeInstall hook to the AppSpec file that tests and waits for any necessary database changes before deploying the new version of the Lambda function.
  • D. Add a ValidateService hook to the AppSpec file that inspects incoming traffic and rejects the payload if dependent services, such as the database, are not yet ready.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: The BeforeAllowTraffic hook executes after the new Lambda version is deployed but before traffic starts shifting to it. This is the ideal stage to perform health checks, such as verifying database propagation, ensuring the new function is fully ready before receiving live requests and preventing intermittent failures.

❌ Why the other choices are incorrect:

  • Option B is incorrect: The AfterAllowTraffic hook runs after traffic has already been shifted to the new Lambda version. By this point, the intermittent failures would have already occurred, failing to prevent the issue as described.
  • Option C is incorrect: The BeforeInstall hook runs before the new Lambda function version is created and deployed. Waiting for database changes at this stage is too early; the problem arises after deployment when traffic shifts before database readiness.
  • Option D is incorrect: The ValidateService hook inspects traffic after it has already been routed to the new function. Rejecting payloads means failures are still occurring, not prevented, which contradicts the goal of avoiding intermittent failures after deployment.

QUESTION 79

A company uses Amazon S3 to store proprietary information. The Development team creates buckets for new projects on a daily basis. The Security team wants to ensure that all existing and future buckets have encryption, logging, and versioning enabled. Additionally, no buckets should ever be publicly read or write accessible.

What should a DevOps Engineer do to meet these requirements?

  • A. Enable AWS CloudTrail and configure automatic remediation using AWS Lambda.
  • B. Enable AWS Config rules and configure automatic remediation using AWS Systems Manager documents.
  • C. Enable AWS Trusted Advisor and configure automatic remediation using Amazon CloudWatch Events.
  • D. Enable AWS Systems Manager and configure automatic remediation using Systems Manager documents.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: AWS Config continuously evaluates S3 bucket compliance against defined rules (encryption, logging, versioning, public access). If non-compliance is detected, Config can automatically trigger AWS Systems Manager Automation documents for remediation, ensuring all requirements are met for existing and future buckets.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS CloudTrail logs API calls for auditing but doesn’t continuously evaluate resource configurations for compliance. While Lambda can remediate, CloudTrail doesn’t provide the required compliance detection for bucket properties.
  • Option C is incorrect: AWS Trusted Advisor provides recommendations but lacks continuous, comprehensive compliance evaluation for all specified S3 bucket properties. CloudWatch Events can trigger actions but needs a source like Config for compliance detection.
  • Option D is incorrect: AWS Systems Manager (Automation) can execute remediation actions, but it does not inherently detect non-compliant configurations for S3 buckets. AWS Config is essential for the continuous compliance evaluation aspect.

QUESTION 80

A highly regulated company has a policy that DevOps Engineers should not log in to their Amazon EC2 instances except in emergencies. If a DevOps Engineer does log in, the Security team must be notified within 15 minutes of the occurrence.

Which solution will meet these requirements?

  • A. Install the Amazon Inspector agent on each EC2 instance. Subscribe to Amazon CloudWatch Events notifications. Trigger an AWS Lambda function to check if a message is about user logins. If it is, send a notification to the Security team using Amazon SNS.
  • B. Install the Amazon CloudWatch agent on each EC2 instance. Configure the agent to push all logs to Amazon CloudWatch Logs and set up a CloudWatch metric filter that searches for user logins. If a login is found, send a notification to the Security team using Amazon SNS.
  • C. Set up AWS CloudTrail with Amazon CloudWatch Logs. Subscribe CloudWatch Logs to Amazon Kinesis. Attach AWS Lambda to Kinesis to parse and determine if a log contains a user login. If it does, send a notification to the Security team using Amazon SNS.
  • D. Set up a script on each Amazon EC2 instance to push all logs to Amazon S3. Set up an S3 event to trigger an AWS Lambda function, which triggers an Amazon Athena query to run. The Athena query checks for logins and sends the output to the Security team using Amazon SNS.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: The Amazon CloudWatch agent efficiently collects system logs, including login events, and pushes them to CloudWatch Logs. A CloudWatch metric filter can then parse these logs in near real-time to detect logins, triggering an immediate Amazon SNS notification to the Security team, fulfilling the 15-minute requirement.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Amazon Inspector is for vulnerability management and compliance, not real-time monitoring of user logins on EC2 instances. It wouldn’t capture the necessary login events.
  • Option C is incorrect: AWS CloudTrail records AWS API calls, not internal operating system logins (e.g., SSH, RDP) directly on EC2 instances. It would not detect user logins into the OS.
  • Option D is incorrect: Relying on a script to push logs to S3 and then using Amazon Athena for querying introduces significant latency and complexity. This approach is unlikely to guarantee notification within the critical 15-minute timeframe.

QUESTION 81

An application runs on Amazon EC2 instances behind an Application Load Balancer (ALB). A DevOps Engineer is using AWS CodeDeploy to release a new version. The deployment fails during the AllowTraffic lifecycle event, but a cause for the failure is not indicated in the deployment logs.

 

What would cause this?

  • A. The appspec.yml file contains an invalid script to execute in the AllowTraffic lifecycle hook.
  • B. The user who initiated the deployment does not have the necessary permissions to interact with the ALB.
  • C. The health checks specified for the ALB target group are misconfigured.
  • D. The CodeDeploy agent was not installed in the EC2 instances that are part of the ALB target group.Correct Answer: CExplanation/
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: During the AllowTraffic event, CodeDeploy monitors the health of the newly deployed instances via the ALB target group’s health checks. If these health checks are misconfigured or fail, CodeDeploy will not shift traffic, leading to a deployment failure. This specific failure reason might not be explicitly detailed in CodeDeploy’s high-level logs, making it seem "not indicated."

❌ Why the other choices are incorrect:

  • Option A is incorrect: The AllowTraffic lifecycle event primarily handles the traffic shift by CodeDeploy, not custom scripts from appspec.yml. Custom scripts run in hooks like BeforeAllowTraffic or AfterAllowTraffic, and their failures would be explicitly logged.
  • Option B is incorrect: CodeDeploy uses its assigned service role’s permissions, not the initiating user’s. If the service role lacked ALB permissions, the failure would occur earlier and be explicitly logged as an access denied error.
  • Option D is incorrect: If the CodeDeploy agent were missing, deployment would fail during earlier stages (e.g., Install, ApplicationStart) because scripts couldn’t execute and report status, long before the AllowTraffic event.

QUESTION 82

A DevOps Engineer is architecting a continuous development strategy for a company’s software as a service (SaaS) web application running on AWS. For application and security reasons, users subscribing to this application are distributed across multiple Application Load Balancers (ALBs), each of which has a dedicated Auto Scaling group and fleet of Amazon EC2 instances. The application does not require a build stage, and when it is committed to AWS CodeCommit, the application must trigger a simultaneous deployment to all ALBs, Auto Scaling groups, and EC2 fleets.

Which architecture will meet these requirements with the LEAST amount of configuration?

  • A. Create a single AWS CodePipeline pipeline that deploys the application in parallel using unique AWS CodeDeploy applications and deployment groups created for each ALB-Auto Scaling group pair.
  • B. Create a single AWS CodePipeline pipeline that deploys the application using a single AWS CodeDeploy application and single deployment group.
  • C. Create a single AWS CodePipeline pipeline that deploys the application in parallel using a single AWS CodeDeploy application and unique deployment group for each ALB-Auto Scaling group pair.
  • D. Create an AWS CodePipeline pipeline for each ALB-Auto Scaling group pair that deploys the application using an AWS CodeDeploy application and deployment group created for the same ALB-Auto Scaling group pair.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: This architecture utilizes a single CodePipeline and CodeDeploy application, minimizing configuration. It creates unique CodeDeploy deployment groups for each ALB-Auto Scaling group pair, enabling parallel, simultaneous deployments to all target environments as required, balancing efficiency and necessary specificity.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Creating unique AWS CodeDeploy applications for each ALB-Auto Scaling group pair introduces unnecessary configuration overhead. A single CodeDeploy application can effectively manage multiple deployment groups.
  • Option B is incorrect: A single deployment group can only target one Auto Scaling group. The requirement specifies deploying to multiple ALBs and Auto Scaling groups simultaneously, which this option fails to achieve.
  • Option D is incorrect: Creating an AWS CodePipeline pipeline for each ALB-Auto Scaling group pair significantly increases management and configuration complexity, directly violating the "least amount of configuration" requirement.

QUESTION 83

A company is running an application on Amazon EC2 instances in an Auto Scaling group. Recently, an issue occurred that prevented EC2 instances from launching successfully, and it took several hours for the Support team to discover the issue. The Support team wants to be notified by email whenever an EC2 instance does not start successfully.

Which action will accomplish this?

  • A. Add a health check to the Auto Scaling group to invoke an AWS Lambda function whenever an instance status is impaired.
  • B. Configure the Auto Scaling group to send a notification to an Amazon SNS topic whenever a failed instance launch occurs.
  • C. Create an Amazon CloudWatch alarm that invokes an AWS Lambda function when a failed AttachInstances Auto Scaling API call is made.
  • D. Create a status check alarm on Amazon EC2 to send a notification to an Amazon SNS topic whenever a status check fail occurs.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Auto Scaling groups can publish notifications for lifecycle events, including EC2_INSTANCE_LAUNCH_ERROR, to an Amazon SNS topic. SNS can then deliver these notifications as emails to subscribed support teams, directly addressing the requirement for email alerts on failed instance launches.

❌ Why the other choices are incorrect:

  • Option A is incorrect: ASG health checks evaluate instances after they have launched and joined the group. They would not detect an issue preventing an instance from launching successfully in the first place.
  • Option C is incorrect: The AttachInstances API call is used to attach existing instances to an Auto Scaling group, not to launch new ones. The problem is failed instance launches.
  • Option D is incorrect: EC2 status checks (system or instance) occur on instances that have started. The problem describes instances not launching successfully, meaning they wouldn’t even reach a state for status checks to run.

QUESTION 84 (Multi-Select)

A development team manually builds an artifact locally and then places it in an Amazon S3 bucket. The application has a local cache that must be cleared when a deployment occurs. The team executes a command to do this, downloads the artifact from Amazon S3, and unzips the artifact to complete the deployment.

A DevOps team wants to migrate to a CI/CD process and build in checks to stop and roll back the deployment when a failure occurs. This requires the team to track the progression of the deployment.

Which combination of actions will accomplish this? (Choose three.)

  • A. Allow developers to check the code into a code repository. Using Amazon CloudWatch Events, on every pull into master, trigger an AWS Lambda function to build the artifact and store it in Amazon S3.
  • B. Create a custom script to clear the cache. Specify the script in the BeforeInstall lifecycle hook in the AppSpec file.
  • C. Create user data for each Amazon EC2 instance that contains the clear cache script. Once deployed, test the application. If it is not successful, deploy it again.
  • D. Set up AWS CodePipeline to deploy the application. Allow developers to check the code into a code repository as a source for the pipeline.
  • E. Use AWS CodeBuild to build the artifact and place it in Amazon S3. Use AWS CodeDeploy to deploy the artifact to Amazon EC2 instances.
  • F. Use AWS Systems Manager to fetch the artifact from Amazon S3 and deploy it to all the instances.
Click to View Verified Solution & Explanation

Correct Option: B,D,E

Explanation: ✅ Option B (Correct)
Reasoning: AWS CodeDeploy uses an AppSpec file to define deployment actions. Lifecycle hooks, like BeforeInstall, are the standard way to automate custom scripts such as clearing a local cache at specific deployment stages, directly addressing the manual cache clearing mentioned.


✅ Option D (Correct)
Reasoning: AWS CodePipeline is the core orchestration service for establishing an end-to-end CI/CD process. It integrates source control, build, test, and deployment stages, enabling tracking of deployment progression and fulfilling the requirement for CI/CD migration.


✅ Option E (Correct)
Reasoning: AWS CodeBuild automates the process of compiling code and creating artifacts, replacing the manual local build. AWS CodeDeploy then automates the deployment of these artifacts to instances, handling download, unzipping, and managing the overall deployment lifecycle, including rollback capabilities.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While code repositories are essential, using CloudWatch Events to trigger Lambda for building artifacts is not the robust, scalable CI/CD practice. AWS CodeBuild is purpose-built for artifact creation, providing better integration and features for build processes.
  • Option C is incorrect: User data executes once at instance launch, not during every application deployment to clear cache on existing instances. Redeploying for failure detection isn’t a proper rollback mechanism; CodeDeploy offers automated rollbacks.
  • Option F is incorrect: AWS Systems Manager (e.g., Run Command) can execute commands but lacks the comprehensive CI/CD pipeline orchestration, deployment tracking, lifecycle hooks, and automated rollback features that AWS CodeDeploy provides, which are crucial for the desired outcome.

QUESTION 85

A company wants to ensure that their EC2 instances are secure. They want to be notified if any new vulnerabilities are discovered on their instances, and they also want an audit trail of all login activities on the instances.

Which solution will meet these requirements?

  • A. Use AWS Systems Manager to detect vulnerabilities on the EC2 instances. Install the Amazon Kinesis Agent to capture system logs and deliver them to Amazon S3.
  • B. Use AWS Systems Manager to detect vulnerabilities on the EC2 instances. Install the Systems Manager Agent to capture system logs and view login activity in the CloudTrail console.
  • C. Configure Amazon CloudWatch to detect vulnerabilities on the EC2 instances. Install the AWS Config daemon to capture system logs and view them in the AWS Config console.
  • D. Configure Amazon Inspector to detect vulnerabilities on the EC2 instances. Install the Amazon CloudWatch Agent to capture system logs and record them via Amazon CloudWatch Logs.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Amazon Inspector is purpose-built for detecting vulnerabilities on EC2 instances, directly addressing the first requirement. The Amazon CloudWatch Agent captures system logs, including login activities, which are then recorded in CloudWatch Logs, providing the required audit trail.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS Systems Manager is not primarily a vulnerability detection service. While Kinesis Agent captures logs, CloudWatch Logs is more suitable for centralized logging and auditing of system events like login activities.
  • Option B is incorrect: AWS Systems Manager does not primarily detect vulnerabilities. CloudTrail logs AWS API calls, not direct OS-level login activities on the EC2 instance.
  • Option C is incorrect: Amazon CloudWatch is a monitoring service, not a vulnerability detection service. AWS Config monitors resource configuration changes, not system logs or login activities within the EC2 instance.

QUESTION 86 (Multi-Select)

A company updated the AWS CloudFormation template for a critical business application. The stack update process failed due to an error in the updated template, and CloudFormation automatically began the stack rollback process. Later, a DevOps engineer found the application was still unavailable, and that the stack was in the UPDATE_ROLLBACK_FAILED state.

Which combination of actions will allow the stack rollback to complete successfully? (Choose two.)

  • A. Attach the AWSCloudFormationFullAccess IAM policy to the AWS CloudFormation role.
  • B. Automatically heal the stack resources using AWS CloudFormation drift detection.
  • C. Issue a ContinueUpdateRollback command from the AWS CloudFormation console or AWS CLI.
  • D. Manually adjust the resources to match the expectations of the stack.
  • E. Update the existing AWS CloudFormation stack using the original template.
Click to View Verified Solution & Explanation

Correct Option: C,D

Explanation: ✅ Option C (Correct)
Reasoning: When a stack is in UPDATE_ROLLBACK_FAILED, CloudFormation is stuck. The ContinueUpdateRollback command is specifically designed to resume a failed rollback after you have manually resolved any underlying issues preventing its completion.


✅ Option D (Correct)
Reasoning: A rollback often fails because a resource’s state prevents CloudFormation from reverting it (e.g., an external dependency, or a manual change). Manually adjusting the resources to align with the expected state for the rollback allows CloudFormation to proceed successfully when ContinueUpdateRollback is issued.

❌ Why the other choices are incorrect:

  • Option A is incorrect: The problem describes a template error and rollback failure, not a permissions issue with the CloudFormation service role. Attaching a broad policy like AWSCloudFormationFullAccess is unlikely to resolve the specific rollback failure.
  • Option B is incorrect: CloudFormation drift detection identifies configuration differences but does not automatically "heal" or revert resources. It’s a detection tool, not a remediation mechanism for failed rollbacks.
  • Option E is incorrect: You cannot initiate a new stack update, even with the original template, when the stack is in an UPDATE_ROLLBACK_FAILED state. The priority is to recover the stack from its current failed state first.

QUESTION 87

An application running on a set of Amazon EC2 instances in an Auto Scaling group requires a configuration file to operate. The instances are created and maintained with AWS CloudFormation. A DevOps engineer wants the instances to have the latest configuration file when launched, and wants changes to the configuration file to be reflected on all the instances with a minimal delay when the CloudFormation template is updated. Company policy requires that application configuration files be maintained along with AWS infrastructure configuration files in source control.

Which solution will accomplish this?

  • A. In the CloudFormation template, add an AWS Config rule. Place the configuration file content in the rule’s InputParameters property, and set the Scope property to the EC2 Auto Scaling group. Add an AWS Systems Manager Resource Data Sync resource to the template to poll for updates to the configuration.
  • B. In the CloudFormation template, add an EC2 launch template resource. Place the configuration file content in the launch template. Configure the cfn-init script to run when the instance is launched, and configure the cfn-hup script to poll for updates to the configuration.
  • C. In the CloudFormation template, add an EC2 launch template resource. Place the configuration file content in the launch template. Add an AWS Systems Manager Resource Data Sync resource to the template to poll for updates to the configuration.
  • D. In the CloudFormation template, add Cloud Formation init metadata. Place the configuration file content in the metadata. Configure the cfn-init script to run when the instance is launched, and configure the cfn-hup script to poll for updates to the configuration.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: CloudFormation init metadata, processed by cfn-init on launch, embeds the configuration directly in the template, satisfying source control. cfn-hup daemon then polls CloudFormation for stack updates, triggering cfn-init to apply new configuration files to running instances with minimal delay.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS Config rules are for compliance evaluation, not for distributing application configuration files to instances. AWS Systems Manager Resource Data Sync aggregates inventory, it does not push configurations.
  • Option B is incorrect: While EC2 launch templates can pass data via UserData, AWS::CloudFormation::Init metadata offers a more structured and robust way to manage configuration files directly within the CloudFormation template, which cfn-init and cfn-hup are designed to leverage.
  • Option C is incorrect: AWS Systems Manager Resource Data Sync is used to aggregate inventory data from instances, not to distribute or update application configuration files on them.

QUESTION 88

A DevOps engineer used an AWS CloudFormation custom resource to set up AD Connector. The AWS Lambda function executed and created AD Connector, but CloudFormation is not transitioning from CREATE_IN_PROGRESS to CREATE_COMPLETE.

Which action should the engineer take to resolve this issue?

  • A. Ensure the Lambda function code has exited successfully.
  • B. Ensure the Lambda function code returns a response to the pre-signed URL.
  • C. Ensure the Lambda function IAM role has cloudformation:UpdateStack permissions for the stack ARN.
  • D. Ensure the Lambda function IAM role has ds:ConnectDirectory permissions for the AWS account.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: When a CloudFormation custom resource Lambda successfully creates a resource, it must send a response to the pre-signed S3 URL provided in the event. This signal allows CloudFormation to transition the resource’s state to CREATE_COMPLETE. Without this response, CloudFormation indefinitely waits, causing the stack to remain in CREATE_IN_PROGRESS.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While the Lambda needs to exit successfully, the problem states AD Connector was created, implying the primary function logic completed. The specific issue is not sending the CloudFormation response, which is a separate step from merely exiting the function.
  • Option C is incorrect: The Lambda function’s IAM role for a custom resource does not require cloudformation:UpdateStack permissions. CloudFormation processes the stack state based on the response it receives from the Lambda via the pre-signed S3 URL, not by the Lambda directly updating the stack.
  • Option D is incorrect: The problem statement explicitly says AD Connector was created. This indicates that the Lambda function already possessed the necessary ds:ConnectDirectory permissions to perform the action successfully. Lack of these permissions would have prevented creation entirely.

QUESTION 89

A company has an application that is using a MySQL-compatible Amazon Aurora Multi-AZ DB cluster as the database. A cross-Region read replica has been created for disaster recovery purposes. A DevOps engineer wants to automate the promotion of the replica so it becomes the primary database instance in the event of a failure.

Which solution will accomplish this?

  • A. Configure a latency-based Amazon Route 53 CNAME with health checks so it points to both the primary and replica endpoints. Subscribe an Amazon SNS topic to Amazon RDS failure notifications from AWS CloudTrail and use that topic to trigger an AWS Lambda function that will promote the replica instance as the master.
  • B. Create an Aurora custom endpoint to point to the primary database instance. Configure the application to use this endpoint. Configure AWS CloudTrail to run an AWS Lambda function to promote the replica instance and modify the custom endpoint to point to the newly promoted instance.
  • C. Create an AWS Lambda function to modify the application’s AWS Cloud Formation template to promote the replica, apply the template to update the stack, and point the application to the newly promoted instance. Create an Amazon CloudWatch alarm to trigger this Lambda function after the failure event occurs.
  • D. Store the Aurora endpoint in AWS Systems Manager Parameter Store. Create an Amazon EventBridge (Amazon CloudWatch Events) event that defects the database failure and runs an AWS Lambda function to promote the replica instance and update the endpoint URL stored in AWS Systems Manager Parameter Store. Code the application to reload the endpoint from Parameter Store if a database connection fails.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: This solution effectively automates failover. EventBridge reliably detects database failures, triggering a Lambda function to promote the cross-Region replica. Storing the active endpoint in Systems Manager Parameter Store and having the application reload it on connection failure allows for dynamic endpoint discovery, crucial for quick recovery without DNS propagation delays in a cross-Region scenario.

❌ Why the other choices are incorrect:

  • Option A is incorrect: Route 53 latency-based routing combined with health checks isn’t ideal for determining the writeable primary after a cross-Region promotion, as DNS propagation takes time. CloudTrail monitors API calls, not all RDS failure events, and doesn’t inherently update DNS for a newly promoted, cross-Region primary endpoint.
  • Option B is incorrect: Aurora custom endpoints are typically for reader instances or specific read workloads, not for dynamically switching the cluster’s primary writer endpoint across regions post-promotion. Modifying the custom endpoint in this way is not standard practice for a writer failover.
  • Option C is incorrect: Programmatically modifying CloudFormation templates during a disaster recovery event is an anti-pattern. It’s complex, slow, and prone to errors, making it unsuitable for a rapid failover mechanism. CloudFormation is for infrastructure definition, not runtime operational changes like this.

QUESTION 90 (Multi-Select)

A DevOps engineer is deploying a new version of a company’s application in an AWS CodeDeploy deployment group associated with its Amazon EC2 instances. After some time, the deployment fails. The engineer realizes that all the events associated with the specific deployment ID are in a Skipped status, and code was not deployed in the instances associated with the deployment group.

What are valid reasons for this failure? (Choose two.)

  • A. The networking configuration does not allow the EC2 instances to reach the internet via a NAT gateway or internet gateway, and the CodeDeploy endpoint cannot be reached.
  • B. The IAM user who triggered the application deployment does not have permission to interact with the CodeDeploy endpoint.
  • C. The target EC2 instances were not properly registered with the CodeDeploy endpoint.
  • D. An instance profile with proper permissions was not attached to the target EC2 instances.
  • E. The appspec.yml file was not included in the application revision.
Click to View Verified Solution & Explanation

Correct Option: A,D

Explanation: ✅ Option A (Correct)
Reasoning: CodeDeploy agents on EC2 instances must communicate with the CodeDeploy service endpoint. If networking (via NAT/Internet Gateway) is misconfigured, agents cannot receive deployment instructions or report status, leading to "Skipped" events as the service cannot initiate deployment actions.


✅ Option D (Correct)
Reasoning: The CodeDeploy agent running on an EC2 instance requires an instance profile with specific IAM permissions to interact with the CodeDeploy service and S3. Without proper permissions, the agent cannot poll for deployments or download application revisions, causing the service to report "Skipped" status.

❌ Why the other choices are incorrect:

  • Option B is incorrect: An IAM user lacking deployment permissions would cause the deployment to fail before reaching the instances, not result in "Skipped" events on instances.
  • Option C is incorrect: If instances were not properly targeted/registered, they wouldn’t appear in the deployment group or show "Skipped" events for that deployment.
  • Option E is incorrect: A missing appspec.yml would typically cause the deployment to fail at a specific lifecycle event (e.g., DownloadBundle), not result in all events being "Skipped."

QUESTION 91

A company recently migrated its legacy application from on-premises to AWS. The application is hosted on Amazon EC2 instances behind an Application Load Balancer, which is behind Amazon API Gateway. The company wants to ensure users experience minimal disruptions during any deployment of a new version of the application. The company also wants to ensure it can quickly roll back updates if there is an issue.

Which solution will meet these requirements with MINIMAL changes to the application?

  • A. Introduce changes as a separate environment parallel to the existing one. Configure API Gateway to use a canary release deployment to send a small subset of user traffic to the new environment.
  • B. Introduce changes as a separate environment parallel to the existing one. Update the application’s DNS alias records to point to the new environment.
  • C. Introduce changes as a separate target group behind the existing Application Load Balancer. Configure API Gateway to route user traffic to the new target group in steps.
  • D. Introduce changes as a separate target group behind the existing Application Load Balancer. Configure API Gateway to route all traffic to the Application Load Balancer, which then sends the traffic to the new target group.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Option A (Correct)
Reasoning: API Gateway’s canary release deployment allows routing a small, configurable percentage of traffic to a new, parallel environment (stage). This enables gradual rollouts with minimal user disruption and instant rollback by adjusting traffic percentages, without modifying the core application code.

❌ Why the other choices are incorrect:

  • Option B is incorrect: Updating DNS alias records results in a blue/green cutover, not a gradual canary release. DNS propagation delays can cause disruptions and make quick rollbacks slower and less controlled than an API Gateway-managed traffic shift.
  • Option C is incorrect: While ALBs support weighted target groups, API Gateway does not natively manage routing between target groups within an ALB for a canary release directly. This approach would likely require manual changes to ALB listener rules, making it less automated and potentially more disruptive than an API Gateway stage-based canary.
  • Option D is incorrect: Routing "all traffic" implies a full cutover, not a gradual canary deployment. Although ALBs can route to new target groups, this option describes a hard cutover or requires complex ALB rule changes, lacking the inherent flexibility and quick rollback of API Gateway’s canary feature.

QUESTION 92 (Multi-Select)

A company requires an RPO of 2 hours and an RTP of 10 minutes for its data and application at all times. An application uses a MySQL database and Amazon EC2 web servers. The development team needs a strategy for failover and disaster recovery.

Which combination of deployment strategies will meet these requirements? (Choose two.)

  • A. Create an Amazon Aurora cluster in one Availability Zone across multiple Regions as the data store. Use Aurora’s automatic recovery capabilities in the event of a disaster.
  • B. Create an Amazon Aurora global database in two Regions as the data store. In the event of a failure, promote the secondary Region as the master for the application.
  • C. Create an Amazon Aurora multi-master cluster across multiple Regions as the data store. Use a Network Load Balancer to balance the database traffic in different Regions.
  • D. Set up the application in two Regions and use Amazon Route 53 failover-based routing that points to the Application Load Balancers in both Regions. Use health checks to determine the availability in a given Region. Use Auto Scaling groups in each Region to adjust capacity based on demand.
  • E. Set up the application in two Regions and use a multi-Region Auto Scaling group behind Application Load Balancers to manage the capacity based on demand. In the event of a disaster, adjust the Auto Scaling group’s desired instance count to increase baseline capacity in the failover Region.
Click to View Verified Solution & Explanation

Correct Option: B,D

Explanation: ✅ Option B (Correct)
Reasoning: An Aurora global database provides extremely low RPO (typically <1 second) and RTO (minutes) for the database tier by asynchronously replicating data across regions. Promoting the secondary region’s cluster ensures the database is quickly available in a disaster scenario, meeting the 2-hour RPO and contributing to the 10-minute RTO.


✅ Option D (Correct)
Reasoning: Deploying the application in two regions with Route 53 failover routing and health checks ensures rapid traffic redirection to a healthy region. Using ALBs and Auto Scaling Groups in each region provides highly available, scalable application infrastructure ready to serve requests immediately post-failover, meeting the 10-minute RTO for the application tier.

❌ Why the other choices are incorrect:

  • Option A is incorrect: "One Availability Zone across multiple Regions" is a contradictory statement and not a valid Aurora deployment. A single AZ deployment offers no cross-region DR, failing to meet RPO/RTO for regional disasters.
  • Option C is incorrect: Aurora Multi-Master currently operates within a single AWS Region across multiple AZs, not across multiple Regions. It therefore cannot provide cross-region disaster recovery.
  • Option E is incorrect: There is no "multi-Region Auto Scaling group." ASGs are regional. Relying on manually adjusting desired instance counts after a disaster for failover would increase RTO significantly, making it harder to meet the 10-minute RTO.

QUESTION 93 (Multi-Select)

A company has 100 GB of log data in an Amazon S3 bucket stored in .csv format. SQL developers want to query this data and generate graphs to visualize it. They also need an efficient, automated way to store metadata from the .csv file.

Which combination of steps should be taken to meet these requirements with the LEAST amount of effort? (Choose three.)

  • A. Filter the data through AWS X-Ray to visualize the data.
  • B. Filter the data through Amazon QuickSight to visualize the data.
  • C. Query the data with Amazon Athena.
  • D. Query the data with Amazon Redshift.
  • E. Use AWS Glue as the persistent metadata store.
  • F. Use Amazon S3 as the persistent metadata store.
Click to View Verified Solution & Explanation

Correct Option: B,C,F

Explanation: ✅ Option C (Query the data with Amazon Athena) (Correct)
Reasoning: Amazon Athena is a serverless query service ideal for SQL developers to query S3 data in CSV format directly using standard SQL, requiring no infrastructure management.


✅ Option B (Filter the data through Amazon QuickSight to visualize the data) (Correct)
Reasoning: Amazon QuickSight is a serverless business intelligence service designed to create interactive dashboards and graphs, perfectly suited for visualizing data queried via Athena from S3.


✅ Option F (Use Amazon S3 as the persistent metadata store) (Correct)
Reasoning: For "least amount of effort" and persistence, S3 can store metadata files (e.g., schema definitions, manifest files) alongside the CSV data, allowing other services to reference them.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS X-Ray is for distributed application tracing and analysis, not for querying or visualizing raw log data in S3.
  • Option D is incorrect: Amazon Redshift is a data warehouse solution requiring provisioning and data loading, which is higher effort than Athena for ad-hoc querying of S3 CSVs.
  • Option E is incorrect: While AWS Glue Data Catalog is commonly used for Athena’s schema metadata, "Use AWS Glue" as a service is broader. For storing metadata files with "least effort," S3 is a simpler persistent store.

QUESTION 94

A company uses a series of individual Amazon CloudFormation templates to deploy its multi-Region applications. These templates must be deployed in a specific order. The company is making more changes to the templates than previously expected and wants to deploy new templates more efficiently. Additionally, the data engineering team must be notified of all changes to the templates.

What should the company do to accomplish these goals?

  • A. Create an AWS Lambda function to deploy the CloudFormation templates in the required order. Use stack policies to alert the data engineering team.
  • B. Host the CloudForrnation templates in Amazon S3. Use Amazon S3 events to directly trigger CloudFormation updates and Amazon SNS notifications.
  • C. Implement CloudFormation StackSets and use drift detection to trigger update alerts to the data engineering team.
  • D. Leverage CloudFormation nested stacks and stack sets for deployments. Use Amazon SNS to notify the data engineering team.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Nested stacks enforce deployment order and promote reusability for efficient template management. StackSets streamline multi-Region deployments from a single operation. Amazon SNS is the standard service for publishing notifications to subscribers, fulfilling the requirement to alert the data engineering team of changes.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While Lambda can orchestrate deployments, it adds custom code complexity, especially for multi-Region. Stack policies control resource updates within a stack, not for notifying external teams of template changes.
  • Option B is incorrect: Hosting templates in S3 is good practice, but S3 events don’t inherently manage deployment order or multi-Region synchronization efficiently. Directly triggering updates via S3 events lacks dependency handling provided by nested stacks.
  • Option C is incorrect: StackSets are suitable for multi-Region, but drift detection identifies runtime resource deviations from the template, not for notifying an engineering team about template changes or deployments to meet the notification requirement. It doesn’t enforce deployment order.

QUESTION 95

A company manages a web application that runs on Amazon EC2 instances behind an Application Load Balancer (ALB). The EC2 instances run in an Auto Scaling group across multiple Availability Zones. The application uses an Amazon RDS for MySQL B3 instance to store the data. The company has configured Amazon Route 53 with an alias record that points to the ALB.

A new company guideline requires a geographically isolated disaster recovery (DR) site with an RTO of 4 hours and an RPO of 15 minutes.

Which DR strategy will meet these requirements with the LEAST change to the application stack?

  • A. Launch a replica environment of everything except Amazon RDS in a different Availability Zone. Create an RDS read replica in the new Availability Zone, and configure the new stack to point to the local RDS DB instance, Add the new stack to the Route 53 record set by using a health check to configure a failover routing policy.
  • B. Launch a replica environment of everything except Amazon RDS in a different AWS Region. Create an RDS read replica in the new Region. and configure the new stack to point to the local RDS DB instance. Add the new stack to the Route 53 record set by using a health check to configure a latency routing policy.
  • C. Launch a replica environment of everything except Amazon RDS in a different AWS Region. In the event of an outage, copy and restore the latest RDS snapshot from the primary Region to the DR Region. Adjust the Route 53 record set to point to the ALB in the DR Region.
  • D. Launch a replica environment of everything except Amazon RDS in a different AWS Region, Create an RDS read replica in the new Region, and configure the new environment to point to the local RDS DB instance. Add the new stack to the Route 53 record set by using a health check to configure a failover routing policy. In the event of an outage. promote the read replica to primary.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: This approach establishes a cross-region warm standby. A different AWS Region provides geographical isolation. An RDS read replica meets the 15-minute RPO via continuous replication. Promoting it to primary quickly satisfies the 4-hour RTO. Route 53 failover routing and health checks automate DNS switch, requiring minimal application changes, aligning with "least change."

❌ Why the other choices are incorrect:

  • Option A is incorrect: Deploying in a "different Availability Zone" does not provide geographically isolated disaster recovery, as a regional outage could impact both environments.
  • Option B is incorrect: A "latency routing policy" optimizes for performance, not explicit disaster recovery failover. It would not guarantee a failover during a primary Region outage.
  • Option C is incorrect: Copying and restoring an RDS snapshot typically takes too long, likely exceeding both the 4-hour RTO and 15-minute RPO requirements, making it an unsuitable cold DR strategy.

QUESTION 96

A company has 20 service teams. Each service team is responsible for its own microservice. Each service team uses a separate AWS account for its microservice and a VPC with the 192.168.0.0/22 CIDR block. The manages the AWS accounts with AWS Organizations.

Each service team hosts its microservice on multiple Amazon EC2 instances behind an Application Load Balancer. The microservices communicate with each other across the public internet. The company’s security team has issued a new guideline that all communication between microservices must use HTTPS over private network connections and cannot traverse the public internet.

A DevOps engineer must implement a solution that fulfills these obligations and minimizes the number of changes for each service team.

Which solution will meet these requirements?

  • A. Create a new AWS account in AWS Organizations. Create a VPC in this account, and use AWS Resource Access Manager to share the private subnets of this VPC with the organization. Instruct the teams to launch a new Network Load Balancer (NLB) and EC2 that use the shared private subnets. Use the NLB DNS names for communication between microservices.
  • B. Create a Network Load Balancer (NLB) in each of the microservice VPCs. use AWS Private-Link to create VPC endpoints in each AWS account for the NLBs. Create subscriptions to each VPC endpoint in each of the other AWS accounts. use the VPC endpoint DNS for between microservices.
  • C. Create a Network Load Balancer (NLB) in each of the microservice VPCs. Create VPC peering connections between each of the microservice VPCs. Update the route tables for each VPC to use the peering links. Use the NLB DNS names for communication between microservices.
  • D. Create a new AWS account in AWS Organizations. Create a transit gateway in this account, and use AWS Resource Access Manager to share the transit gateway with the organization. In each of the microservice VPCs, create a transit gateway attachment to the shared transit gateway. Update the route tables of each VPC to use the transit gateway. Create a Network Load Balancer (NLB) in each of the microservice VPCs. Use the NLB DNS names for communication between microservices.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅
Option B: Create a Network Load Balancer (NLB) in each of the microservice VPCs. use AWS Private-Link to create VPC endpoints in each AWS account for the NLBs. Create subscriptions to each VPC endpoint in each of the other AWS accounts. use the VPC endpoint DNS for between microservices.


Reasoning: AWS PrivateLink enables private, secure communication between VPCs across accounts without traversing the public internet. It simplifies connectivity by creating endpoints in consumer VPCs, making the service appear local. This inherently handles overlapping CIDR blocks and requires minimal changes, as teams primarily configure an NLB to expose their service and consume others via endpoints.

QUESTION 97

A company’s DevOps engineer is working in a multi-account environment. The company uses AWS Transit Gateway to route all outbound traffic through a network operations account. In the network operations account, all account traffic passes through a firewall appliance for inspection before the traffic goes to an internet gateway.

The firewall appliance sends logs to Amazon CloudWatch Logs and includes event severities of CRITICAL, HIGH, MEDIUM, LOW, and INFO. The security team wants to receive an alert if any CRITICAL events occur.

What should the DevOps engineer do to meet these requirements?

  • A. Create an Amazon CloudWatch Synthetics canary to monitor the firewall state. If the firewall reaches a CRITICAL state or logs a CRITICAL event, use a CloudWatch alarm to publish a notification to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the security team’s email address to the topic.
  • B. Create an Amazon CloudWatch metric filter by using a search for CRITICAL events. Publish a custom metric for the finding. Use a CloudWatch alarm based on the custom metric to publish a notification to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the security team’s email address to the topic.
  • C. Enable Amazon GuardDuty in the network operations account. Configure GuardDuty to monitor flow logs. Create an Amazon EventBridge (Amazon CloudWatch Events) event rule that is invoked by GuardDuty events that are CRITICAL. Define an Amazon Simple Notification Service (Amazon SNS) topic as a target. Subscribe the security team’s email address to the topic.
  • D. Use AWS Firewall Manager to apply consistent policies across all accounts. Create an Amazon EventBridge (Amazon CloudWatch Events) event rule that is invoked by Firewall Manager events that are CRITICAL. Define an Amazon Simple Notification Service (Amazon SNS) topic as a target. Subscribe the security team’s email address to the topic.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: This approach directly addresses the requirement. A CloudWatch metric filter can parse the CloudWatch Logs stream for "CRITICAL" events, publishing a custom metric. A CloudWatch alarm then monitors this custom metric, triggering an SNS notification to the security team when a CRITICAL event is logged.

❌ Why the other choices are incorrect:

  • Option A is incorrect: CloudWatch Synthetics canaries monitor endpoints and APIs, not log streams from a firewall appliance for specific event severities. This is not the correct tool for log parsing and alerting.
  • Option C is incorrect: Amazon GuardDuty monitors for malicious activity and threats based on AWS service logs (like Flow Logs, CloudTrail). It does not parse custom log event severities from an appliance’s logs sent to CloudWatch Logs.
  • Option D is incorrect: AWS Firewall Manager centrally manages AWS WAF, Shield Advanced, Security Groups, or Network Firewall rules. It doesn’t parse event severities from a third-party firewall appliance’s logs sent to CloudWatch Logs for alerting.

QUESTION 98

A media company has several thousand Amazon EC2 instances in an AWS account. The company is using Slack and a shared email inbox for team communications and important updates A DevOps engineer needs to send all AWS-scheduled EC2 maintenance notifications to the Slack channel and the shared inbox, The solution must include the instances’ Name and Owner tags.

Which solution will meet these requirements?

  • A. Integrate AWS Trusted Advisor with AWS Config. Configure a custom AWS Config rule to invoke an AWS Lambda function to publish notifications to an Amazon Simple Notification Service (Amazon SNS) topic Subscribe a Slack channel endpoint and the shared inbox to the topic.
  • B. Use Amazon EventBridge (Amazon CloudWatch Events) to monitor for AWS Health events. Configure the maintenance events to target an Amazon Simple Notification Service (Amazon SNS) topic Subscribe an AWS Lambda function to the SNS topic to send notifications to the Slack channel and the shared inbox
  • C. Create an AWS Lambda function that sends EC2 maintenance notifications to the Slack channel and the shared inbox. Monitor EC2 health events by using Amazon CloudWatch metrics. Configure a CloudWatch alarm that invokes the Lambda function when a maintenance notification is received.
  • D. Configure AWS Support integration with AWS CloudTraiI. Create a CloudTrail lookup event to invoke an AWS Lambda function to pass EC2 maintenance notifications to Amazon Simple Notification Service (Amazon SNS). Configure Amazon SNS to target the Slack channel and the shared inbox.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Option B (Correct)
Reasoning: Amazon EventBridge (CloudWatch Events) is the definitive service to monitor AWS Health events, which include EC2 maintenance notifications. It can trigger an Amazon SNS topic for fan-out. An AWS Lambda function subscribed to SNS can then process the event details, retrieve instance tags like ‘Name’ and ‘Owner’ via the EC2 API, and format/send custom notifications to Slack and the shared inbox. This is the standard, scalable, and recommended architecture.

❌ Why the other choices are incorrect:

  • Option A is incorrect: AWS Trusted Advisor provides recommendations, not real-time maintenance notifications. AWS Config monitors resource configuration changes, not AWS-initiated scheduled maintenance events from AWS Health. This solution would not detect maintenance notifications.
  • Option C is incorrect: AWS CloudWatch metrics monitor performance and operational data, not AWS-scheduled maintenance events. There are no direct CloudWatch metrics to detect these specific notifications. This approach uses the wrong monitoring mechanism.
  • Option D is incorrect: AWS CloudTrail records API calls and activity, but it’s not the primary or efficient service for monitoring AWS Health maintenance notifications. AWS Health is the dedicated service for these events. CloudTrail lookup events are for historical analysis, not real-time reactive monitoring.

QUESTION 99

A company is deploying a new application that uses Amazon EC2 instances. The needs a solution to query application and AWS account API activity.

Which solution will meet these requirements?

  • A. Use the Amazon CloudWatch agent to send from the EC2 instances to Amazon CloudWatch Configure AWS CloudTrail to deliver the API to Amazon S3. Use CloudWatch to query both sets of logs.
  • B. Use the Amazon CloudWatch agent to send logs from the EC2 instances to Amazon CloudWatch Log. Configure AWS CloudTrail to deliver the API to CloudWatch CloudWatch Logs Insights to query both sets of logs.
  • C. Use the Amazon CloudWatch agent to send logs from the EC2 instances to Amazon Kinesis. Configure AWS CloudTrail to deliver the API logs to Kinesis. Use Kinesis to load the data into Amazon Redshift. Amazon Redshift to query both sets of logs.
  • D. Use the Amazon CloudWatch agent to send logs from the EC2 instances to Amazon S3. Use AWS CloudTrail to deliver the API to Amazon Use Amazon Athena to query both sets of in Amazon S3.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Option D (Correct)
Reasoning: Amazon S3 offers cost-effective, durable storage for both application logs (via CloudWatch agent) and AWS API activity (via CloudTrail). Amazon Athena provides a powerful, serverless SQL query engine to query this consolidated data directly in S3, meeting both requirements with a unified solution.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While CloudWatch agent sends to CloudWatch Logs and CloudTrail to S3 is valid, CloudWatch doesn’t natively query S3-stored CloudTrail logs and its own logs together as a single solution without additional integration.
  • Option B is incorrect: Sending all logs to CloudWatch Logs and using Logs Insights is a valid option, but for long-term archival and cost-effectiveness of high-volume CloudTrail logs, S3 is generally preferred over CloudWatch Logs, making Option D a more common and scalable analytical solution.
  • Option C is incorrect: CloudTrail does not directly deliver logs to Kinesis. This option introduces unnecessary complexity and a potentially more expensive data warehouse (Redshift) for log querying compared to a serverless solution like Athena on S3.

QUESTION 100

A company has a guideline that every Amazon EC2 instance must launched from an AMl that the company’s security team Every month, the security team sends an email message with the latest approved AMIs to all the development tears.

The development teams use AWS CloudFormation to deploy their applications. developers hunch a new service, have to search their email for the latest AMIs that the security department sent. A DevOps engineer wants to automate the process that security team uses to provide AMI IDs to the development teams.

What is the MOST scalable solution that meets these requirements?

  • A. Direct the security team to use CloudFormation to create new versions of the AMIs and to list the AMI ARNs in an encrypted Amazon S3 as part of the stacks Outputs section. Instruct the developers to use a cross-stack reference to the encrypted S3 and obtain the most recent AMI ARNs
  • B. Direct the security team to use a CloudFormation stack to create an AWS CodePipeline pipeline that builds new AMIS and places the latest AMI ARNs in an encrypted Amazon S3 as part of output. Instruct the developers to use a cross-stack reference within their own CloudFormation template to obtain the S3 object location and the most recent AMI ARNs.
  • C. Direct the security team to use Amazon EC2 Image Builder to create new AMIS and to the AMI ARNs as parameters in AWS Systems Parameter Store. Instruct the developers to a parameter of SSM in their CloudFormation stack to obtain the most recent AMI ARNs from Parameter Store.
  • D. Direct the security team to use Amazon EC2 Builder to create new AMIS and to create an Amazon Simple notification Service (Amazon SNS) topic so that every development team can notifications. When the development teams receive a notification. instruct them to write an AWS Lambda function that will update their CbudFormation stack with most recent AFAI ARNs.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Option C (Correct)
Reasoning: EC2 Image Builder automates AMI creation and patching efficiently. AWS Systems Manager Parameter Store provides a centralized, versioned, and secure location to store AMI ARNs. CloudFormation can natively reference Parameter Store for dynamic AMI IDs, ensuring developers always use the latest approved AMIs without manual updates. This is a highly scalable, automated, and secure solution.

❌ Why the other choices are incorrect:

  • Option A is incorrect: While S3 can store data, it’s not designed as a dynamic, versioned parameter store like SSM Parameter Store. Referencing specific data within an S3 object directly from CloudFormation for a parameter is more complex than using Parameter Store.
  • Option B is incorrect: Similar to A, using S3 for dynamic parameter distribution is less efficient than Parameter Store. While CodePipeline can build AMIs, EC2 Image Builder is more specialized for the task.
  • Option D is incorrect: Requiring each development team to write and maintain an AWS Lambda function to update their CloudFormation stacks adds significant operational overhead and complexity. This is not as scalable or maintainable as CloudFormation’s native integration with Parameter Store.

Need the Full Exam Simulator?

Practice the complete question bank in a realistic, timed environment with advanced tracking.

Access Full CertoMetrics Engine →

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top