Skip to content

Commit 6f331de

Browse files
authored
Merge branch 'main' into renovate/terraform-google-modules-network-google-10.x
2 parents 079fab4 + 9c534b0 commit 6f331de

File tree

32 files changed

+1097
-77
lines changed

32 files changed

+1097
-77
lines changed

.github/conventional-commit-lint.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/lint.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ name: 'lint'
2020
on:
2121
workflow_dispatch:
2222
pull_request:
23-
branches:
24-
- main
23+
types: [opened, edited, reopened, synchronize]
24+
branches: [main]
25+
26+
permissions:
27+
contents: read
2528

2629
concurrency:
2730
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
@@ -46,3 +49,21 @@ jobs:
4649
fi
4750
- run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} module-swapper
4851
- run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
52+
commitlint:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0
58+
- name: Setup node
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: lts/*
62+
- name: Install commitlint
63+
run: |
64+
npm install -D @commitlint/[email protected] @commitlint/[email protected]
65+
echo "module.exports = { extends: ['@commitlint/config-conventional'], rules: {'subject-case': [0]} };" > commitlint.config.js
66+
npx commitlint --version
67+
- name: Validate PR commits with commitlint
68+
if: github.event_name == 'pull_request'
69+
run: 'echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose'

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,38 @@ and this project adheres to
88
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99
This changelog is generated automatically based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
1010

11+
## [6.2.0](https://github.com/terraform-google-modules/terraform-google-composer/compare/v6.1.0...v6.2.0) (2025-07-07)
12+
13+
14+
### Features
15+
16+
* customize composer sa name in sub-module composer_net ([#167](https://github.com/terraform-google-modules/terraform-google-composer/issues/167)) ([597f1a4](https://github.com/terraform-google-modules/terraform-google-composer/commit/597f1a44ce0a4469211c5b4e074c28aae58c53bc))
17+
* customize dns name in sub-module composer_net ([#170](https://github.com/terraform-google-modules/terraform-google-composer/issues/170)) ([d19afed](https://github.com/terraform-google-modules/terraform-google-composer/commit/d19afed2e6d9e3e325d4fa793467baa503f78beb))
18+
19+
## [6.1.0](https://github.com/terraform-google-modules/terraform-google-composer/compare/v6.0.0...v6.1.0) (2025-02-11)
20+
21+
22+
### Features
23+
24+
* Add Composer v3 sub-module ([#155](https://github.com/terraform-google-modules/terraform-google-composer/issues/155)) ([444aa02](https://github.com/terraform-google-modules/terraform-google-composer/commit/444aa0234e2115950acdec3aea43dfa1bf2614f2))
25+
26+
## [6.0.0](https://github.com/terraform-google-modules/terraform-google-composer/compare/v5.2.0...v6.0.0) (2025-01-23)
27+
28+
29+
### ⚠ BREAKING CHANGES
30+
31+
* default composer image version
32+
33+
### Features
34+
35+
* add dns private zone variable ([#147](https://github.com/terraform-google-modules/terraform-google-composer/issues/147)) ([61f1f40](https://github.com/terraform-google-modules/terraform-google-composer/commit/61f1f40e5ae3deb85ea8147cbfb965564fca6aeb))
36+
37+
38+
### Bug Fixes
39+
40+
* (composer_net) warning because of null ip range in fw rules ([#148](https://github.com/terraform-google-modules/terraform-google-composer/issues/148)) ([3a12028](https://github.com/terraform-google-modules/terraform-google-composer/commit/3a1202878cdbb0c0ed7c1ea6d122cc8b51e8bc5c))
41+
* default composer image version ([320813a](https://github.com/terraform-google-modules/terraform-google-composer/commit/320813a7fecc205b93982dc07a18c0d09d108473))
42+
1143
## [5.2.0](https://github.com/terraform-google-modules/terraform-google-composer/compare/v5.1.0...v5.2.0) (2024-10-08)
1244

1345

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Simple usage is as follows:
3030
```hcl
3131
module "composer" {
3232
source = "terraform-google-modules/composer/google"
33-
version = "~> 5.2"
33+
version = "~> 6.2"
3434
3535
project_id = "<PROJECT ID>"
3636
region = "us-central1"

build/int.cloudbuild.yaml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -25,58 +25,68 @@ steps:
2525
- 'TF_VAR_folder_id=$_FOLDER_ID'
2626
- 'TF_VAR_billing_account=$_BILLING_ACCOUNT'
2727

28-
- id: create all
28+
- id: init-all
2929
waitFor:
3030
- prepare
3131
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
32-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create']
32+
args: ['/bin/bash', '-c', 'cft test run all --stage init --verbose']
3333

3434
# ----- SUITE simple-composer-env-v2
3535

36-
- id: init-simple-composer-env-v2
37-
waitFor:
38-
- create all
39-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
40-
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2Module --stage init --verbose']
4136
- id: apply-simple-composer-env-v2
4237
waitFor:
43-
- init-simple-composer-env-v2
38+
- init-all
4439
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
4540
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2Module --stage apply --verbose']
4641
- id: verify-simple-composer-env-v2
4742
waitFor:
4843
- apply-simple-composer-env-v2
4944
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
5045
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2Module --stage verify --verbose']
51-
- id: destroy-simple-composer-env-v2
52-
waitFor:
53-
- verify-simple-composer-env-v2
54-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
55-
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2Module --stage destroy --verbose']
56-
5746

5847
# ----- SUITE composer-v2-sharedvpc-prereq-local
5948

60-
- id: init-composer-v2-sharedvpc-prereq
61-
waitFor:
62-
- destroy-simple-composer-env-v2
63-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
64-
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2SharedVpcModule --stage init --verbose']
6549
- id: apply-composer-v2-sharedvpc-prereq
6650
waitFor:
67-
- init-composer-v2-sharedvpc-prereq
51+
- init-all
6852
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
6953
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2SharedVpcModule --stage apply --verbose']
7054
- id: verify-composer-v2-sharedvpc-prereq
7155
waitFor:
7256
- apply-composer-v2-sharedvpc-prereq
7357
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
7458
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2SharedVpcModule --stage verify --verbose']
75-
- id: destroy-composer-v2-sharedvpc-prereq
59+
60+
# ----- SUITE simple-composer-env-v3
61+
62+
- id: apply-simple-composer-env-v3
63+
waitFor:
64+
- init-all
65+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
66+
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV3Module --stage apply --verbose']
67+
- id: verify-simple-composer-env-v3
68+
waitFor:
69+
- apply-simple-composer-env-v3
70+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
71+
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV3Module --stage verify --verbose']
72+
73+
- id: destroy-v2
74+
waitFor:
75+
- verify-simple-composer-env-v2
76+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
77+
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2Module --stage verify --verbose']
78+
79+
- id: destroy-v2-sharedvpc-prereq
7680
waitFor:
7781
- verify-composer-v2-sharedvpc-prereq
7882
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
79-
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2SharedVpcModule --stage destroy --verbose']
83+
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV2SharedVpcModule --stage verify --verbose']
84+
85+
- id: destroy-v3
86+
waitFor:
87+
- verify-simple-composer-env-v3
88+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
89+
args: ['/bin/bash', '-c', 'cft test run TestSimpleComposerEnvV3Module --stage verify --verbose']
8090

8191
tags:
8292
- 'ci'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Simple Cloud Composer Environment (V3) Example
2+
3+
This example illustrates how to use the `composer` V2 module to deploy private composer environment with private service connect (PSC) endpoint to connect network attachments.
4+
5+
This example also creates a Cloud Storage Bucket for scheduled snapshots and assign appropriate permission(s) to Composer Service Account on the bucket.
6+
7+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
8+
## Inputs
9+
10+
| Name | Description | Type | Default | Required |
11+
|------|-------------|------|---------|:--------:|
12+
| composer\_env\_name | Name of Cloud Composer Environment. | `string` | `"ci-composer"` | no |
13+
| composer\_sa | Service Account to be used for running Cloud Composer Environment. | `string` | n/a | yes |
14+
| project\_id | Project ID where Cloud Composer Environment is created. | `string` | n/a | yes |
15+
| region | Region where Cloud Composer Environment is created. | `string` | `"us-central1"` | no |
16+
17+
## Outputs
18+
19+
| Name | Description |
20+
|------|-------------|
21+
| airflow\_uri | URI of the Apache Airflow Web UI hosted within the Cloud Composer Environment. |
22+
| composer\_env\_id | ID of Cloud Composer Environment. |
23+
| composer\_env\_name | Name of the Cloud Composer Environment. |
24+
| gcs\_bucket | Google Cloud Storage bucket which hosts DAGs for the Cloud Composer Environment. |
25+
| project\_id | Project ID where Cloud Composer Environment is created. |
26+
27+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
28+
29+
To provision this example, run the following from within this directory:
30+
- `terraform init` to get the plugins
31+
- `terraform plan` to see the infrastructure plan
32+
- `terraform apply` to apply the infrastructure build
33+
- `terraform destroy` to destroy the built infrastructure
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
resource "random_string" "key_suffix" {
18+
length = 5
19+
special = false
20+
upper = false
21+
}
22+
23+
# Create a bucket to store the snapshots
24+
resource "google_storage_bucket" "my_bucket" {
25+
project = var.project_id
26+
name = "snapshot-bucket-${random_string.key_suffix.result}"
27+
location = var.region
28+
force_destroy = true
29+
uniform_bucket_level_access = true
30+
}
31+
32+
resource "google_storage_bucket_iam_member" "object_admin" {
33+
bucket = google_storage_bucket.my_bucket.name
34+
role = "roles/storage.objectAdmin"
35+
member = "serviceAccount:${var.composer_sa}"
36+
}
37+
38+
module "simple-composer-environment" {
39+
source = "terraform-google-modules/composer/google//modules/create_environment_v3"
40+
version = "~> 6.0"
41+
42+
project_id = var.project_id
43+
composer_env_name = var.composer_env_name
44+
region = var.region
45+
composer_service_account = var.composer_sa
46+
network = google_compute_network.main.name
47+
subnetwork = google_compute_subnetwork.main.name
48+
create_network_attachment = true
49+
50+
grant_sa_agent_permission = false
51+
environment_size = "ENVIRONMENT_SIZE_SMALL"
52+
53+
use_private_environment = true
54+
enable_private_builds_only = true
55+
cloud_data_lineage_integration = true
56+
resilience_mode = "STANDARD_RESILIENCE"
57+
58+
scheduled_snapshots_config = {
59+
enabled = true
60+
snapshot_location = google_storage_bucket.my_bucket.url
61+
snapshot_creation_schedule = "0 4 * * *"
62+
time_zone = "UTC+01"
63+
}
64+
65+
maintenance_start_time = "2025-02-01T00:00:00Z"
66+
maintenance_end_time = "2025-05-01T12:00:00Z"
67+
maintenance_recurrence = "FREQ=WEEKLY;BYDAY=SU,SA"
68+
69+
depends_on = [
70+
google_storage_bucket_iam_member.object_admin,
71+
]
72+
73+
web_server_network_access_control = [
74+
{
75+
allowed_ip_range = "192.0.2.0/24"
76+
description = "office net 1"
77+
},
78+
{
79+
allowed_ip_range = "192.0.4.0/24"
80+
description = "office net 2"
81+
},
82+
]
83+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
resource "google_compute_network" "main" {
18+
project = var.project_id
19+
name = "ci-composer-test-${random_string.suffix.result}"
20+
auto_create_subnetworks = false
21+
}
22+
23+
resource "google_compute_subnetwork" "main" {
24+
project = var.project_id
25+
name = "ci-composer-test-${random_string.suffix.result}"
26+
ip_cidr_range = "10.0.0.0/17"
27+
region = var.region
28+
network = google_compute_network.main.self_link
29+
private_ip_google_access = true
30+
}
31+
32+
resource "random_string" "suffix" {
33+
length = 4
34+
special = false
35+
upper = false
36+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
output "project_id" {
18+
description = "Project ID where Cloud Composer Environment is created."
19+
value = var.project_id
20+
}
21+
22+
output "composer_env_name" {
23+
description = "Name of the Cloud Composer Environment."
24+
value = module.simple-composer-environment.composer_env_name
25+
}
26+
27+
output "composer_env_id" {
28+
description = "ID of Cloud Composer Environment."
29+
value = module.simple-composer-environment.composer_env_id
30+
}
31+
32+
output "gcs_bucket" {
33+
description = "Google Cloud Storage bucket which hosts DAGs for the Cloud Composer Environment."
34+
value = module.simple-composer-environment.gcs_bucket
35+
}
36+
37+
output "airflow_uri" {
38+
description = "URI of the Apache Airflow Web UI hosted within the Cloud Composer Environment."
39+
value = module.simple-composer-environment.airflow_uri
40+
}

0 commit comments

Comments
 (0)