Make project creation optional in project module (#99)

* make project creation optional in project module

* add variable to optionally configure project activation

* add explicit dependency on custom roles to additive bindings

* make parent variable optional

* add test for null parent

* fix custom roles output
This commit is contained in:
Ludovico Magnocavallo
2020-06-25 10:04:57 +02:00
committed by GitHub
parent 1dfc1f5954
commit ec765857cb
7 changed files with 77 additions and 32 deletions

View File

@@ -71,7 +71,7 @@ variable "oslogin_users" {
variable "parent" {
type = string
default = "folders/12345678"
default = null
}
variable "policy_boolean" {

View File

@@ -32,7 +32,7 @@ def test_prefix(plan_runner):
def test_parent(plan_runner):
"Test project parent."
_, resources = plan_runner(FIXTURES_DIR)
_, resources = plan_runner(FIXTURES_DIR, parent='folders/12345678')
assert len(resources) == 1
assert resources[0]['values']['folder_id'] == '12345678'
assert resources[0]['values'].get('org_id') == None
@@ -40,3 +40,11 @@ def test_parent(plan_runner):
assert len(resources) == 1
assert resources[0]['values']['org_id'] == '12345678'
assert resources[0]['values'].get('folder_id') == None
def test_no_parent(plan_runner):
"Test null project parent."
_, resources = plan_runner(FIXTURES_DIR)
assert len(resources) == 1
assert resources[0]['values'].get('folder_id') == None
assert resources[0]['values'].get('org_id') == None