disc / terraform-provider-pritunl

Pritunl Terraform provider
https://pritunl.com
Mozilla Public License 2.0
47 stars 20 forks source link

Error when updating routes #67

Open gkaskonas opened 3 months ago

gkaskonas commented 3 months ago

                                  │ Error: Error on detaching route from the server: Non-200 response on deleting a route on the server
                                  │ body=404 page not found
                                  │ 
                                  │   with pritunl_server.oncalladminserver (oncalladminserver),
                                  │   on cdk.tf.json line 363, in resource.pritunl_server.oncalladminserver (oncalladminserver):
                                  │  363:       },
                                  │ 
                                  ╵

This is my apply

                                  # pritunl_server.oncalladminserver (oncalladminserver) will be updated in-place
                                    ~ resource "pritunl_server" "oncalladminserver" {
                                          id                 = "66d86f9c62ffb695dea99daf"
                                          name               = "oncalladmin"
                                        ~ status             = "offline" -> "online"
                                          # (34 unchanged attributes hidden)

                                        ~ route {
                                            ~ nat         = false -> true
                                              # (3 unchanged attributes hidden)
                                          }
                                        ~ route {
                                            + comment     = "DNS Server"
                                            ~ nat         = false -> true
                                            + network     = "10.7.0.2/32"
                                              # (1 unchanged attribute hidden)
                                          }

Its trying to change some routes and it returns that error

disc commented 3 months ago

Hey @gkaskonas. Can you share your state of routes (from terraform state file) before applying new changes? It tries to delete a route but receives 404 error (probably route can't be found) in response, and I'd like to see which route can't be deleted.

gkaskonas commented 2 weeks ago

Sorry for the late reply.

{
  "version": 4,
  "terraform_version": "1.7.2",
  "serial": 76,
  "lineage": "28cbb6c9-3f6b-1146-a2e4-46a11eee4a4b",
  "outputs": {},
  "resources": [
    {
      "mode": "data",
      "type": "aws_secretsmanager_secret_version",
      "name": "Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "arn": "arn:aws:secretsmanager:us-east-1:498701407125:secret:/tools/devops/pritunl-cqJNvf",
            "created_date": "2024-01-31T17:52:56Z",
            "id": "/tools/devops/pritunl|AWSCURRENT",
            "secret_binary": "",
            "secret_id": "/tools/devops/pritunl",
            "secret_string": "xxxxxxxxxxx",
            "version_id": "5ba02431-718c-4c31-8bc4-31c4dc6656b2",
            "version_stage": "AWSCURRENT",
            "version_stages": [
              "AWSCURRENT"
            ]
          },
          "sensitive_attributes": []
        }
      ]
    },
    {
      "mode": "data",
      "type": "aws_secretsmanager_secret_version",
      "name": "Params-stack_PRITUNL_TOKEN-secretString_BC928372",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "arn": "arn:aws:secretsmanager:us-east-1:498701407125:secret:/tools/devops/pritunl-cqJNvf",
            "created_date": "2024-01-31T17:52:56Z",
            "id": "/tools/devops/pritunl|AWSCURRENT",
            "secret_binary": "",
            "secret_id": "/tools/devops/pritunl",
            "secret_string": "xxxxxxxxxxx",
            "version_id": "5ba02431-718c-4c31-8bc4-31c4dc6656b2",
            "version_stage": "AWSCURRENT",
            "version_stages": [
              "AWSCURRENT"
            ]
          },
          "sensitive_attributes": []
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "defaultorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "6528fad7aa64fa4ebaa6168c",
            "name": "default"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "dsprodorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "6528fad6aa64fa4ebaa61658",
            "name": "dsprod"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "graphprodorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "6528fad7aa64fa4ebaa6166b",
            "name": "graphprod"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "nonprodorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "642595322480f3778c61f2a2",
            "name": "nonprod"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "oncalladminorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "6528fad7aa64fa4ebaa61679",
            "name": "oncalladmin"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "productorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "6528fad7aa64fa4ebaa6166f",
            "name": "product"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_organization",
      "name": "qaorganisation",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "6601a642aa64fa4eba561cfc",
            "name": "qa"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "defaultserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9c62ffb695dea99dac",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "default",
            "network": "192.168.250.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.242.0/24",
            "organization_ids": [
              "6528fad7aa64fa4ebaa6168c"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 15997,
            "port_wg": 14473,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "dev-eks-internal-ingress",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.94.214/32"
              },
              {
                "comment": "dev-eks-internal-ingress",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.106.87/32"
              },
              {
                "comment": "graph-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.175.0/24"
              },
              {
                "comment": "graph-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.176.0/24"
              },
              {
                "comment": "graph-staging-use1c (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.35.0/24"
              },
              {
                "comment": "graph-staging-use1d (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.36.0/24"
              },
              {
                "comment": "Grafana",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.81.29/32"
              },
              {
                "comment": "Grafana",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.101.60/32"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.defaultorganisation"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "dsprodserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9c62ffb695dea99db2",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "dsprod",
            "network": "192.168.249.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.241.0/24",
            "organization_ids": [
              "6528fad6aa64fa4ebaa61658"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 15996,
            "port_wg": 13918,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "DEV VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.1.0.0/16"
              },
              {
                "comment": "STAGING VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.0.0/16"
              },
              {
                "comment": "DEV EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.0.0/16"
              },
              {
                "comment": "STAGING EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.12.0.0/16"
              },
              {
                "comment": "TOOLS EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.0.0/16"
              },
              {
                "comment": "TOOLS VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.0/16"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              },
              {
                "comment": "graph-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.175.0/24"
              },
              {
                "comment": "graph-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.176.0/24"
              },
              {
                "comment": "graph-staging-use1c (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.35.0/24"
              },
              {
                "comment": "graph-staging-use1d (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.36.0/24"
              },
              {
                "comment": "devops-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.185.0/24"
              },
              {
                "comment": "devops-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.186.0/24"
              },
              {
                "comment": "ds-vpnaccess-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.237.0/24"
              },
              {
                "comment": "ds-vpnaccess-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.238.0/24"
              },
              {
                "comment": "ds-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.170.0/24"
              },
              {
                "comment": "ds-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.171.0/24"
              },
              {
                "comment": "es-metrics-kibana-prod",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.80.118/32"
              },
              {
                "comment": "es-metrics-prod",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.87.252/32"
              },
              {
                "comment": "es-metrics-prod-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.97.72/32"
              },
              {
                "comment": "ds-emr-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.235.0/24"
              },
              {
                "comment": "ds-emr-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.236.0/24"
              },
              {
                "comment": "es-report-stats",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.60.0/24"
              },
              {
                "comment": "",
                "nat": false,
                "net_gateway": false,
                "network": ""
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.dsprodorganisation"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "graphprodserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9c62ffb695dea99dad",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "graphprod",
            "network": "192.168.232.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.240.0/24",
            "organization_ids": [
              "6528fad7aa64fa4ebaa6166b"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 12718,
            "port_wg": 14472,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "DEV VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.1.0.0/16"
              },
              {
                "comment": "STAGING VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.0.0/16"
              },
              {
                "comment": "DEV EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.0.0/16"
              },
              {
                "comment": "STAGING EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.12.0.0/16"
              },
              {
                "comment": "TOOLS EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.0.0/16"
              },
              {
                "comment": "TOOLS VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.0/16"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              },
              {
                "comment": "archives-metastore-staging",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.102.27/32"
              },
              {
                "comment": "archives-metastore-staging",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.218/32"
              },
              {
                "comment": "postgresql-metrics.dc.staging-1",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.148/32"
              },
              {
                "comment": "postgresql-metrics.dc.staging-1",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.204/32"
              },
              {
                "comment": "mongo shelves",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.29/32"
              },
              {
                "comment": "graph-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.175.0/24"
              },
              {
                "comment": "graph-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.176.0/24"
              },
              {
                "comment": "graph-staging-use1c (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.35.0/24"
              },
              {
                "comment": "graph-staging-use1d (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.36.0/24"
              },
              {
                "comment": "devops-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.185.0/24"
              },
              {
                "comment": "devops-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.186.0/24"
              },
              {
                "comment": "ds-vpnaccess-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.237.0/24"
              },
              {
                "comment": "ds-vpnaccess-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.238.0/24"
              },
              {
                "comment": "ds-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.170.0/24"
              },
              {
                "comment": "ds-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.171.0/24"
              },
              {
                "comment": "es-metrics-kibana-prod",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.80.118/32"
              },
              {
                "comment": "dc-business-db-prod",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.60.0/24"
              },
              {
                "comment": "dc-business-db-prod",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.61.0/24"
              },
              {
                "comment": "dc-business-db-prod",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.62.0/24"
              },
              {
                "comment": "legacy-use1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.225.0/24"
              },
              {
                "comment": "legacy-use1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.226.0/24"
              },
              {
                "comment": "i-31b3a680.mongodb-shelves.dc.prod-1.deepcrawl.com",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.97/32"
              },
              {
                "comment": "",
                "nat": false,
                "net_gateway": false,
                "network": ""
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.graphprodorganisation"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "nonprodserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9c62ffb695dea99db1",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "nonprod",
            "network": "192.168.227.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.238.0/24",
            "organization_ids": [
              "642595322480f3778c61f2a2"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 13362,
            "port_wg": 12114,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "DEV VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.1.0.0/16"
              },
              {
                "comment": "STAGING VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.0.0/16"
              },
              {
                "comment": "DEV EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.0.0/16"
              },
              {
                "comment": "STAGING EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.12.0.0/16"
              },
              {
                "comment": "TOOLS EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.0.0/16"
              },
              {
                "comment": "TOOLS VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.0/16"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              },
              {
                "comment": "archives-metastore-staging",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.102.27/32"
              },
              {
                "comment": "archives-metastore-staging",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.218/32"
              },
              {
                "comment": "postgresql-metrics.dc.staging-1",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.148/32"
              },
              {
                "comment": "postgresql-metrics.dc.staging-1",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.204/32"
              },
              {
                "comment": "mongo shelves",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.15.29/32"
              },
              {
                "comment": "graph-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.175.0/24"
              },
              {
                "comment": "graph-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.176.0/24"
              },
              {
                "comment": "graph-staging-use1c (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.35.0/24"
              },
              {
                "comment": "graph-staging-use1d (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.36.0/24"
              },
              {
                "comment": "devops-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.185.0/24"
              },
              {
                "comment": "devops-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.186.0/24"
              },
              {
                "comment": "",
                "nat": false,
                "net_gateway": false,
                "network": ""
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.nonprodorganisation"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "oncalladminserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9c62ffb695dea99daf",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "oncalladmin",
            "network": "192.168.225.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.239.0/24",
            "organization_ids": [
              "6528fad7aa64fa4ebaa61679"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 10736,
            "port_wg": 14471,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "DEV VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.1.0.0/16"
              },
              {
                "comment": "STAGING VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.0.0/16"
              },
              {
                "comment": "DEV EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.0.0/16"
              },
              {
                "comment": "STAGING EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.12.0.0/16"
              },
              {
                "comment": "TOOLS EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.0.0/16"
              },
              {
                "comment": "TOOLS VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.0/16"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              },
              {
                "comment": "PROD VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.0.0/16"
              },
              {
                "comment": "PROD EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.0.0/16"
              },
              {
                "comment": "",
                "nat": false,
                "net_gateway": false,
                "network": ""
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.oncalladminorganisation"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "productserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9c62ffb695dea99dae",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "product",
            "network": "192.168.218.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.237.0/24",
            "organization_ids": [
              "6528fad7aa64fa4ebaa6166f"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 10997,
            "port_wg": 13919,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "Grafana",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.81.29/32"
              },
              {
                "comment": "Grafana",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.101.60/32"
              },
              {
                "comment": "devops-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.185.0/24"
              },
              {
                "comment": "devops-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.186.0/24"
              },
              {
                "comment": "graph-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.175.0/24"
              },
              {
                "comment": "graph-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.176.0/24"
              },
              {
                "comment": "graph-staging-use1c (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.35.0/24"
              },
              {
                "comment": "graph-staging-use1d (Duncan and API)",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.36.0/24"
              },
              {
                "comment": "ds-vpnaccess-subnet-1c",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.237.0/24"
              },
              {
                "comment": "ds-vpnaccess-subnet-1d",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.238.0/24"
              },
              {
                "comment": "dev-eks-internal-ingress",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.94.214/32"
              },
              {
                "comment": "dev-eks-internal-ingress",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.106.87/32"
              },
              {
                "comment": "API ELB Subnet",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.13.0/24"
              },
              {
                "comment": "legacy-use1c (Internal App)",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.225.0/24"
              },
              {
                "comment": "legacy-use1d (Internal App)",
                "nat": true,
                "net_gateway": false,
                "network": "10.0.226.0/24"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.productorganisation"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "pritunl_server",
      "name": "qaserver",
      "provider": "provider[\"registry.terraform.io/disc/pritunl\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "allowed_devices": "",
            "bind_address": "",
            "block_outside_dns": false,
            "cipher": "aes128",
            "debug": false,
            "device_auth": false,
            "dh_param_bits": 2048,
            "dns_mapping": false,
            "dns_servers": [
              "10.7.0.2",
              "8.8.8.8"
            ],
            "dynamic_firewall": false,
            "groups": null,
            "hash": "sha1",
            "host_ids": [
              "570a96d003264ec38e7f184a03ceab48"
            ],
            "id": "66d86f9b62ffb695dea99da2",
            "inactive_timeout": 0,
            "inter_client": false,
            "ipv6": false,
            "link_ping_interval": 1,
            "link_ping_timeout": 5,
            "max_clients": 2000,
            "max_devices": 0,
            "mss_fix": 0,
            "multi_device": false,
            "name": "qa",
            "network": "192.168.251.0/24",
            "network_end": "",
            "network_mode": "tunnel",
            "network_start": "",
            "network_wg": "192.168.243.0/24",
            "organization_ids": [
              "6601a642aa64fa4eba561cfc"
            ],
            "otp_auth": false,
            "ping_interval": 30,
            "ping_timeout": 300,
            "port": 15998,
            "port_wg": 14474,
            "pre_connect_msg": "",
            "protocol": "udp",
            "replica_count": 1,
            "restrict_routes": false,
            "route": [
              {
                "comment": "DEV VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.1.0.0/16"
              },
              {
                "comment": "STAGING VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.2.0.0/16"
              },
              {
                "comment": "DEV EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.11.0.0/16"
              },
              {
                "comment": "STAGING EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.12.0.0/16"
              },
              {
                "comment": "TOOLS EKS",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.0.0/16"
              },
              {
                "comment": "TOOLS VPC",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.0/16"
              },
              {
                "comment": "DNS Server",
                "nat": true,
                "net_gateway": false,
                "network": "10.7.0.2/32"
              },
              {
                "comment": "Grafana",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.81.29/32"
              },
              {
                "comment": "Grafana",
                "nat": true,
                "net_gateway": false,
                "network": "10.17.101.60/32"
              },
              {
                "comment": "eks-internal-ingress",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.80.118/32"
              },
              {
                "comment": "eks-internal-ingress2",
                "nat": true,
                "net_gateway": false,
                "network": "10.10.111.54/32"
              },
              {
                "comment": "",
                "nat": false,
                "net_gateway": false,
                "network": ""
              }
            ],
            "search_domain": "",
            "session_timeout": 0,
            "sso_auth": false,
            "status": "online",
            "vxlan": false
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_SECRET-secretString_218EDC3B",
            "data.aws_secretsmanager_secret_version.Params-stack_PRITUNL_TOKEN-secretString_BC928372",
            "pritunl_organization.qaorganisation"
          ]
        }
      ]
    }
  ],
  "check_results": null
}

Here is my state file

gkaskonas commented 1 week ago

Seems like the issue was with duplicate DNS Server entry in the routes. Terraform was getting confused about which one to update and delete. Fixing the configuration fixed the state as well