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

Removing the last entitlement id or entitlement tag from a policy does not work #308

Closed
jered-miller opened this issue May 3, 2023 · 0 comments · Fixed by #309
Closed

Comments

@jered-miller
Copy link

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

Terraform v1.4.6
on darwin_arm64

  • provider registry.terraform.io/appgate/appgatesdp v1.3.0
  • provider registry.terraform.io/hashicorp/aws v4.65.0
  • provider registry.terraform.io/hashicorp/null v3.2.1
  • provider registry.terraform.io/hashicorp/tls v4.0.4

Affected Resource(s)

  • appgatesdp_policy

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_policy" "this" {
  for_each = { for ap in var.access_policies : ap.name => ap }

  name              = each.value.name
  notes             = each.value.notes
  disabled          = !each.value.enabled

  type              = each.value.type

  entitlements      = [ for e in each.value.entitlements : appgatesdp_entitlement.this[e].id ]
  entitlement_links = each.value.entitlement_tags


  expression        = file("./policy_conditions/${each.value.condition_file}")

  tags      = each.value.tags
}

Debug Output

Panic Output

Expected Behavior

Removing the last entitlement by feeding it an empty set should remove it from the UI.

Actual Behavior

Running a terraform plan/apply in this context correctly shows that the entitlement will be removed, and apply reports that the action was successful. However, if this is the last entitlement id or entitlement tag, it does not actually remove it. If there is more than one of these items in the list of entitlements, it operates as expected.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
dlnilsson added a commit that referenced this issue May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant