terraform-provider-openvpn-cloud icon indicating copy to clipboard operation
terraform-provider-openvpn-cloud copied to clipboard

Adding "Application" resource

Open coffeedev2k opened this issue 1 year ago • 4 comments

Some time ago we used next configuration of our openvpn network in out terraform code:

# Create network, default connector and private domain
resource "openvpncloud_network" "network" {
  provider = openvpn-cloud
  name  = "${var.exchange_name}-${var.exchange_environment}"
  internet_access = "LOCAL"
  egress = false
  description = "${var.exchange_name}-${var.exchange_environment} network"

  default_connector {
    name = "${var.exchange_name}-${var.exchange_environment}"
    vpn_region_id = var.vpn_region_id
  }

  default_route {
    type = "DOMAIN"
    value = "${var.exchange_name}-${var.exchange_environment}.local"
  }
}

But after some moment terraform lost ability to create default_route with type "DOMAIN". It failed with 400 error. This happened because of moving type = "DOMAIN" to "Applications" Now, working network looks like(jsons, getting from Swagger of Cloudconnexa): NETWORK:

{
  "id": "7eae1a4f-1357-446f-9adb-2e384088ad7e",
  "name": "exchange_name-exchange_environment",
  "description": "exchange_name-exchange_environment network",
  "egress": false,
  "internetAccess": "LOCAL",
  "routes": [
    {
      "id": "e5eebbfb-1997-4e2d-a01d-8ec493538a9f",
      "type": "IP_V4",
      "subnet": "192.168.111.0/24",
      "description": "Managed by Terraform."
    }
  ],
  "connectors": [
    {
      "id": "572f7d17-a880-499a-8767-303107971794",
      "networkItemId": "7eae1a4f-1357-446f-9adb-2e384088ad7e",
      "networkItemType": "NETWORK",
      "name": "exchange_name-exchange_environment",
      "vpnRegionId": "ie-dub",
      "ipV4Address": "100.96.100.162/28",
      "ipV6Address": "fd:0:0:840a::2/64"
    },
    {
      "id": "8b6e03d0-7f6d-4073-8e9e-be637ee9d53f",
      "networkItemId": "7eae1a4f-1357-446f-9adb-2e384088ad7e",
      "networkItemType": "NETWORK",
      "name": "test_connector",
      "vpnRegionId": "fi-hel",
      "ipV4Address": "100.96.100.166/28",
      "ipV6Address": "fd:0:0:840a::6/64"
    }
  ],
  "systemSubnets": [
    "100.96.100.160/28",
    "fd:0:0:840a::/64"
  ]
}

And it works with DOMAIN routing only with "Application" look like next: APPLICATION:

{
  "id": "f4b350a2-49c1-43c9-bb6a-6da9a13b8ca5",
  "name": "exchange_name-exchange_environment",
  "networkItemId": "7eae1a4f-1357-446f-9adb-2e384088ad7e",
  "type": "SERVICE_DESTINATION",
  "networkItemType": "NETWORK",
  "routes": [
    {
      "id": "9e71eb81-db54-434b-92f5-2dcc56e48414",
      "type": "DOMAIN",
      "domain": "exchange_name-exchange_environment.local",
      "allowEmbeddedIp": true
    }
  ],
  "config": {
    "serviceTypes": [
      "ANY"
    ]
  }
},

Now we cannot work without creating "Application" in our network by hands. Therefore, maybe creation of resource "Application" is not bad idea?

coffeedev2k avatar Aug 04 '23 16:08 coffeedev2k

any progress on this?

dtwilliamsWork avatar Jan 09 '24 15:01 dtwilliamsWork

Hi @dtwilliamsWork, we are currently working on a new version. In which we redesign the provider for the new API OpenVPN Cloud (CloudConnexa).

We are open to any help from you.

arslanbekov avatar Jan 09 '24 15:01 arslanbekov

@arslanbekov One more question. Will this 'Application' resource be available immediately in the new version or will we have to wait for another version?

bwesolowskicf avatar Jan 10 '24 12:01 bwesolowskicf

@bwesolowskicf, at this moment in time, I am rewriting an existing provider so that it starts working as expected.

From what has changed (I focus on these changes):

  1. Routes
  2. Networking
  3. Services (converted to ip-services, which include routes and services)
  4. Applications

From what has been added during this time:

  1. Devices
  2. Sessions
  3. Ability to get a profile for the connector
  4. ...there is a lot more

arslanbekov avatar Jan 10 '24 12:01 arslanbekov

We've published new version of Terraform Provider to Registry: https://registry.terraform.io/providers/OpenVPN/cloudconnexa/latest

Going forward only https://registry.terraform.io/providers/OpenVPN/cloudconnexa/latest will be developed.

Please give new provider a try, hopefully it will fix your issue.

In case if problem persists - please open new "Issue" (https://github.com/OpenVPN/terraform-provider-cloudconnexa/issues)

Sorry for inconvenience.

sahaqaa avatar May 09 '24 13:05 sahaqaa