Allow using a non-suffixed name in compute-vm (#217)

* allow using a non-suffixed name in compute-vm

* update README
This commit is contained in:
Ludovico Magnocavallo
2021-03-31 20:01:10 +02:00
committed by GitHub
parent 4c1cbef4be
commit 5149795bec
6 changed files with 30 additions and 6 deletions

View File

@@ -29,4 +29,5 @@ module "test" {
iam = var.iam
metadata = var.metadata
metadata_list = var.metadata_list
single_name = var.single_name
}

View File

@@ -64,12 +64,17 @@ variable "network_interfaces" {
}]
}
variable "use_instance_template" {
variable "service_account_create" {
type = bool
default = false
}
variable "service_account_create" {
variable "single_name" {
type = bool
default = false
}
variable "use_instance_template" {
type = bool
default = false
}

View File

@@ -26,6 +26,13 @@ def test_single_instance(plan_runner):
assert resources[0]['type'] == 'google_compute_instance'
def test_single_instance_single_name(plan_runner):
_, resources = plan_runner(FIXTURES_DIR, single_name=1)
assert len(resources) == 1
assert resources[0]['type'] == 'google_compute_instance'
assert resources[0]['values']['name'] == 'test'
def test_multiple_instances(plan_runner):
_, resources = plan_runner(FIXTURES_DIR, instance_count=2)
assert len(resources) == 2