mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 19:46:07 -04:00
terraform: add subnet for OpenStack LBs
This commit is contained in:
parent
9d164de18b
commit
1e987f6a85
8 changed files with 75 additions and 10 deletions
|
@ -17,6 +17,19 @@ resource "random_id" "uid" {
|
|||
byte_length = 4
|
||||
}
|
||||
|
||||
resource "openstack_networking_port_v2" "port" {
|
||||
name = "${local.name}-${count.index}"
|
||||
count = var.initial_count
|
||||
admin_state_up = "true"
|
||||
|
||||
network_id = var.network_id
|
||||
fixed_ip {
|
||||
subnet_id = var.subnet_id
|
||||
}
|
||||
|
||||
security_group_ids = var.security_groups
|
||||
}
|
||||
|
||||
# TODO(malt3): get this API enabled in the test environment
|
||||
# resource "openstack_compute_servergroup_v2" "instance_group" {
|
||||
# name = local.name
|
||||
|
@ -24,18 +37,17 @@ resource "random_id" "uid" {
|
|||
# }
|
||||
|
||||
resource "openstack_compute_instance_v2" "instance_group_member" {
|
||||
name = "${local.name}-${count.index}"
|
||||
count = var.initial_count
|
||||
image_id = var.image_id
|
||||
flavor_id = var.flavor_id
|
||||
security_groups = var.security_groups
|
||||
tags = local.tags
|
||||
name = "${local.name}-${count.index}"
|
||||
count = var.initial_count
|
||||
image_id = var.image_id
|
||||
flavor_id = var.flavor_id
|
||||
tags = local.tags
|
||||
# TODO(malt3): get this API enabled in the test environment
|
||||
# scheduler_hints {
|
||||
# group = openstack_compute_servergroup_v2.instance_group.id
|
||||
# }
|
||||
network {
|
||||
uuid = var.network_id
|
||||
port = openstack_networking_port_v2.port[count.index].id
|
||||
}
|
||||
block_device {
|
||||
uuid = var.image_id
|
||||
|
|
|
@ -7,3 +7,8 @@ output "instance_ids" {
|
|||
value = openstack_compute_instance_v2.instance_group_member.*.id
|
||||
description = "IDs of the instances."
|
||||
}
|
||||
|
||||
output "port_ids" {
|
||||
value = openstack_networking_port_v2.port.*.id
|
||||
description = "IDs of ports of the instances."
|
||||
}
|
||||
|
|
|
@ -67,6 +67,11 @@ variable "network_id" {
|
|||
description = "Network ID to attach each node to."
|
||||
}
|
||||
|
||||
variable "subnet_id" {
|
||||
type = string
|
||||
description = "Subnetwork ID to attach each node to."
|
||||
}
|
||||
|
||||
variable "init_secret_hash" {
|
||||
type = string
|
||||
description = "Hash of the init secret."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue