nerdexam
HashiCorp

TA-002-P · Question #213

Taint the resource "aws_instance" "baz" resource that lives in module bar which lives in module foo.

The correct answer is C. terraform taint module.foo.module.bar.aws_instance.baz. When a resource lives inside nested modules, the full path must reference each module layer using the 'module.' prefix. The correct syntax is: terraform taint module.foo.module.bar.aws_instance.baz. Option A omits the resource type. Option B omits 'module.' before bar. Option D o

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

Taint the resource "aws_instance" "baz" resource that lives in module bar which lives in module foo.

Options

  • Aterraform taint module.foo.module.bar.baz
  • Bterraform taint module.foo.bar.aws_instance.baz
  • Cterraform taint module.foo.module.bar.aws_instance.baz
  • Dterraform taint foo.bar.aws_instance.baz

How the community answered

(24 responses)
  • B
    13% (3)
  • C
    83% (20)
  • D
    4% (1)

Explanation

When a resource lives inside nested modules, the full path must reference each module layer using the 'module.' prefix. The correct syntax is: terraform taint module.foo.module.bar.aws_instance.baz. Option A omits the resource type. Option B omits 'module.' before bar. Option D omits all 'module.' prefixes entirely.

Topics

#terraform taint#resource addressing#nested modules#CLI commands

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice