philips-software / terraform-provider-hsdp

Terraform provider to orchestrate various HSDP resources like IAM, CDL, CDR, MDM, Container Host, Edge, etc
https://registry.terraform.io/providers/philips-software/hsdp/latest
MIT License
33 stars 13 forks source link

Unable to create IAM create client using terraform #411

Closed Pradeepgk11 closed 4 months ago

Pradeepgk11 commented 4 months ago

`Error:

module.public_client.hsdp_iam_client.default: Still creating... [50s elapsed] module.private_client.hsdp_iam_client.default: Still creating... [50s elapsed] Error: -05T11:21:13.384Z [ERROR] provider.terraform-provider-hsdp_v0.48.1: Response contains error diagnostic: diagnostic_summary="retry 11 due to HTTP 0: response was nil: Key: 'ApplicationClient.ClientID' Error:Field validation for 'ClientID' failed on the 'max' tag" tf_proto_version=5.4 tf_resource_type=hsdp_iam_client tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.21.0/tfprotov5/internal/diag/diagnostics.go:62 diagnostic_detail= diagnostic_severity=ERROR tf_provider_addr=provider tf_req_id=03dd86ae-69db-6ac1-a8a0-31665a0d4b33 @module=sdk.proto timestamp=2024-04-05T11:21:13.384Z Error: -05T11:21:13.386Z [ERROR] vertex "module.public_client.hsdp_iam_client.default" error: retry 11 due to HTTP 0: response was nil: Key: 'ApplicationClient.ClientID' Error:Field validation for 'ClientID' failed on the 'max' tag module.private_client.hsdp_iam_client.default: Still creating... [1m0s elapsed] module.private_client.hsdp_iam_client.default: Still creating... [1m10s elapsed] Error: -05T11:21:33.661Z [ERROR] provider.terraform-provider-hsdp_v0.48.1: Response contains error diagnostic: tf_proto_version=5.4 @module=sdk.proto diagnostic_detail= diagnostic_severity=ERROR diagnostic_summary="retry 11 due to HTTP 0: response was nil: Key: 'ApplicationClient.ClientID' Error:Field validation for 'ClientID' failed on the 'max' tag" tf_provider_addr=provider tf_req_id=5b11f17b-4d9d-5872-d572-7b1230984227 @caller=github.com/hashicorp/terraform-plugin-go@v0.21.0/tfprotov5/internal/diag/diagnostics.go:62 tf_resource_type=hsdp_iam_client tf_rpc=ApplyResourceChange timestamp=2024-04-05T11:21:33.660Z Error: -05T11:21:33.661Z [ERROR] vertex "module.private_client.hsdp_iam_client.default" error: retry 11 due to HTTP 0: response was nil: Key: 'ApplicationClient.ClientID' Error:Field validation for 'ClientID' failed on the 'max' tag `

we are using below code: resource "hsdp_iam_client" "default" { name = var.iam_client_name description = var.iam_client_description type = var.iam_client_type client_id = var.iam_client_id password = var.iam_client_password application_id = var.iam_application_id global_reference_id = var.iam_global_reference_id scopes = var.iam_client_scopes default_scopes = var.iam_client_default_scopes redirection_uris = var.iam_client_redirection_uris response_types = var.iam_client_response_types }

client name: pdus_public_lumifysver pdus_private_lumifysver pdus_saml_lumifysver

version: terraform { required_version = ">= 0.14.5" required_providers { hsdp = { source = "philips-software/hsdp" version = ">=0.37.3" } cloudfoundry = { source = "cloudfoundry-community/cloudfoundry" version = "=0.15.5" } random = { source = "hashicorp/random" } aws = { source = "hashicorp/aws" version = "4.26.0" } } }

Pradeepgk11 commented 4 months ago

Please look into this, due to this deployment blocked

loafoe commented 4 months ago

@Pradeepgk11 according to API documentation here https://www.hsdp.io/documentation/identity-and-access-management-iam/api-documents/resource-reference-api/client-api#/Client/post_Client -- the ClientID cannot be longer than 20 chars.. You are trying to create a client which has 23 chars: pdus_private_lumifysver -- Shorten the name and the request should succeed.