terraform-iaas-api-basic-ha.../06-ha.tf
Mauritz Uphoff 6a5f928648
All checks were successful
CI / Terraform Format & Validate (push) Successful in 14s
CI / TruffleHog Secrets Scan (push) Successful in 55s
Initial commit
2025-06-10 16:32:16 +02:00

30 lines
1.3 KiB
HCL

/*
Copyright 2023 Schwarz IT KG <markus.brunsch@mail.schwarz>
Copyright 2024-2025 STACKIT GmbH & Co. KG <markus.brunsch@stackit.cloud>
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
# Create VIP Port
#resource "terraform_data" "spoke-local-1" {
# provisioner "local-exec" {
# command = "curl --location 'https://iaas.api.eu01.stackit.cloud/v1alpha1/projects/${var.STACKIT_PROJECT_ID}/networks/${stackit_network.default.network_id}/virtual-ips' --header 'Content-Type: application/json' --header 'Authorization: Bearer ${var.STACKIT_SERVICE_ACCOUNT_TOKEN}' --data '{\"ip\":\"10.1.2.10\",\"labels\":{\"key\":\"sap\"},\"members\":[\"${stackit_network_interface.example01.network_interface_id}\",\"${stackit_network_interface.example02.network_interface_id}\"],\"name\":\"vip01\"}'"
# }
# depends_on = [
# stackit_network_interface.example01,
# stackit_network_interface.example02
# ]
#}
resource "stackit_network_interface" "vip01" {
project_id = var.STACKIT_PROJECT_ID
network_id = stackit_network.default.network_id
security = false
}
resource "stackit_public_ip" "vip01-wan" {
project_id = var.STACKIT_PROJECT_ID
network_interface_id = stackit_network_interface.vip01.network_interface_id
}