feat(iaas): support for v2 API (#1070)

relates to STACKITTPR-313
This commit is contained in:
Ruben Hönle 2025-12-17 15:40:46 +01:00 committed by GitHub
parent 460c18c202
commit 53a3697850
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
124 changed files with 8342 additions and 6042 deletions

View file

@ -0,0 +1,4 @@
data "stackit_network_area_region" "example" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

View file

@ -7,5 +7,5 @@ resource "stackit_affinity_group" "example" {
# Only use the import statement, if you want to import an existing affinity group
import {
to = stackit_affinity_group.import-example
id = "${var.project_id},${var.affinity_group_id}"
id = "${var.project_id},${var.region},${var.affinity_group_id}"
}

View file

@ -16,5 +16,5 @@ resource "stackit_image" "example_image" {
# }
import {
to = stackit_image.import-example
id = "${var.project_id},${var.image_id}"
id = "${var.project_id},${var.region},${var.image_id}"
}

View file

@ -13,12 +13,11 @@ resource "stackit_network" "example_routed_network" {
}
resource "stackit_network" "example_non_routed_network" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-non-routed-network"
ipv4_nameservers = ["1.2.3.4", "5.6.7.8"]
ipv4_prefix_length = 24
ipv4_gateway = "10.1.2.3"
ipv4_prefix = "10.1.2.0/24"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-non-routed-network"
ipv4_nameservers = ["1.2.3.4", "5.6.7.8"]
ipv4_gateway = "10.1.2.3"
ipv4_prefix = "10.1.2.0/24"
labels = {
"key" = "value"
}
@ -30,5 +29,5 @@ resource "stackit_network" "example_non_routed_network" {
# These attributes cannot be configured together: [ipv4_prefix,ipv4_prefix_length,ipv4_gateway]
import {
to = stackit_network.import-example
id = "${var.project_id},${var.network_id}"
}
id = "${var.project_id},${var.region},${var.network_id}"
}

View file

@ -1,12 +1,6 @@
resource "stackit_network_area" "example" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-network-area"
network_ranges = [
{
prefix = "192.168.0.0/24"
}
]
transfer_network = "192.168.1.0/24"
labels = {
"key" = "value"
}

View file

@ -0,0 +1,18 @@
resource "stackit_network_area_region" "example" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
ipv4 = {
transfer_network = "10.1.2.0/24"
network_ranges = [
{
prefix = "10.0.0.0/16"
}
]
}
}
# Only use the import statement, if you want to import an existing network area region
import {
to = stackit_network_area_region.import-example
id = "${var.organization_id},${var.network_area_id},${var.region}"
}

View file

@ -1,8 +1,14 @@
resource "stackit_network_area_route" "example" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
prefix = "192.168.0.0/24"
next_hop = "192.168.0.0"
destination = {
type = "cidrv4"
value = "192.168.0.0/24"
}
next_hop = {
type = "ipv4"
value = "192.168.0.0"
}
labels = {
"key" = "value"
}
@ -11,5 +17,5 @@ resource "stackit_network_area_route" "example" {
# Only use the import statement, if you want to import an existing network area route
import {
to = stackit_network_area_route.import-example
id = "${var.organization_id},${var.network_area_id},${var.network_area_route_id}"
}
id = "${var.organization_id},${var.network_area_id},${var.region},${var.network_area_route_id}"
}

View file

@ -8,5 +8,5 @@ resource "stackit_network_interface" "example" {
# Only use the import statement, if you want to import an existing network interface
import {
to = stackit_network_interface.import-example
id = "${var.project_id},${var.network_id},${var.network_interface_id}"
id = "${var.project_id},${var.region},${var.network_id},${var.network_interface_id}"
}

View file

@ -9,5 +9,5 @@ resource "stackit_public_ip" "example" {
# Only use the import statement, if you want to import an existing public ip
import {
to = stackit_public_ip.import-example
id = "${var.project_id},${var.public_ip_id}"
id = "${var.project_id},${var.region},${var.public_ip_id}"
}

View file

@ -7,5 +7,5 @@ resource "stackit_public_ip_associate" "example" {
# Only use the import statement, if you want to import an existing public ip associate
import {
to = stackit_public_ip_associate.import-example
id = "${var.project_id},${var.public_ip_id},${var.network_interface_id}"
id = "${var.project_id},${var.region},${var.public_ip_id},${var.network_interface_id}"
}

View file

@ -23,5 +23,5 @@ resource "stackit_server" "example" {
# }
import {
to = stackit_server.import-example
id = "${var.project_id},${var.server_id}"
id = "${var.project_id},${var.region},${var.server_id}"
}

View file

@ -7,5 +7,5 @@ resource "stackit_server_network_interface_attach" "attached_network_interface"
# Only use the import statement, if you want to import an existing server network interface attachment
import {
to = stackit_server_network_interface_attach.import-example
id = "${var.project_id},${var.server_id},${var.network_interface_id}"
id = "${var.project_id},${var.region},${var.server_id},${var.network_interface_id}"
}

View file

@ -7,5 +7,5 @@ resource "stackit_server_service_account_attach" "attached_service_account" {
# Only use the import statement, if you want to import an existing server service account attachment
import {
to = stackit_server_service_account_attach.import-example
id = "${var.project_id},${var.server_id},${var.service_account_email}"
id = "${var.project_id},${var.region},${var.server_id},${var.service_account_email}"
}

View file

@ -7,5 +7,5 @@ resource "stackit_server_volume_attach" "attached_volume" {
# Only use the import statement, if you want to import an existing server volume attachment
import {
to = stackit_server_volume_attach.import-example
id = "${var.project_id},${var.server_id},${var.volume_id}"
id = "${var.project_id},${var.region},${var.server_id},${var.volume_id}"
}

View file

@ -11,5 +11,5 @@ resource "stackit_volume" "example" {
# Only use the import statement, if you want to import an existing volume
import {
to = stackit_volume.import-example
id = "${var.project_id},${var.volume_id}"
id = "${var.project_id},${var.region},${var.volume_id}"
}