Skip to content

Commit

Permalink
Merge pull request #72 from appuio/feat/lb-security-groups-by-id
Browse files Browse the repository at this point in the history
Switch LB module security group inputs and outputs to IDs
  • Loading branch information
simu authored Nov 1, 2022
2 parents df29c94 + 293db1d commit b290169
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lb.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "lb" {
source = "git::https://github.com/appuio/terraform-modules.git//modules/vshn-lbaas-exoscale?ref=v4.1.0"
source = "git::https://github.com/appuio/terraform-modules.git//modules/vshn-lbaas-exoscale?ref=v4.2.0"

exoscale_domain_name = exoscale_domain.cluster.name
cluster_network = {
Expand All @@ -21,8 +21,8 @@ module "lb" {
enable_proxy_protocol = var.lb_enable_proxy_protocol
additional_networks = var.additional_lb_networks

cluster_security_group_names = [
exoscale_security_group.all_machines.name
cluster_security_group_ids = [
exoscale_security_group.all_machines.id
]

additional_affinity_group_ids = var.additional_affinity_group_ids
Expand Down
8 changes: 2 additions & 6 deletions security_groups.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
data "exoscale_security_group" "lb" {
name = module.lb.security_group_name
depends_on = [module.lb]
}
# https://docs.openshift.com/container-platform/4.7/installing/installing_bare_metal/installing-bare-metal.html#installation-network-user-infra_installing-bare-metal
resource "exoscale_security_group" "all_machines" {
name = "${var.cluster_id}_all_machines"
Expand Down Expand Up @@ -117,7 +113,7 @@ resource "exoscale_security_group_rule" "control_plane_machine_config_server" {
start_port = "22623"
end_port = "22623"

user_security_group_id = data.exoscale_security_group.lb.id
user_security_group_id = module.lb.security_group_id
}
resource "exoscale_security_group_rule" "control_plane_kubernetes_api" {
security_group_id = exoscale_security_group.control_plane.id
Expand Down Expand Up @@ -149,7 +145,7 @@ resource "exoscale_security_group_rule" "infra" {
start_port = each.value
end_port = each.value

user_security_group_id = data.exoscale_security_group.lb.id
user_security_group_id = module.lb.security_group_id
}

resource "exoscale_security_group" "storage" {
Expand Down

0 comments on commit b290169

Please sign in to comment.