Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Root Resource does not refresh correctly from state. #109

Closed
ashhammond opened this issue Jan 24, 2022 · 2 comments
Closed

Root Resource does not refresh correctly from state. #109

ashhammond opened this issue Jan 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@ashhammond
Copy link

ashhammond commented Jan 24, 2022

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 "me too" comments, 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 Version

0.14.5

Affected Resource(s)

  • pingaccess_application

Terraform Configuration Files

resource "pingaccess_application" "demo_application" {
  application_type = "API"
  name             = "demo"
  context_root     = "/"
  destination      = "Site"
  site_id          = pingaccess_site.demo_site.id
  virtual_host_ids = [pingaccess_virtualhost.demo_host.id]
  enabled           = true
}

resource "pingaccess_virtualhost" "demo_host" {
  host                     = "foo.demo.com"
  port                     = 443
  agent_resource_cache_ttl = 900
}

resource "pingaccess_site" "demo_site" {
  name    = "foo-site"
  targets = ["foo:1234"]
}

resource "pingaccess_application_resource" "demo_root_resource" {

  anonymous                  = false
  application_id             = pingaccess_application.demo_application.id
  name                       = "Root Resource"
  audit_level                = "ON"
  default_auth_type_override = "Web"
  enabled                    = true
  methods                    = ["*"]
  root_resource              = true
  path_prefixes              = ["/*"]
  path_patterns {
    pattern = "/*"
    type    = "WILDCARD"
  }
  unprotected = false
  policy {
    api {
      type = "Rule"
      id   = pingaccess_rule.deny_api_root_access.id
    }
  }
}

resource "pingaccess_rule" "deny_api_root_access" {
  name                   = "Deny"
   class_name             = "com.pingidentity.pa.policy.RejectionRule"
   supported_destinations = ["Site", "Agent"]
   configuration          = <<EOF
 {
     "rejectionHandler": "2"
 }
   EOF
 }

Debug Output

Panic Output

Expected Behavior

Create a Ping Access application with a root resource defined with an associated api policy in TF and apply the configuration using TF.
An administrative error removes the API policy from the root resource.
Run a TF plan to detect the change.
Run a TF apply to restore the desired state.

Actual Behavior

Create a Ping Access application with a root resource defined with an associated api policy in TF and apply the configuration using TF.
An administrative error removes the API policy from the root resource.
TF plan does not detect the managed resource has changed.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ashhammond ashhammond added the bug Something isn't working label Jan 24, 2022
@ashhammond
Copy link
Author

@iwarapter and team. I have updated the replicator code to be self contained. 👍🏻

@iwarapter
Copy link
Owner

This was fixed back in v0.9.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants