Skip to content
Snippets Groups Projects
Commit 87738aec authored by Benguria Elguezabal, Gorka's avatar Benguria Elguezabal, Gorka
Browse files

simplify security group

parent 3d6340bd
No related branches found
No related tags found
1 merge request!1Monitoring
......@@ -67,11 +67,7 @@ resource "openstack_networking_port_v2" "net1" {
network_id = openstack_networking_network_v2.net1.id
admin_state_up = true
security_group_ids = [
openstack_compute_secgroup_v2.icmp.id,
openstack_compute_secgroup_v2.http.id,
openstack_compute_secgroup_v2.https.id,
openstack_compute_secgroup_v2.ssh.id,
openstack_compute_secgroup_v2.nginx.id,
]
fixed_ip {
subnet_id = openstack_networking_subnet_v2.net1_subnet.id
......@@ -105,42 +101,27 @@ resource "openstack_compute_keypair_v2" "user1" {
# CREATING SECURITY_GROUP
resource "openstack_compute_secgroup_v2" "icmp" {
name = "icmp"
description = "Security group rule for port -1"
resource "openstack_compute_secgroup_v2" "nginx" {
name = "nginx"
description = "Security group rule for port 80"
rule {
from_port = -1
to_port = -1
ip_protocol = "icmp"
cidr = "0.0.0.0/0"
}
}
resource "openstack_compute_secgroup_v2" "http" {
name = "http"
description = "Security group rule for port 80"
rule {
from_port = 80
to_port = 80
ip_protocol = "tcp"
cidr = "0.0.0.0/0"
}
}
resource "openstack_compute_secgroup_v2" "https" {
name = "https"
description = "Security group rule for port 443"
rule {
from_port = 443
to_port = 443
ip_protocol = "tcp"
cidr = "0.0.0.0/0"
}
}
resource "openstack_compute_secgroup_v2" "ssh" {
name = "ssh"
description = "Security group rule for port 22"
rule {
from_port = 22
to_port = 22
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment