Pinning version for libs and terraform modules, adding docstrings, improving documentation of the code, tabs 2 spaces.
This commit is contained in:
parent
9f3ee4dc22
commit
221557d066
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,8 @@
|
||||||
regex
|
regex==2022.3.2
|
||||||
google-api-python-client
|
google-api-python-client==2.39.0
|
||||||
google-auth
|
google-auth==2.6.0
|
||||||
google-auth-httplib2
|
google-auth-httplib2==0.1.0
|
||||||
google-cloud-logging
|
google-cloud-logging==3.0.0
|
||||||
google-cloud-monitoring
|
google-cloud-monitoring==2.9.1
|
||||||
oauth2client
|
oauth2client==4.1.3
|
||||||
google-api-core
|
google-api-core==2.7.0
|
|
@ -41,7 +41,7 @@ locals {
|
||||||
################################################
|
################################################
|
||||||
|
|
||||||
module "project-monitoring" {
|
module "project-monitoring" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
name = "monitoring"
|
name = "monitoring"
|
||||||
parent = "organizations/${var.organization_id}"
|
parent = "organizations/${var.organization_id}"
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -54,7 +54,7 @@ module "project-monitoring" {
|
||||||
################################################
|
################################################
|
||||||
|
|
||||||
module "service-account-function" {
|
module "service-account-function" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/iam-service-account"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/iam-service-account?ref=v14.0.0"
|
||||||
project_id = module.project-monitoring.project_id
|
project_id = module.project-monitoring.project_id
|
||||||
name = "sa-dash"
|
name = "sa-dash"
|
||||||
generate_key = false
|
generate_key = false
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
# Creating test infrastructure
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
resource "google_folder" "test-net-dash" {
|
resource "google_folder" "test-net-dash" {
|
||||||
display_name = "test-net-dash"
|
display_name = "test-net-dash"
|
||||||
|
@ -8,7 +22,7 @@ resource "google_folder" "test-net-dash" {
|
||||||
##### Creating host projects, VPCs, service projects #####
|
##### Creating host projects, VPCs, service projects #####
|
||||||
|
|
||||||
module "project-hub" {
|
module "project-hub" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
name = "test-host-hub"
|
name = "test-host-hub"
|
||||||
parent = google_folder.test-net-dash.name
|
parent = google_folder.test-net-dash.name
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -22,7 +36,7 @@ module "project-hub" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "vpc-hub" {
|
module "vpc-hub" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0"
|
||||||
project_id = module.project-hub.project_id
|
project_id = module.project-hub.project_id
|
||||||
name = "vpc-hub"
|
name = "vpc-hub"
|
||||||
subnets = [
|
subnets = [
|
||||||
|
@ -36,7 +50,7 @@ module "vpc-hub" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "project-svc-hub" {
|
module "project-svc-hub" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
parent = google_folder.test-net-dash.name
|
parent = google_folder.test-net-dash.name
|
||||||
billing_account = var.billing_account
|
billing_account = var.billing_account
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -50,7 +64,7 @@ module "project-svc-hub" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "project-prod" {
|
module "project-prod" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
name = "test-host-prod"
|
name = "test-host-prod"
|
||||||
parent = google_folder.test-net-dash.name
|
parent = google_folder.test-net-dash.name
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -64,7 +78,7 @@ module "project-prod" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "vpc-prod" {
|
module "vpc-prod" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0"
|
||||||
project_id = module.project-prod.project_id
|
project_id = module.project-prod.project_id
|
||||||
name = "vpc-prod"
|
name = "vpc-prod"
|
||||||
subnets = [
|
subnets = [
|
||||||
|
@ -78,7 +92,7 @@ module "vpc-prod" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "project-svc-prod" {
|
module "project-svc-prod" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
parent = google_folder.test-net-dash.name
|
parent = google_folder.test-net-dash.name
|
||||||
billing_account = var.billing_account
|
billing_account = var.billing_account
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -92,7 +106,7 @@ module "project-svc-prod" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "project-dev" {
|
module "project-dev" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
name = "test-host-dev"
|
name = "test-host-dev"
|
||||||
parent = google_folder.test-net-dash.name
|
parent = google_folder.test-net-dash.name
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -106,7 +120,7 @@ module "project-dev" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "vpc-dev" {
|
module "vpc-dev" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0"
|
||||||
project_id = module.project-dev.project_id
|
project_id = module.project-dev.project_id
|
||||||
name = "vpc-dev"
|
name = "vpc-dev"
|
||||||
subnets = [
|
subnets = [
|
||||||
|
@ -120,7 +134,7 @@ module "vpc-dev" {
|
||||||
}
|
}
|
||||||
|
|
||||||
module "project-svc-dev" {
|
module "project-svc-dev" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/project"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v14.0.0"
|
||||||
parent = google_folder.test-net-dash.name
|
parent = google_folder.test-net-dash.name
|
||||||
billing_account = var.billing_account
|
billing_account = var.billing_account
|
||||||
prefix = var.prefix
|
prefix = var.prefix
|
||||||
|
@ -136,26 +150,26 @@ module "project-svc-dev" {
|
||||||
##### Creating VPC peerings #####
|
##### Creating VPC peerings #####
|
||||||
|
|
||||||
module "hub-to-prod-peering" {
|
module "hub-to-prod-peering" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc-peering"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0-peering"
|
||||||
local_network = module.vpc-hub.self_link
|
local_network = module.vpc-hub.self_link
|
||||||
peer_network = module.vpc-prod.self_link
|
peer_network = module.vpc-prod.self_link
|
||||||
}
|
}
|
||||||
|
|
||||||
module "prod-to-hub-peering" {
|
module "prod-to-hub-peering" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc-peering"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0-peering"
|
||||||
local_network = module.vpc-prod.self_link
|
local_network = module.vpc-prod.self_link
|
||||||
peer_network = module.vpc-hub.self_link
|
peer_network = module.vpc-hub.self_link
|
||||||
depends_on = [module.hub-to-prod-peering]
|
depends_on = [module.hub-to-prod-peering]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "hub-to-dev-peering" {
|
module "hub-to-dev-peering" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc-peering"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0-peering"
|
||||||
local_network = module.vpc-hub.self_link
|
local_network = module.vpc-hub.self_link
|
||||||
peer_network = module.vpc-dev.self_link
|
peer_network = module.vpc-dev.self_link
|
||||||
}
|
}
|
||||||
|
|
||||||
module "dev-to-hub-peering" {
|
module "dev-to-hub-peering" {
|
||||||
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric///modules/net-vpc-peering"
|
source = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v14.0.0-peering"
|
||||||
local_network = module.vpc-dev.self_link
|
local_network = module.vpc-dev.self_link
|
||||||
peer_network = module.vpc-hub.self_link
|
peer_network = module.vpc-hub.self_link
|
||||||
depends_on = [module.hub-to-dev-peering]
|
depends_on = [module.hub-to-dev-peering]
|
||||||
|
|
Loading…
Reference in New Issue