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

SCC provider should output User friendly error messages clearly indicating the problem.

Open mrgadgil opened this issue 2 years 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

Affected Resource(s)

  • ibm_scc_posture_collector
  • ibm_scc_posture_credential
  • ibm_scc_posture_scope

Terraform Configuration Files

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

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please share a link to the ZIP file.
resource "ibm_scc_posture_collector" "scc_collector" {
  description  = "GoldenEye Collector for acquiring information from resources."
  is_public    = true
  is_ubi_image = var.is_ubi_image
  managed_by   = var.collector_management
  name         = "${var.prefix}-collector"
  passphrase   = var.scc_passphrase
}

# Credentials for scope. Scope has a collector associated with it and
resource "ibm_scc_posture_credential" "scc_credentials" {
  description = "Credential used by SCC collector for connecting to the resources."
  display_fields {
    ibm_api_key = var.ibmcloud_api_key
  }
  enabled = true
  group {
    id         = "0"
    passphrase = ""
  }
  name    = "${var.prefix}-credentials"
  purpose = var.scc_credential_purpose
  type    = var.scc_credential_type
}

resource "ibm_scc_posture_scope" "scc_scope" {
  collector_ids   = ["${ibm_scc_posture_collector.scc_collector.id}"]
  credential_id   = ibm_scc_posture_credential.scc_credentials.id
  credential_type = "ibm"
  description     = "Scope-for-combining-the-GoldenEye-Collector-and-GoldenEye-Credentials"
  name            = "${var.prefix}-scope"
}

Debug Output

Panic Output

Expected Behavior

SCC should clearly output the error message indicating the cause of failure to create the resources. For any failure SCC outputs, Internal Server Error error code 500 Examples of such unclear error messages:

  • Collector, Scope, Credential name is not unique
  • Description has special/not allowed characters
  • Resource name is more than the allowed character limit
  • Any other invalid inputs provided to resources

Actual Behavior

SCC terraform provider should indicate an user friendly error message indicating how user can correct the error.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000

mrgadgil avatar Jun 13 '22 18:06 mrgadgil

Code is merged. Fix will be available in next terraform version release

archanaponnada avatar Jun 20 '22 12:06 archanaponnada