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

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

Open
mrgadgil opened this issue Jun 13, 2022 · 1 comment
Labels
service/SCC Issues related to SCC

Comments

@mrgadgil
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

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
@github-actions github-actions bot added the service/SCC Issues related to SCC label Jun 13, 2022
@archanaponnada
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/SCC Issues related to SCC
Projects
None yet
Development

No branches or pull requests

2 participants