UPD: added random suffix
This commit is contained in:
+7
-2
@@ -1,5 +1,10 @@
|
|||||||
|
resource "random_integer" "suffix" {
|
||||||
|
min = 1000
|
||||||
|
max = 9999
|
||||||
|
}
|
||||||
|
|
||||||
resource "openstack_compute_secgroup_v2" "test-sg1" {
|
resource "openstack_compute_secgroup_v2" "test-sg1" {
|
||||||
name = "test-sg1"
|
name = "test-sg-${random_integer.suffix.result}"
|
||||||
description = "Allow all"
|
description = "Allow all"
|
||||||
rule {
|
rule {
|
||||||
from_port = -1
|
from_port = -1
|
||||||
@@ -24,7 +29,7 @@ resource "openstack_compute_secgroup_v2" "test-sg1" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_compute_instance_v2" "tfvm1" {
|
resource "openstack_compute_instance_v2" "tfvm1" {
|
||||||
name = "tfvm1"
|
name = "tfvm-${random_integer.suffix.result}"
|
||||||
flavor_id = "b8159937-a5f9-46fb-97eb-2d59b67cfedd"
|
flavor_id = "b8159937-a5f9-46fb-97eb-2d59b67cfedd"
|
||||||
key_pair = "opc-key"
|
key_pair = "opc-key"
|
||||||
security_groups = ["${openstack_compute_secgroup_v2.test-sg1.name}"]
|
security_groups = ["${openstack_compute_secgroup_v2.test-sg1.name}"]
|
||||||
|
|||||||
Reference in New Issue
Block a user