Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibm_iam_trusted_profile_identity returns 400 status code when using type=crn #4956

Open
cwadding opened this issue Nov 28, 2023 · 0 comments
Labels
service/IAM Issues related to IAM service/Resource Management Issues related to Resource Manager or Resource controller Issues

Comments

@cwadding
Copy link

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.4
on darwin_arm64

  • provider registry.terraform.io/ibm-cloud/ibm v1.60.0-beta1

Affected Resource(s)

  • ibm_iam_trusted_profile_identity

Terraform Configuration Files

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

main.txt

terraform {
  required_version = ">= 1.3.0, <1.7.0"

  # Ensure that there is always 1 example locked into the lowest provider version of the range defined in the main
  # module's version.tf (usually a basic example), and 1 example that will always use the latest provider version.
  required_providers {
    ibm = {
      source  = "IBM-Cloud/ibm"
      version = "1.60.0-beta1"
    }
  }
}

variable "ibmcloud_api_key" {
  type        = string
  description = "The IBM Cloud API Key"
  sensitive   = true
}

provider "ibm" {
  ibmcloud_api_key = var.ibmcloud_api_key
  region           = "us-south"
}

resource "ibm_resource_group" "resource_group" {
  name     = "my-test-group"
}


resource "ibm_project" "project_instance" {
  definition {
    name = "My static website"
    description = "Sample static website test using the IBM catalog deployable architecture"
    destroy_on_delete = true
  }
  location = "us-south"
  resource_group = ibm_resource_group.resource_group.name
}

resource "ibm_iam_trusted_profile" "tp" {
  name = "my-trusted-profile"
}

resource "ibm_iam_trusted_profile_identity" "identity" {
  identifier = ibm_project.project_instance.crn
  identity_type = "crn"
  profile_id = ibm_iam_trusted_profile.tp.id
  type = "crn"
}

Debug Output

Panic Output

N/A

Expected Behavior

A terraform apply or plan should have exited cleanly. There should not have been a 400 error and the trusted profile should have been found since it was just created

Actual Behavior

400 status errors occurred in the console with the message. It seems that the crn may not be parsing correctly as it is splitting the crn string at the \

{"errors":[{"code":"invalid_property","message_code":"BXNIM0276E","message":"Identity not found in the trusted profile.","details":"'crn:v1:bluemix:public:project:us-south:a' of 'crn' cannot be found in the list of trusted identites of the trusted profile 'Profile-fb52cc22-5352-4c2a-ac02-3394c1c2096f'."}],"trace":"bTV4Ym0-ffb5f32c580e411a8072fca3f2e68128","status_code":400}

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added service/IAM Issues related to IAM service/Resource Management Issues related to Resource Manager or Resource controller Issues labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/IAM Issues related to IAM service/Resource Management Issues related to Resource Manager or Resource controller Issues
Projects
None yet
Development

No branches or pull requests

1 participant