terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

ibm_iam_trusted_profile_template_assignment causes in-place update every on every apply

Open dprosper opened this issue 5 months ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

When running a terraform plan or apply for a resource changes should only be made when there has been changes to the template or the resources, that is not the case when using the ibm_iam_trusted_profile_template_assignment, changes seem to be made everytime...

Affected Resource(s)

  • ibm_iam_trusted_profile_template_assignment

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Assign (or update) the trusted profile template to an account group
resource "ibm_iam_trusted_profile_template_assignment" "tp_assignment_instance" {
  template_id      = split("/", ibm_iam_trusted_profile_template.databases_sre_tp_template.id)[0]
  template_version = ibm_iam_trusted_profile_template.databases_sre_tp_template.version
  target_type      = "AccountGroup"                                            // or "Account"
  target           = ibm_enterprise_account_group.bu_workload_account_group.id // or "<account id>"
}

resource "ibm_iam_trusted_profile_template_assignment" "tp_assignment_instance_admin" {
  template_id      = split("/", ibm_iam_trusted_profile_template.databases_sre_tp_template.id)[0]
  template_version = ibm_iam_trusted_profile_template.databases_sre_tp_template.version
  target_type      = "AccountGroup"                                         // or "Account"
  target           = ibm_enterprise_account_group.bu_admin_account_group.id // or "<account id>"
}

Expected Behavior

No changes should be made.

Actual Behavior

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # ibm_iam_trusted_profile_template_assignment.tp_assignment_instance will be updated in-place
  ~ resource "ibm_iam_trusted_profile_template_assignment" "tp_assignment_instance" {
      + context             = (known after apply)
      + history             = (known after apply)
        id                  = "TemplateAssignment-a72d50a5-4202-44bd-8976-42c69aed4df9"
        # (12 unchanged attributes hidden)
    }

  # ibm_iam_trusted_profile_template_assignment.tp_assignment_instance_admin will be updated in-place
  ~ resource "ibm_iam_trusted_profile_template_assignment" "tp_assignment_instance_admin" {
      + context             = (known after apply)
      + history             = (known after apply)
        id                  = "TemplateAssignment-73bf36c5-d22f-4709-aca8-b8c8e420ab8e"
        # (12 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

Steps to Reproduce

  1. terraform apply to create the resources initially.
  2. terraform apply after everything was created, but without making any changes to the template or state file.

Important Factoids

References

  • #0000

dprosper avatar Jan 25 '24 14:01 dprosper