CertKeen

Terraform Associate (004) · Free practice question 9 of 12

terraform_data triggers_replace argument

Marrow Games wants a terraform_data resource, used to run a setup step, to be replaced whenever var.schema_version changes. Which argument achieves this?

  1. A.triggers_replace = var.schema_version
  2. B.input = var.schema_version
  3. C.depends_on = [var.schema_version]
  4. D.lifecycle { ignore_changes = [var.schema_version] }
Show answer and explanation

Correct answer: A. triggers_replace = var.schema_version

Why: terraform_data's triggers_replace argument holds a value that, when changed, causes the resource to be replaced. The input argument is stored and returned as output, but changing it does not force replacement. depends_on expects resource or module references, and ignore_changes takes the resource's own attributes, not variables.

More free Terraform Associate (004) questions