43 lines
1.1 KiB
HCL
43 lines
1.1 KiB
HCL
# Import the existing security group instead of creating a new one
|
|
# Comment out the resource block to use the one that already exists
|
|
/*
|
|
*/
|
|
resource "openstack_networking_secgroup_v2" "secgroup" {
|
|
name = "ikt210-g04-secgroup"
|
|
description = "Talos/K8s access"
|
|
|
|
}
|
|
|
|
# Using existing security group ID defined in compute.tf
|
|
|
|
# Security group rules are already created
|
|
# Commenting these out to avoid recreating them
|
|
|
|
resource "openstack_networking_secgroup_rule_v2" "k8s_api" {
|
|
direction = "ingress"
|
|
ethertype = "IPv4"
|
|
protocol = null
|
|
remote_ip_prefix = "0.0.0.0/0"
|
|
security_group_id = openstack_networking_secgroup_v2.secgroup.id
|
|
}
|
|
|
|
/*
|
|
resource "openstack_networking_secgroup_rule_v2" "icmp" {
|
|
direction = "ingress"
|
|
ethertype = "IPv4"
|
|
protocol = "icmp"
|
|
security_group_id = openstack_networking_secgroup_v2.secgroup.id
|
|
|
|
lifecycle {
|
|
ignore_changes = all
|
|
}
|
|
}
|
|
|
|
resource "openstack_networking_secgroup_rule_v2" "egress" {
|
|
direction = "egress"
|
|
ethertype = "IPv4"
|
|
remote_ip_prefix = "0.0.0.0/0"
|
|
security_group_id = openstack_networking_secgroup_v2.secgroup.id
|
|
}
|
|
*/
|