Resolve IaC conflict by rename old microk8s group

This commit is contained in:
Magnus Andersson 2024-10-22 09:21:56 +02:00
parent 3f07468b64
commit 855613625e
Signed by: mandersson
GPG key ID: 1F7C896B34B28164
3 changed files with 47 additions and 47 deletions

View file

@ -12,7 +12,7 @@ resource "openstack_networking_port_v2" "kubecport" {
security_group_ids = [ security_group_ids = [
data.openstack_networking_secgroup_v2.sshfromjumphosts.id, data.openstack_networking_secgroup_v2.sshfromjumphosts.id,
data.openstack_networking_secgroup_v2.allegress.id, data.openstack_networking_secgroup_v2.allegress.id,
resource.openstack_networking_secgroup_v2.microk8s.id, resource.openstack_networking_secgroup_v2.microk8s-old.id,
resource.openstack_networking_secgroup_v2.microk8s-dco.id, resource.openstack_networking_secgroup_v2.microk8s-dco.id,
resource.openstack_networking_secgroup_v2.https.id resource.openstack_networking_secgroup_v2.https.id
] ]
@ -36,7 +36,7 @@ resource "openstack_compute_instance_v2" "controller-nodes" {
security_groups = [ security_groups = [
data.openstack_networking_secgroup_v2.sshfromjumphosts.name, data.openstack_networking_secgroup_v2.sshfromjumphosts.name,
data.openstack_networking_secgroup_v2.allegress.name, data.openstack_networking_secgroup_v2.allegress.name,
resource.openstack_networking_secgroup_v2.microk8s.id, resource.openstack_networking_secgroup_v2.microk8s-old.id,
resource.openstack_networking_secgroup_v2.microk8s-dco.id, resource.openstack_networking_secgroup_v2.microk8s-dco.id,
resource.openstack_networking_secgroup_v2.https.name resource.openstack_networking_secgroup_v2.https.name
] ]
@ -67,7 +67,7 @@ resource "openstack_networking_port_v2" "kubewport" {
security_group_ids = [ security_group_ids = [
data.openstack_networking_secgroup_v2.sshfromjumphosts.id, data.openstack_networking_secgroup_v2.sshfromjumphosts.id,
data.openstack_networking_secgroup_v2.allegress.id, data.openstack_networking_secgroup_v2.allegress.id,
resource.openstack_networking_secgroup_v2.microk8s.id resource.openstack_networking_secgroup_v2.microk8s-old.id
] ]
admin_state_up = "true" admin_state_up = "true"
} }
@ -98,7 +98,7 @@ resource "openstack_compute_instance_v2" "worker-nodes" {
security_groups = [ security_groups = [
data.openstack_networking_secgroup_v2.sshfromjumphosts.name, data.openstack_networking_secgroup_v2.sshfromjumphosts.name,
data.openstack_networking_secgroup_v2.allegress.name, data.openstack_networking_secgroup_v2.allegress.name,
resource.openstack_networking_secgroup_v2.microk8s.name resource.openstack_networking_secgroup_v2.microk8s-old.name
] ]
block_device { block_device {

View file

@ -1,5 +1,5 @@
# Security groups sto3 # Security groups dco
resource "openstack_networking_secgroup_v2" "microk8s-dco" { resource "openstack_networking_secgroup_v2" "microk8s-dco" {
name = "microk8s" name = "microk8s"
description = "Traffic to allow between microk8s hosts" description = "Traffic to allow between microk8s hosts"

View file

@ -7,8 +7,8 @@ data "openstack_networking_secgroup_v2" "allegress" {
name = "allegress" name = "allegress"
} }
resource "openstack_networking_secgroup_v2" "microk8s" { resource "openstack_networking_secgroup_v2" "microk8s-old" {
name = "microk8s" name = "microk8s-old"
description = "Traffic to allow between microk8s hosts" description = "Traffic to allow between microk8s hosts"
} }
@ -18,8 +18,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule1" {
protocol = "tcp" protocol = "tcp"
port_range_min = 16443 port_range_min = 16443
port_range_max = 16443 port_range_max = 16443
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule2" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule2" {
direction = "ingress" direction = "ingress"
@ -27,8 +27,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule2" {
protocol = "tcp" protocol = "tcp"
port_range_min = 16443 port_range_min = 16443
port_range_max = 16443 port_range_max = 16443
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule3" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule3" {
@ -37,8 +37,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule3" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10250 port_range_min = 10250
port_range_max = 10250 port_range_max = 10250
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule4" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule4" {
direction = "ingress" direction = "ingress"
@ -46,8 +46,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule4" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10250 port_range_min = 10250
port_range_max = 10250 port_range_max = 10250
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule5" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule5" {
@ -56,8 +56,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule5" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10255 port_range_min = 10255
port_range_max = 10255 port_range_max = 10255
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule6" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule6" {
direction = "ingress" direction = "ingress"
@ -65,8 +65,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule6" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10255 port_range_min = 10255
port_range_max = 10255 port_range_max = 10255
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule7" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule7" {
direction = "ingress" direction = "ingress"
@ -74,8 +74,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule7" {
protocol = "tcp" protocol = "tcp"
port_range_min = 25000 port_range_min = 25000
port_range_max = 25000 port_range_max = 25000
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule8" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule8" {
direction = "ingress" direction = "ingress"
@ -83,8 +83,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule8" {
protocol = "tcp" protocol = "tcp"
port_range_min = 25000 port_range_min = 25000
port_range_max = 25000 port_range_max = 25000
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule9" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule9" {
direction = "ingress" direction = "ingress"
@ -92,8 +92,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule9" {
protocol = "tcp" protocol = "tcp"
port_range_min = 12379 port_range_min = 12379
port_range_max = 12379 port_range_max = 12379
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule10" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule10" {
direction = "ingress" direction = "ingress"
@ -101,8 +101,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule10" {
protocol = "tcp" protocol = "tcp"
port_range_min = 12379 port_range_min = 12379
port_range_max = 12379 port_range_max = 12379
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule11" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule11" {
direction = "ingress" direction = "ingress"
@ -110,8 +110,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule11" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10257 port_range_min = 10257
port_range_max = 10257 port_range_max = 10257
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule12" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule12" {
direction = "ingress" direction = "ingress"
@ -119,8 +119,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule12" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10257 port_range_min = 10257
port_range_max = 10257 port_range_max = 10257
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule13" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule13" {
direction = "ingress" direction = "ingress"
@ -128,8 +128,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule13" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10259 port_range_min = 10259
port_range_max = 10259 port_range_max = 10259
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule14" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule14" {
direction = "ingress" direction = "ingress"
@ -137,8 +137,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule14" {
protocol = "tcp" protocol = "tcp"
port_range_min = 10259 port_range_min = 10259
port_range_max = 10259 port_range_max = 10259
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule15" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule15" {
direction = "ingress" direction = "ingress"
@ -146,8 +146,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule15" {
protocol = "tcp" protocol = "tcp"
port_range_min = 19001 port_range_min = 19001
port_range_max = 19001 port_range_max = 19001
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule16" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule16" {
direction = "ingress" direction = "ingress"
@ -155,8 +155,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule16" {
protocol = "tcp" protocol = "tcp"
port_range_min = 19001 port_range_min = 19001
port_range_max = 19001 port_range_max = 19001
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule17" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule17" {
direction = "ingress" direction = "ingress"
@ -164,8 +164,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule17" {
protocol = "udp" protocol = "udp"
port_range_min = 4789 port_range_min = 4789
port_range_max = 4789 port_range_max = 4789
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule18" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule18" {
direction = "ingress" direction = "ingress"
@ -173,8 +173,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule18" {
protocol = "udp" protocol = "udp"
port_range_min = 4789 port_range_min = 4789
port_range_max = 4789 port_range_max = 4789
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule19" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule19" {
direction = "ingress" direction = "ingress"
@ -182,8 +182,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule19" {
protocol = "udp" protocol = "udp"
port_range_min = 51820 port_range_min = 51820
port_range_max = 51820 port_range_max = 51820
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_rule_v2" "microk8s_rule20" { resource "openstack_networking_secgroup_rule_v2" "microk8s_rule20" {
direction = "ingress" direction = "ingress"
@ -191,8 +191,8 @@ resource "openstack_networking_secgroup_rule_v2" "microk8s_rule20" {
protocol = "udp" protocol = "udp"
port_range_min = 51820 port_range_min = 51820
port_range_max = 51820 port_range_max = 51820
remote_group_id = openstack_networking_secgroup_v2.microk8s.id remote_group_id = openstack_networking_secgroup_v2.microk8s-old.id
security_group_id = openstack_networking_secgroup_v2.microk8s.id security_group_id = openstack_networking_secgroup_v2.microk8s-old.id
} }
resource "openstack_networking_secgroup_v2" "https" { resource "openstack_networking_secgroup_v2" "https" {