terraform-provider-openvpn-cloud
terraform-provider-openvpn-cloud copied to clipboard
Adding "Application" resource
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?
any progress on this?
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 One more question. Will this 'Application' resource be available immediately in the new version or will we have to wait for another version?
@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):
- Routes
- Networking
- Services (converted to ip-services, which include routes and services)
- Applications
From what has been added during this time:
- Devices
- Sessions
- Ability to get a profile for the connector
- ...there is a lot more
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.