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

ibm_scc_profile_attachment can't be created or imported

Open evanrappe opened this issue 1 year ago • 1 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

Terraform v1.6.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/azuread v2.44.1
+ provider registry.terraform.io/ibm-cloud/ibm v1.58.1

Affected Resource(s)

  • ibm_scc_profile_attachment

Terraform Configuration Files

You'll have to provide your own IDs to reproduce, but be assured that where the capitalized values match in this issue and my Gist, they match in my real code. Note that I've tried using this resource configuration to both create a new attachment as well as import our existing one. I know it doesn't match the exact settings of our current attachment found at listing_profile_attachement_from_api.txt but I'm simply trying to test the import at this point, so a diff in the plan is okay for now.

resource "ibm_scc_profile_attachment" "test" {
  profile_id  = "REDACTED_PROFILE_ID"
  instance_id = "REDACTED_INSTANCE_ID"
  name        = "TESTING"
  scope {
    environment = "ibm-cloud"
    properties {
      name  = "scope_id"
      value = "REDACTED_ENTERPRISE_ID"
    }
    properties {
      name  = "scope_type"
      value = "enterprise"
    }
  }
  schedule = "every_7_days"
  status   = "disabled"
  notifications {
    enabled = false
    controls {
      failed_control_ids = []
      threshold_limit    = 14
    }
  }
}

import {
  to = ibm_scc_profile_attachment.test
  id = "REDACTED_INSTANCE_ID/REDACTED PROFILE_ID/REDACTED_ATTACHMENT_ID"
}

Debug Output

https://gist.github.com/evanrappe/324df73703f75ccbde0f127c990bffa9 ^ Note -- I have not provided full debugs to avoid having to redact a ton of things. The import and create operation both appear to be broken from what I can tell so this should be extremely simple to reproduce.

Expected Behavior

The resource should be able to be created or imported.

Actual Behavior

Resource cannot be created or imported as instructed in the docs.

Steps to Reproduce

  1. terraform apply -target=ibm_scc_profile_attachment.test

There are 2 issues here --

  • if you apply the resource without the import block, you get the message in [create_error.txt](https://gist.github.com/evanrappe/324df73703f75ccbde0f127c990bffa9#file-create_error-txt)
  • If you try to import the existing one using the import block you get the error in import_error.txt

Important Factoids

The attachment we currently have is attached to our Enterprise account but I've tried both importing it using the config demonstrated here as well as deploying a duplicate one using the same TF config.

evanrappe avatar Oct 24 '23 19:10 evanrappe