diff --git a/fast/stages/03-project-factory/dev/main.tf b/fast/stages/03-project-factory/dev/main.tf index db95c7c2a..20b740295 100644 --- a/fast/stages/03-project-factory/dev/main.tf +++ b/fast/stages/03-project-factory/dev/main.tf @@ -22,8 +22,8 @@ locals { _defaults_net = { billing_account_id = var.billing_account.id environment_dns_zone = var.environment_dns_zone - shared_vpc_self_link = try(var.shared_vpc_self_links["dev:spoke-0"], null) - vpc_host_project = try(var.vpc_host_project_ids["dev:spoke-0"], null) + shared_vpc_self_link = try(var.shared_vpc_self_links["dev-spoke-0"], null) + vpc_host_project = try(var.vpc_host_project_ids["dev-spoke-0"], null) } defaults = merge(local._defaults, local._defaults_net) projects = { diff --git a/tests/fast/stages/s02_networking_nva/fixture/main.tf b/tests/fast/stages/s02_networking_nva/fixture/main.tf index d36382505..e978cf9ef 100644 --- a/tests/fast/stages/s02_networking_nva/fixture/main.tf +++ b/tests/fast/stages/s02_networking_nva/fixture/main.tf @@ -15,17 +15,30 @@ */ module "stage" { - source = "../../../../../fast/stages/02-networking-nva" - billing_account_id = "000000-111111-222222" - organization = { - domain = "gcp-pso-italy.net" - id = 856933387836 - customer_id = "C01lmug8b" - } - prefix = "fast" - project_factory_sa = { - dev = "foo@iam" - prod = "bar@iam" - } + source = "../../../../../fast/stages/02-networking-nva" data_dir = "../../../../../fast/stages/02-networking-nva/data/" + billing_account = { + id = "000000-111111-222222" + organization_id = 123456789012 + } + custom_roles = { + service_project_network_admin = "organizations/123456789012/roles/foo" + } + folder_ids = { + networking = null + networking-dev = null + networking-prod = null + } + service_accounts = { + data-platform-dev = "string" + data-platform-prod = "string" + project-factory-dev = "string" + project-factory-prod = "string" + } + organization = { + domain = "fast.example.com" + id = 123456789012 + customer_id = "C00000000" + } + prefix = "fast2" } diff --git a/tests/fast/stages/s02_networking_vpn/fixture/main.tf b/tests/fast/stages/s02_networking_vpn/fixture/main.tf index 8932a9927..58a8d6c0d 100644 --- a/tests/fast/stages/s02_networking_vpn/fixture/main.tf +++ b/tests/fast/stages/s02_networking_vpn/fixture/main.tf @@ -14,18 +14,47 @@ * limitations under the License. */ +# module "stage" { +# source = "../../../../../fast/stages/02-networking-vpn" +# billing_account_id = "000000-111111-222222" +# organization = { +# domain = "gcp-pso-italy.net" +# id = 856933387836 +# customer_id = "C01lmug8b" +# } +# prefix = "fast" +# project_factory_sa = { +# dev = "foo@iam" +# prod = "bar@iam" +# } +# data_dir = "../../../../../fast/stages/02-networking-vpn/data/" +# } + module "stage" { - source = "../../../../../fast/stages/02-networking-vpn" - billing_account_id = "000000-111111-222222" - organization = { - domain = "gcp-pso-italy.net" - id = 856933387836 - customer_id = "C01lmug8b" - } - prefix = "fast" - project_factory_sa = { - dev = "foo@iam" - prod = "bar@iam" - } + source = "../../../../../fast/stages/02-networking-vpn" data_dir = "../../../../../fast/stages/02-networking-vpn/data/" + billing_account = { + id = "000000-111111-222222" + organization_id = 123456789012 + } + custom_roles = { + service_project_network_admin = "organizations/123456789012/roles/foo" + } + folder_ids = { + networking = null + networking-dev = null + networking-prod = null + } + service_accounts = { + data-platform-dev = "string" + data-platform-prod = "string" + project-factory-dev = "string" + project-factory-prod = "string" + } + organization = { + domain = "fast.example.com" + id = 123456789012 + customer_id = "C00000000" + } + prefix = "fast2" } diff --git a/tests/fast/stages/s02_security/fixture/main.tf b/tests/fast/stages/s02_security/fixture/main.tf index 20608b288..14e2eb5b5 100644 --- a/tests/fast/stages/s02_security/fixture/main.tf +++ b/tests/fast/stages/s02_security/fixture/main.tf @@ -15,23 +15,20 @@ */ module "stage" { - source = "../../../../../fast/stages/02-security" - billing_account_id = "000000-111111-222222" - folder_id = "folders/12345678" + source = "../../../../../fast/stages/02-security" + billing_account = { + id = "000000-111111-222222" + organization_id = 123456789012 + } + folder_ids = { + security = null + } organization = { domain = "gcp-pso-italy.net" id = 856933387836 customer_id = "C01lmug8b" } prefix = "fast" - kms_restricted_admins = { - "dev" : [ - "serviceAccount:fast-dev-resman-pf-0@fast-prod-iac-core-0.iam.gserviceaccount.com" - ], - "prod" : [ - "serviceAccount:fast-prod-resman-pf-0@fast-prod-iac-core-0.iam.gserviceaccount.com" - ] - } kms_keys = { compute = { iam = { @@ -42,6 +39,11 @@ module "stage" { rotation_period = null } } + service_accounts = { + security = "foobar@iam.gserviceaccount.com" + project-factory-dev = "foobar@iam.gserviceaccount.com" + project-factory-prod = "foobar@iam.gserviceaccount.com" + } vpc_sc_ingress_policies = { iac = { ingress_from = { diff --git a/tests/fast/stages/s03_project_factory/fixture/main.tf b/tests/fast/stages/s03_project_factory/fixture/main.tf index ba9b1650b..4da676ef0 100644 --- a/tests/fast/stages/s03_project_factory/fixture/main.tf +++ b/tests/fast/stages/s03_project_factory/fixture/main.tf @@ -19,10 +19,14 @@ module "projects" { data_dir = "./data/projects/" defaults_file = "./data/defaults.yaml" prefix = "test" - billing_account_id = "12345-67890A-BCDEF0" environment_dns_zone = "dev" - shared_vpc_self_link = "fake_link" - vpc_host_project = "host_project" + billing_account = { + id = "000000-111111-222222" + organization_id = 123456789012 + } + shared_vpc_self_links = { + dev-spoke-0 = "link" + } } diff --git a/tests/fast/stages/s03_project_factory/fixture/terraform-bootstrap.auto.tfvars.json b/tests/fast/stages/s03_project_factory/fixture/terraform-bootstrap.auto.tfvars.json deleted file mode 100644 index d446d6433..000000000 --- a/tests/fast/stages/s03_project_factory/fixture/terraform-bootstrap.auto.tfvars.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "billing_account_id": "012345-67890A-BCDEF0", - "prefix": "fast" -} \ No newline at end of file diff --git a/tests/fast/stages/s03_project_factory/fixture/terraform-networking.auto.tfvars.json b/tests/fast/stages/s03_project_factory/fixture/terraform-networking.auto.tfvars.json deleted file mode 100644 index 56cfa3de9..000000000 --- a/tests/fast/stages/s03_project_factory/fixture/terraform-networking.auto.tfvars.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "environment_dns_zone": "prod.gcp.example.com.", - "shared_vpc_self_link": "https://www.googleapis.com/compute/v1/projects/fast-example/global/networks/prod-spoke-0", - "vpc_host_project": "fast-example" -} \ No newline at end of file diff --git a/tests/fast/stages/s03_project_factory/fixture/variables.tf b/tests/fast/stages/s03_project_factory/fixture/variables.tf deleted file mode 100644 index b52ebd6c9..000000000 --- a/tests/fast/stages/s03_project_factory/fixture/variables.tf +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#TODO: tfdoc annotations - -variable "billing_account_id" { - # tfdoc:variable:source 00-bootstrap - description = "Billing account id." - type = string -} - -variable "data_dir" { - description = "Relative path for the folder storing configuration data." - type = string - default = "data/projects" -} - -variable "environment_dns_zone" { - # tfdoc:variable:source 02-networking - description = "DNS zone suffix for environment." - type = string - default = null -} - -variable "defaults_file" { - description = "Relative path for the file storing the project factory configuration." - type = string - default = "data/defaults.yaml" -} - -#TODO(sruffilli): is this really required? -variable "environment" { - description = "Environment where projects will be created (e.g. prod, dev, ...)." - type = string - default = "prod" -} - -variable "shared_vpc_self_link" { - # tfdoc:variable:source 02-networking - description = "Self link for the shared VPC." - type = string -} - -variable "vpc_host_project" { - # tfdoc:variable:source 02-networking - description = "Host project for the shared VPC." - type = string -}