Skip to content

Commit 26eaad4

Browse files
authored
Merge pull request #2 from GoogleCloudPlatform/master
Sync fork
2 parents 05d57e1 + 42ae9bb commit 26eaad4

File tree

19 files changed

+279
-216
lines changed

19 files changed

+279
-216
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.
88

99
### BLUEPRINTS
1010

11+
- [[#1081](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1081)] Apigee hybrid on GKE ([apichick](https://github.com/apichick)) <!-- 2023-01-05 08:23:33+00:00 -->
12+
- [[#1082](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1082)] Fixes in Apigee Bigquery Analytics blueprint ([apichick](https://github.com/apichick)) <!-- 2023-01-04 16:42:50+00:00 -->
1113
- [[#1071](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1071)] Moved apigee bigquery analytics blueprint, added apigee network patterns ([apichick](https://github.com/apichick)) <!-- 2022-12-23 15:16:45+00:00 -->
1214
- [[#1073](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1073)] Allow setting no ranges in firewall module custom rules ([ludoo](https://github.com/ludoo)) <!-- 2022-12-23 08:03:31+00:00 -->
1315
- [[#1072](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1072)] **incompatible change:** Add gc_policy to Bigtable module, bump provider versions to 4.47 ([iht](https://github.com/iht)) <!-- 2022-12-22 23:58:08+00:00 -->
@@ -18,17 +20,25 @@ All notable changes to this project will be documented in this file.
1820

1921
### DOCUMENTATION
2022

23+
- [[#1084](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1084)] Fixes in Apigee blueprints README files ([apichick](https://github.com/apichick)) <!-- 2023-01-05 11:00:46+00:00 -->
24+
- [[#1081](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1081)] Apigee hybrid on GKE ([apichick](https://github.com/apichick)) <!-- 2023-01-05 08:23:33+00:00 -->
25+
- [[#1074](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1074)] Adding new section for Authentication issues ([agutta](https://github.com/agutta)) <!-- 2022-12-29 15:50:23+00:00 -->
2126
- [[#1071](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1071)] Moved apigee bigquery analytics blueprint, added apigee network patterns ([apichick](https://github.com/apichick)) <!-- 2022-12-23 15:16:45+00:00 -->
2227
- [[#1057](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1057)] Adding new file FAQ and an image ([agutta](https://github.com/agutta)) <!-- 2022-12-22 14:00:22+00:00 -->
2328

2429
### FAST
2530

31+
- [[#1085](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1085)] fix restricted services not being added to the perimeter configurations ([drebes](https://github.com/drebes)) <!-- 2023-01-06 12:25:31+00:00 -->
2632
- [[#1057](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1057)] Adding new file FAQ and an image ([agutta](https://github.com/agutta)) <!-- 2022-12-22 14:00:22+00:00 -->
2733
- [[#1054](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1054)] FAST: fix typo in bootstrap stage README ([agutta](https://github.com/agutta)) <!-- 2022-12-16 16:00:00+00:00 -->
2834
- [[#1051](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1051)] FAST: add instructions for billing export to stage 0 README ([KPRepos](https://github.com/KPRepos)) <!-- 2022-12-15 08:53:57+00:00 -->
2935

3036
### MODULES
3137

38+
- [[#1078](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1078)] Fixed delete_rule in compute-mig module for stateful disks ([rosmo](https://github.com/rosmo)) <!-- 2023-01-04 08:14:40+00:00 -->
39+
- [[#1080](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1080)] Added device_name field to compute-vm attached_disks parameter ([rosmo](https://github.com/rosmo)) <!-- 2023-01-03 20:53:48+00:00 -->
40+
- [[#1079](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1079)] Reorder org policy rules ([juliocc](https://github.com/juliocc)) <!-- 2023-01-03 16:11:29+00:00 -->
41+
- [[#1075](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1075)] **incompatible change:** Add cluster replicas to Bigtable module. ([iht](https://github.com/iht)) <!-- 2022-12-30 10:39:38+00:00 -->
3242
- [[#1073](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1073)] Allow setting no ranges in firewall module custom rules ([ludoo](https://github.com/ludoo)) <!-- 2022-12-23 08:03:31+00:00 -->
3343
- [[#1072](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1072)] **incompatible change:** Add gc_policy to Bigtable module, bump provider versions to 4.47 ([iht](https://github.com/iht)) <!-- 2022-12-22 23:58:08+00:00 -->
3444
- [[#1070](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1070)] Fix MIG health check variable ([ludoo](https://github.com/ludoo)) <!-- 2022-12-22 17:12:17+00:00 -->
@@ -43,6 +53,7 @@ All notable changes to this project will be documented in this file.
4353

4454
### TOOLS
4555

56+
- [[#1091](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1091)] Fix check_documentation output ([juliocc](https://github.com/juliocc)) <!-- 2023-01-12 14:43:13+00:00 -->
4657
- [[#1053](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/1053)] Extend inventory-based testing to examples ([juliocc](https://github.com/juliocc)) <!-- 2022-12-18 19:50:34+00:00 -->
4758

4859
## [19.0.0] - 2022-12-13

blueprints/data-solutions/data-platform-foundations/03-composer.tf

+77-73
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,40 @@
1414

1515
# tfdoc:file:description Orchestration Cloud Composer definition.
1616

17+
locals {
18+
env_variables = {
19+
BQ_LOCATION = var.location
20+
DATA_CAT_TAGS = try(jsonencode(module.common-datacatalog.tags), "{}")
21+
DF_KMS_KEY = try(var.service_encryption_keys.dataflow, "")
22+
DRP_PRJ = module.drop-project.project_id
23+
DRP_BQ = module.drop-bq-0.dataset_id
24+
DRP_GCS = module.drop-cs-0.url
25+
DRP_PS = module.drop-ps-0.id
26+
DWH_LAND_PRJ = module.dwh-lnd-project.project_id
27+
DWH_LAND_BQ_DATASET = module.dwh-lnd-bq-0.dataset_id
28+
DWH_LAND_GCS = module.dwh-lnd-cs-0.url
29+
DWH_CURATED_PRJ = module.dwh-cur-project.project_id
30+
DWH_CURATED_BQ_DATASET = module.dwh-cur-bq-0.dataset_id
31+
DWH_CURATED_GCS = module.dwh-cur-cs-0.url
32+
DWH_CONFIDENTIAL_PRJ = module.dwh-conf-project.project_id
33+
DWH_CONFIDENTIAL_BQ_DATASET = module.dwh-conf-bq-0.dataset_id
34+
DWH_CONFIDENTIAL_GCS = module.dwh-conf-cs-0.url
35+
GCP_REGION = var.region
36+
LOD_PRJ = module.load-project.project_id
37+
LOD_GCS_STAGING = module.load-cs-df-0.url
38+
LOD_NET_VPC = local.load_vpc
39+
LOD_NET_SUBNET = local.load_subnet
40+
LOD_SA_DF = module.load-sa-df-0.email
41+
ORC_PRJ = module.orch-project.project_id
42+
ORC_GCS = module.orch-cs-0.url
43+
TRF_PRJ = module.transf-project.project_id
44+
TRF_GCS_STAGING = module.transf-cs-df-0.url
45+
TRF_NET_VPC = local.transf_vpc
46+
TRF_NET_SUBNET = local.transf_subnet
47+
TRF_SA_DF = module.transf-sa-df-0.email
48+
TRF_SA_BQ = module.transf-sa-bq-0.email
49+
}
50+
}
1751
module "orch-sa-cmp-0" {
1852
source = "../../../modules/iam-service-account"
1953
project_id = module.orch-project.project_id
@@ -27,21 +61,51 @@ module "orch-sa-cmp-0" {
2761
}
2862

2963
resource "google_composer_environment" "orch-cmp-0" {
30-
provider = google-beta
31-
project = module.orch-project.project_id
32-
name = "${var.prefix}-orc-cmp-0"
33-
region = var.region
64+
count = var.composer_config.disable_deployment == true ? 0 : 1
65+
project = module.orch-project.project_id
66+
name = "${var.prefix}-orc-cmp-0"
67+
region = var.region
3468
config {
35-
node_count = var.composer_config.node_count
69+
software_config {
70+
airflow_config_overrides = try(var.composer_config.software_config.airflow_config_overrides, null)
71+
pypi_packages = try(var.composer_config.software_config.pypi_packages, null)
72+
env_variables = merge(try(var.composer_config.software_config.env_variables, null), local.env_variables)
73+
image_version = try(var.composer_config.software_config.image_version, null)
74+
}
75+
dynamic "workloads_config" {
76+
for_each = (try(var.composer_config.workloads_config, null) != null ? { 1 = 1 } : {})
77+
78+
content {
79+
scheduler {
80+
cpu = try(var.composer_config.workloads_config.scheduler.cpu, null)
81+
memory_gb = try(var.composer_config.workloads_config.scheduler.memory_gb, null)
82+
storage_gb = try(var.composer_config.workloads_config.scheduler.storage_gb, null)
83+
count = try(var.composer_config.workloads_config.scheduler.count, null)
84+
}
85+
web_server {
86+
cpu = try(var.composer_config.workloads_config.web_server.cpu, null)
87+
memory_gb = try(var.composer_config.workloads_config.web_server.memory_gb, null)
88+
storage_gb = try(var.composer_config.workloads_config.web_server.storage_gb, null)
89+
}
90+
worker {
91+
cpu = try(var.composer_config.workloads_config.worker.cpu, null)
92+
memory_gb = try(var.composer_config.workloads_config.worker.memory_gb, null)
93+
storage_gb = try(var.composer_config.workloads_config.worker.storage_gb, null)
94+
min_count = try(var.composer_config.workloads_config.worker.min_count, null)
95+
max_count = try(var.composer_config.workloads_config.worker.max_count, null)
96+
}
97+
}
98+
}
99+
100+
environment_size = var.composer_config.environment_size
101+
36102
node_config {
37-
zone = "${var.region}-b"
38-
service_account = module.orch-sa-cmp-0.email
39103
network = local.orch_vpc
40104
subnetwork = local.orch_subnet
41-
tags = ["composer-worker", "http-server", "https-server"]
42-
enable_ip_masq_agent = true
105+
service_account = module.orch-sa-cmp-0.email
106+
enable_ip_masq_agent = "true"
107+
tags = ["composer-worker"]
43108
ip_allocation_policy {
44-
use_ip_aliases = "true"
45109
cluster_secondary_range_name = try(
46110
var.network_config.composer_secondary_ranges.pods, "pods"
47111
)
@@ -58,80 +122,20 @@ resource "google_composer_environment" "orch-cmp-0" {
58122
master_ipv4_cidr_block = try(
59123
var.network_config.composer_ip_ranges.gke_master, "10.20.11.0/28"
60124
)
61-
web_server_ipv4_cidr_block = try(
62-
var.network_config.composer_ip_ranges.web_server, "10.20.11.16/28"
63-
)
64125
}
65-
software_config {
66-
image_version = var.composer_config.airflow_version
67-
env_variables = merge(
68-
var.composer_config.env_variables, {
69-
BQ_LOCATION = var.location
70-
DATA_CAT_TAGS = try(jsonencode(module.common-datacatalog.tags), "{}")
71-
DF_KMS_KEY = try(var.service_encryption_keys.dataflow, "")
72-
DRP_PRJ = module.drop-project.project_id
73-
DRP_BQ = module.drop-bq-0.dataset_id
74-
DRP_GCS = module.drop-cs-0.url
75-
DRP_PS = module.drop-ps-0.id
76-
DWH_LAND_PRJ = module.dwh-lnd-project.project_id
77-
DWH_LAND_BQ_DATASET = module.dwh-lnd-bq-0.dataset_id
78-
DWH_LAND_GCS = module.dwh-lnd-cs-0.url
79-
DWH_CURATED_PRJ = module.dwh-cur-project.project_id
80-
DWH_CURATED_BQ_DATASET = module.dwh-cur-bq-0.dataset_id
81-
DWH_CURATED_GCS = module.dwh-cur-cs-0.url
82-
DWH_CONFIDENTIAL_PRJ = module.dwh-conf-project.project_id
83-
DWH_CONFIDENTIAL_BQ_DATASET = module.dwh-conf-bq-0.dataset_id
84-
DWH_CONFIDENTIAL_GCS = module.dwh-conf-cs-0.url
85-
DWH_PLG_PRJ = module.dwh-plg-project.project_id
86-
DWH_PLG_BQ_DATASET = module.dwh-plg-bq-0.dataset_id
87-
DWH_PLG_GCS = module.dwh-plg-cs-0.url
88-
GCP_REGION = var.region
89-
LOD_PRJ = module.load-project.project_id
90-
LOD_GCS_STAGING = module.load-cs-df-0.url
91-
LOD_NET_VPC = local.load_vpc
92-
LOD_NET_SUBNET = local.load_subnet
93-
LOD_SA_DF = module.load-sa-df-0.email
94-
ORC_PRJ = module.orch-project.project_id
95-
ORC_GCS = module.orch-cs-0.url
96-
TRF_PRJ = module.transf-project.project_id
97-
TRF_GCS_STAGING = module.transf-cs-df-0.url
98-
TRF_NET_VPC = local.transf_vpc
99-
TRF_NET_SUBNET = local.transf_subnet
100-
TRF_SA_DF = module.transf-sa-df-0.email
101-
TRF_SA_BQ = module.transf-sa-bq-0.email
102-
}
103-
)
104-
}
105-
106126
dynamic "encryption_config" {
107127
for_each = (
108-
try(local.service_encryption_keys.composer != null, false)
128+
try(var.service_encryption_keys[var.region], null) != null
109129
? { 1 = 1 }
110130
: {}
111131
)
112132
content {
113-
kms_key_name = try(local.service_encryption_keys.composer, null)
133+
kms_key_name = try(var.service_encryption_keys[var.region], null)
114134
}
115135
}
116-
117-
# dynamic "web_server_network_access_control" {
118-
# for_each = toset(
119-
# var.network_config.web_server_network_access_control == null
120-
# ? []
121-
# : [var.network_config.web_server_network_access_control]
122-
# )
123-
# content {
124-
# dynamic "allowed_ip_range" {
125-
# for_each = toset(web_server_network_access_control.key)
126-
# content {
127-
# value = allowed_ip_range.key
128-
# }
129-
# }
130-
# }
131-
# }
132-
133136
}
134137
depends_on = [
135138
google_project_iam_member.shared_vpc,
139+
module.orch-project
136140
]
137141
}

blueprints/data-solutions/data-platform-foundations/03-orchestration.tf

+3-5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ module "orch-project" {
5454
"roles/bigquery.jobUser" = [
5555
module.orch-sa-cmp-0.iam_email,
5656
]
57+
"roles/composer.ServiceAgentV2Ext" = [
58+
"serviceAccount:${module.orch-project.service_accounts.robots.composer}"
59+
]
5760
"roles/composer.worker" = [
5861
module.orch-sa-cmp-0.iam_email
5962
]
@@ -67,11 +70,6 @@ module "orch-project" {
6770
"roles/storage.objectViewer" = [module.load-sa-df-0.iam_email]
6871
}
6972
oslogin = false
70-
org_policies = {
71-
"constraints/compute.requireOsLogin" = {
72-
enforce = false
73-
}
74-
}
7573
services = concat(var.project_services, [
7674
"artifactregistry.googleapis.com",
7775
"bigquery.googleapis.com",

blueprints/data-solutions/data-platform-foundations/05-datawarehouse.tf

-49
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ locals {
3030
"roles/storage.objectViewer",
3131
]
3232
}
33-
dwh_plg_group_iam = {
34-
(local.groups.data-engineers) = [
35-
"roles/bigquery.dataEditor",
36-
"roles/storage.admin",
37-
],
38-
(local.groups.data-analysts) = [
39-
"roles/bigquery.dataEditor",
40-
"roles/bigquery.jobUser",
41-
"roles/bigquery.metadataViewer",
42-
"roles/bigquery.user",
43-
"roles/datacatalog.viewer",
44-
"roles/datacatalog.tagTemplateViewer",
45-
"roles/storage.objectAdmin",
46-
]
47-
}
4833
dwh_lnd_iam = {
4934
"roles/bigquery.dataOwner" = [
5035
module.load-sa-df-0.iam_email,
@@ -140,21 +125,6 @@ module "dwh-conf-project" {
140125
}
141126
}
142127

143-
module "dwh-plg-project" {
144-
source = "../../../modules/project"
145-
parent = var.folder_id
146-
billing_account = var.billing_account_id
147-
prefix = var.prefix
148-
name = "dwh-plg${local.project_suffix}"
149-
group_iam = local.dwh_plg_group_iam
150-
iam = {}
151-
services = local.dwh_services
152-
service_encryption_key_ids = {
153-
bq = [try(local.service_encryption_keys.bq, null)]
154-
storage = [try(local.service_encryption_keys.storage, null)]
155-
}
156-
}
157-
158128
# Bigquery
159129

160130
module "dwh-lnd-bq-0" {
@@ -181,14 +151,6 @@ module "dwh-conf-bq-0" {
181151
encryption_key = try(local.service_encryption_keys.bq, null)
182152
}
183153

184-
module "dwh-plg-bq-0" {
185-
source = "../../../modules/bigquery-dataset"
186-
project_id = module.dwh-plg-project.project_id
187-
id = "${replace(var.prefix, "-", "_")}_dwh_plg_bq_0"
188-
location = var.location
189-
encryption_key = try(local.service_encryption_keys.bq, null)
190-
}
191-
192154
# Cloud storage
193155

194156
module "dwh-lnd-cs-0" {
@@ -223,14 +185,3 @@ module "dwh-conf-cs-0" {
223185
encryption_key = try(local.service_encryption_keys.storage, null)
224186
force_destroy = var.data_force_destroy
225187
}
226-
227-
module "dwh-plg-cs-0" {
228-
source = "../../../modules/gcs"
229-
project_id = module.dwh-plg-project.project_id
230-
prefix = var.prefix
231-
name = "dwh-plg-cs-0"
232-
location = var.location
233-
storage_class = "MULTI_REGIONAL"
234-
encryption_key = try(local.service_encryption_keys.storage, null)
235-
force_destroy = var.data_force_destroy
236-
}

0 commit comments

Comments
 (0)