appgate / terraform-provider-appgatesdp

Terraform Provider for Appgate SDP
https://registry.terraform.io/providers/appgate/appgatesdp
MIT License
21 stars 10 forks source link

Default value for client shortcut color code param not working #296

Closed jered-miller closed 1 year ago

jered-miller commented 1 year ago

Terraform CLI, Terraform appgatesdp Provider Version, and Appgate Appliance version(s)

Terraform v1.3.7 on darwin_arm64

provider registry.terraform.io/appgate/appgatesdp v1.1.1 provider registry.terraform.io/hashicorp/aws v4.60.0 appgate appliance version: 6.1.2

Affected Resource(s)

Terraform Configuration Files

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

resource "appgatesdp_entitlement" "this" {
  for_each = { for e in var.entitlements : e.name => e }

  name = each.value.name
  site = data.appgatesdp_site.default_site.id

  disabled = !each.value.enabled

  condition_logic = each.value.condition_logic
  conditions = [ data.appgatesdp_condition.always.id ]

  dynamic "app_shortcuts" {
    for_each = { for app in each.value.client_shortcuts : app.name => app }

    content {
        name        = app_shortcuts.value.name
        description = app_shortcuts.value.description
        url         = app_shortcuts.value.url
        color_code  = app_shortcuts.value.color_code
    }
  }

    dynamic "actions" {
      for_each = { for action in each.value.actions : action.name => action }

      content {
          subtype = actions.value.subtype
          action  = actions.value.action
          hosts   = actions.value.hosts
          ports   = actions.value.ports
      }
    }

  tags = each.value.tags
}

Debug Output

Panic Output

Expected Behavior

If left off, color code should default to 1 since it is an optional parameter

Actual Behavior

Terraform apply throws an error indicating that color code is required.

Steps to Reproduce

  1. terraform apply

Important Factoids

References