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

zia_dlp_web_rules notification_template value returns a list instead of a number type value #209

Open
2 tasks done
eReyesZscaler opened this issue Jun 27, 2024 · 0 comments

Comments

@eReyesZscaler
Copy link

eReyesZscaler commented Jun 27, 2024

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the library and it is still present.

zscaler-terraformer version

zscaler-terraformer v1.2.2 Terraform version: Terraform v1.5.7 on (darwin_arm64)

Expected outcome

zia_dlp_web_rules created by the script have the wrong value type for "notification_template". It returns a list, but it should be a number:
Good file:

resource "zia_dlp_web_rules" "resource_zia_dlp_web_rules_843707" {
  action                    = "BLOCK"
  external_auditor_email    = "ereyes@zscaler.com"
  name                      = "Lab CC Number"
  order                     = 1
  protocols                 = ["FTP_RULE", "HTTPS_RULE", "HTTP_RULE"]
  rank                      = 7
  severity                  = "RULE_SEVERITY_INFO"
  state                     = "ENABLED"
  zscaler_incident_receiver = true
  dlp_engines {
    id = [2]
  }
  notification_template {
    id = "3671"
  }
}


Actual outcome

Terraform creates the file and then errors on it:

actual file:

resource "zia_dlp_web_rules" "resource_zia_dlp_web_rules_843707" {
  action                    = "BLOCK"
  external_auditor_email    = "ereyes@zscaler.com"
  name                      = "Lab CC Number"
  order                     = 1
  protocols                 = ["FTP_RULE", "HTTPS_RULE", "HTTP_RULE"]
  rank                      = 7
  severity                  = "RULE_SEVERITY_INFO"
  state                     = "ENABLED"
  zscaler_incident_receiver = true
  dlp_engines {
    id = [2]
  }
  notification_template {
    id = [3671]
  }
}


╷
│ Error: Incorrect attribute value type
│
│   on zia_dlp_web_rules.tf line 48, in resource "zia_dlp_web_rules" "resource_zia_dlp_web_rules_843707":
│   48:     id = [3671]
│
│ Inappropriate value for attribute "id": number required.
╵

Steps to reproduce

  1. run terraform import on an environment with dlp web rules
  2. attempt to run "terraform plan" afterwards
  3. Terraform errors that the type is bad.

References

https://developer.hashicorp.com/terraform/language/expressions/types

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

No branches or pull requests

1 participant