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

Private App Resource State Not Refreshing #31

Open
jeazy23 opened this issue Oct 29, 2024 · 0 comments · May be fixed by #32
Open

Private App Resource State Not Refreshing #31

jeazy23 opened this issue Oct 29, 2024 · 0 comments · May be fixed by #32

Comments

@jeazy23
Copy link

jeazy23 commented Oct 29, 2024

When I modify the state of a resource in the GUI, this state change is not reflected during the terraform refresh state.

In the GUI I modified the publishers and ports for a private app defined using the Netskope provider. Specifically, I removed port 8080 and publisher nae02np02.

Configuration in the GUI:
Screenshot 2024-10-29 at 4 09 40 PM

When I look at the latest state file after a refresh I still see publisher nae02np02 and port 8080 allowed:


      "mode": "managed",
      "type": "netskope_privateapps",
      "name": "MultiplePrivateApps",
      "provider": "provider[\"registry.terraform.io/netskopeoss/netskope\"]",
      "instances": [
        {
          "index_key": "tfe_test_app1",
          "schema_version": 0,
          "attributes": {
            "app_name": "tfe_test_app1",
            "clientless_access": false,
            "host": "app1.tfetest.test.com,app1.tfetesting.test.com",
            "id": "2167",
            "protocols": [
              {
                "port": "80",
                "type": "tcp"
              },
              {
                "port": "443",
                "type": "tcp"
              },
              {
                "port": "8080",
                "type": "tcp"
              }
            ],
            "publisher": [
              {
                "publisher_id": "4",
                "publisher_name": "naw03np01"
              },
              {
                "publisher_id": "66",
                "publisher_name": "nae02np02"
              },
              {
                "publisher_id": "69",
                "publisher_name": "nae02np03"
              }
            ],

I took a look at the provider code for the privateapps resource and noticed that the Read function resourcePrivateAppsRead isn't performing any lookup against the Netskope REST API to get the private apps. I believe this Read function needs to perform this lookup in order to refresh the state.

https://github.com/netskopeoss/terraform-provider-netskope/blob/main/netskope/resource_privateapps.go#L71

@julianmaze julianmaze linked a pull request Nov 6, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant