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

trusted_profile_template_assignment target is single string, should be an array

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

Description

target is a single value field, forcing me to come up with my own for loop - or poor man copy and paste - to assign the template to multiple account groups / accounts. It would be nicer to have that field accept multiple entries. It also increases the "update in-place" messages issue mentioned in the earlier comment.

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/trusted_profile_template_assignment

New or Affected Resource(s)

  • trusted_profile_template_assignment

Potential Terraform Configuration

# 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>"
}

References

  • #0000

dprosper avatar Jan 25 '24 14:01 dprosper