In general when opening ICMP rule for security groups we generally use the following configuration:
Port: -1
Protocol: icmp
CIDR: 0.0.0.0/0
But with the openstack terraform when using a negative value for port throws the following error:
module.compute.instance.openstack_compute_floatingip_associate_v2.floating_ip_assoc: Creation complete (ID: 10.43.14.187/0e48f51d-6dc0-479d-9481-358e5f739dac/)
Error applying plan:
1 error(s) occurred:
The correct way to open ICMP rule is as follows:
Given that the security group is pre-created with following configuration:
resource "openstack_compute_secgroup_v2" "default_secgroup" {
name = "sg-${var.env}-${var.id}"
description = "Default security group"
}
Port: -1
Protocol: icmp
CIDR: 0.0.0.0/0
But with the openstack terraform when using a negative value for port throws the following error:
module.compute.instance.openstack_compute_floatingip_associate_v2.floating_ip_assoc: Creation complete (ID: 10.43.14.187/0e48f51d-6dc0-479d-9481-358e5f739dac/)
Error applying plan:
1 error(s) occurred:
- module.network.module.sg.openstack_networking_secgroup_rule_v2.secgroup_rule_test: 1 error(s) occurred:
- openstack_networking_secgroup_rule_v2.secgroup_rule_test: Invalid request due to incorrect syntax or missing required parameters.
The correct way to open ICMP rule is as follows:
resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_test" {
direction = "ingress"
ethertype = "IPv4"
protocol = "icmp"
port_range_min = "0"
port_range_max = "0"
remote_ip_prefix = "0.0.0.0/0"
security_group_id = "${openstack_compute_secgroup_v2.default_secgroup.id}"
}
Given that the security group is pre-created with following configuration:
resource "openstack_compute_secgroup_v2" "default_secgroup" {
name = "sg-${var.env}-${var.id}"
description = "Default security group"
}
Comments
Post a Comment