Skip to content

Terraform target validation issue #38670

@mikellealboretto-byte

Description

@mikellealboretto-byte

Terraform Version

terraform version
Terraform v1.13.4
on linux_amd64

Terraform Configuration Files

module "xen_vm" {
  for_each = local.vms
  source   = "./modules/xen"
  
  name        = each.key
  vcpus       = each.value.cpu
  memory      = each.value.ram
  disks       = each.value.disks
  networks    = each.value.networks
  host_name   = each.value.host_name
}

Debug Output

terraform -chdir=terraform apply -target='module.xen_vm[\"some-vm\"].xenorchestra_vm.vm' some.tfplan

Expected Behavior

terraform will apply the one single resource changes

Actual Behavior

module.powerdns_records["some-other-vm-15"].powerdns_record.a-record[0]: Destruction complete after 0s
module.xen_vm["some-other-vm-06"].xenorchestra_vm.vm: Modifying... [id=da1351c6-e522-92e0-ffb9-a8cf86b13351]

tf run apply for all the resources in plan file

Steps to Reproduce

  1. terraform init - fresh state, completely new dir
  2. terraform -chdir=terraform plan -parallelism=15 -out=some.tfplan
  3. terraform -chdir=terraform apply -target='module.xen_vm[\"some-vm\"].xenorchestra_vm.vm' some.tfplan

Additional Context

Seems here is the problem with target pointing

References

No response

Generative AI / LLM assisted development?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions