Question 846 of 1,740
Configuration Management and IaCmediumMultiple SelectObjective-mapped

Quick Answer

The correct answer is to use the AWS CLI command `aws cloudformation create-stack` with the `--capabilities CAPABILITY_IAM` parameter, or to call the CreateStack API from an AWS Lambda function with the `capabilities` parameter set to `CAPABILITY_IAM`. This is required because CloudFormation, by default, refuses to create IAM resources—such as users, roles, or policies—as a security guardrail to prevent accidental privilege escalation. You must explicitly acknowledge the risk by passing the `CAPABILITY_IAM` flag, which tells the service that you understand the stack may create or modify IAM entities. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this concept tests your understanding of CloudFormation’s safety mechanisms and how to automate stack creation with IAM resources. A common trap is forgetting that both the CLI and API require this capability flag, or confusing it with `CAPABILITY_NAMED_IAM`, which is needed only when IAM resources have custom names. Memory tip: think "IAM = I Acknowledge Mandatory" — you must always pass the capability flag when IAM resources are involved.

DOP-C02 Configuration Management and IaC Practice Question

This DOP-C02 practice question tests your understanding of configuration management and iac. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which TWO approaches can be used to automate the creation of an AWS CloudFormation stack that includes IAM resources? (Select TWO.)

Question 1mediummulti select
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use an AWS Lambda function to call the CreateStack API with the capabilities parameter set to 'CAPABILITY_IAM'.

Option D is correct because when a CloudFormation stack includes IAM resources, you must explicitly acknowledge that the stack may create IAM entities. An AWS Lambda function calling the CreateStack API with the `capabilities` parameter set to `CAPABILITY_IAM` satisfies this requirement. Option E is correct because the AWS CLI `create-stack` command with the `--capabilities CAPABILITY_IAM` parameter also provides the required acknowledgment, allowing the stack to be created successfully.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Store the CloudFormation template in an Amazon S3 bucket and use the 'aws cloudformation deploy' command.

    Why it's wrong here

    The deploy command also requires the capabilities parameter; storing in S3 is not specific to IAM resources.

  • Set the 'CAPABILITY_NAMED_IAM' capability when calling the CreateStack API.

    Why it's wrong here

    CAPABILITY_NAMED_IAM is for templates that create IAM resources with custom names; CAPABILITY_IAM is sufficient for general IAM resources.

  • Attach the AWS managed policy 'IAMFullAccess' to the IAM user or role executing the stack creation.

    Why it's wrong here

    The user needs permissions to create IAM resources, but the capability parameter is also required.

  • Use an AWS Lambda function to call the CreateStack API with the capabilities parameter set to 'CAPABILITY_IAM'.

    Why this is correct

    The Lambda function can programmatically create the stack with the required capability.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use the AWS CLI command 'aws cloudformation create-stack' with the '--capabilities CAPABILITY_IAM' parameter.

    Why this is correct

    This acknowledges that the template may create IAM resources.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse IAM permissions (like `IAMFullAccess`) with the CloudFormation capability acknowledgment, thinking that having the right IAM policy alone is sufficient to create IAM resources in a stack, when in fact the `CAPABILITY_IAM` or `CAPABILITY_NAMED_IAM` flag must be explicitly set in the API call.

Trap categories for this question

  • Command / output trap

    The deploy command also requires the capabilities parameter; storing in S3 is not specific to IAM resources.

Detailed technical explanation

How to think about this question

Under the hood, CloudFormation requires the `CAPABILITY_IAM` flag to prevent accidental creation of IAM resources that could lead to privilege escalation. The `CAPABILITY_NAMED_IAM` flag is a superset that also allows custom resource names, which is necessary when the template uses `Fn::Sub` or hardcoded names for IAM entities. In real-world scenarios, forgetting to include these capabilities is a common cause of stack creation failures, especially when using CI/CD pipelines that call the CloudFormation API directly.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DOP-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DOP-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DOP-C02 question test?

Configuration Management and IaC — This question tests Configuration Management and IaC — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Use an AWS Lambda function to call the CreateStack API with the capabilities parameter set to 'CAPABILITY_IAM'. — Option D is correct because when a CloudFormation stack includes IAM resources, you must explicitly acknowledge that the stack may create IAM entities. An AWS Lambda function calling the CreateStack API with the `capabilities` parameter set to `CAPABILITY_IAM` satisfies this requirement. Option E is correct because the AWS CLI `create-stack` command with the `--capabilities CAPABILITY_IAM` parameter also provides the required acknowledgment, allowing the stack to be created successfully.

What should I do if I get this DOP-C02 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 24, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.