terraform-provider-stackitp.../examples/resources/stackit_network/resource.tf
Alexander Dahmen 721e10a02f
chore(examples): Add import examples for all resources (#939)
* chore(examples): Add import examples for all resources

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>

* Add guide: How to import resources

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>

---------

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
2025-08-08 14:03:27 +02:00

34 lines
No EOL
1 KiB
HCL

resource "stackit_network" "example_with_name" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-with-name"
}
resource "stackit_network" "example_routed_network" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-routed-network"
labels = {
"key" = "value"
}
routed = true
}
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"
labels = {
"key" = "value"
}
routed = false
}
# Only use the import statement, if you want to import an existing network
# Note: There will be a conflict which needs to be resolved manually.
# 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}"
}