Skip to content

Commit 26ec230

Browse files
authored
Merge branch 'main' into optional_ports
2 parents 255e3c3 + 2004e37 commit 26ec230

File tree

43 files changed

+1751
-767
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1751
-767
lines changed

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ The format is based on
77
and this project adheres to
88
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10+
## [0.20.1](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/compare/v0.20.0...v0.20.1) (2025-07-16)
11+
12+
13+
### Bug Fixes
14+
15+
* remove alternate defaults for liveness and startup probe ([#371](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/371)) ([26d1d07](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/26d1d0726f515e0e136777d53f555d6a73eca952))
16+
17+
## [0.20.0](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/compare/v0.19.0...v0.20.0) (2025-07-15)
18+
19+
20+
### Features
21+
22+
* Add support for mounting gcs bucket in cloud run job ([#326](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/326)) ([1d470f1](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/1d470f14059a00fc4fa09e62cbe013a91d6be93c))
23+
24+
25+
### Bug Fixes
26+
27+
* fixed liveness_probe and startup_probe alt defaults ([#370](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/370)) ([ec886b5](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/ec886b56536aa21565a168a2f0ee6cd7697b8e4d))
28+
* typo in min_instance ([#367](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/367)) ([9f0bd11](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/9f0bd1150382cab4c9bf24019abc85b8e597a2da))
29+
30+
## [0.19.0](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/compare/v0.18.0...v0.19.0) (2025-07-14)
31+
32+
33+
### Features
34+
35+
* Add connections for Memorystore in metadata.yaml ([#356](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/356)) ([7cf3156](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/7cf3156c460f0b8cc5a811bfeecf5753f2c7ea08))
36+
* Add GPU support for services. ([#352](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/352)) ([522aa12](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/522aa12ff90586c88b65f88f21212d74547f0146))
37+
* Identity-Aware Proxy (IAP) integration in Cloud Run v2 modules ([#353](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/353)) ([110fba6](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/110fba63986e3d1806b32b5d0f637064f3f2807b))
38+
39+
40+
### Bug Fixes
41+
42+
* added field descriptions and validations ([#355](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/355)) ([db4f870](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/db4f8703d81dbf2bba2a655590656b1ce3804dd9))
43+
* trigger google_compute_default_service_account datasource only if the service account name is not provided ([#361](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/361)) ([403cacd](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/403cacd83d1ef3058319f1caa8f246606e6727fe))
44+
* update metadata and fix issue of service container name not being present ([#364](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/issues/364)) ([ae97b62](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/commit/ae97b626dd6a7928e0ef36cae8fa12fe842e6973))
45+
1046
## [0.18.0](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/compare/v0.17.5...v0.18.0) (2025-06-25)
1147

1248

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.24
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.25
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

@@ -40,7 +40,7 @@ docker_generate_docs:
4040
-e ENABLE_BPMETADATA=1 \
4141
-v $(CURDIR):/workspace \
4242
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
43-
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs'
43+
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs --per-module-requirements'
4444

4545
# Alias for backwards compatibility
4646
.PHONY: generate_docs
@@ -90,6 +90,7 @@ docker_test_cleanup:
9090
docker_test_integration:
9191
docker run --rm -it \
9292
-e SERVICE_ACCOUNT_JSON \
93+
-e TF_VAR_project_id \
9394
-v "$(CURDIR)":/workspace \
9495
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
9596
/usr/local/bin/test_integration.sh

build/int.cloudbuild.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
timeout: 3600s
15+
timeout: 7200s
1616
steps:
1717
- id: swap-module-refs
1818
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
@@ -130,9 +130,38 @@ steps:
130130
- id: v2-gmp-teardown
131131
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
132132
args: ['/bin/bash', '-c', 'cft test run TestV2WithGMP --stage teardown --verbose']
133+
- id: v2-iap-init
134+
waitFor:
135+
- v2-gmp-teardown
136+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
137+
args: ['/bin/bash', '-c', 'cft test run TestV2WithIAP --stage init --verbose']
138+
- id: v2-iap-apply
139+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
140+
args: ['/bin/bash', '-c', 'cft test run TestV2WithIAP --stage apply --verbose']
141+
- id: v2-iap-verify
142+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
143+
args: ['/bin/bash', '-c', 'cft test run TestV2WithIAP --stage verify --verbose']
144+
- id: v2-iap-teardown
145+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
146+
args: ['/bin/bash', '-c', 'cft test run TestV2WithIAP --stage teardown --verbose']
147+
- id: v2-gpu-init
148+
waitFor:
149+
- v2-iap-teardown
150+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
151+
args: ['/bin/bash', '-c', 'cft test run TestV2WithGPU --stage init --verbose']
152+
- id: v2-gpu-apply
153+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
154+
args: ['/bin/bash', '-c', 'cft test run TestV2WithGPU --stage apply --verbose']
155+
- id: v2-gpu-verify
156+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
157+
args: ['/bin/bash', '-c', 'cft test run TestV2WithGPU --stage verify --verbose']
158+
- id: v2-gpu-teardown
159+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
160+
args: ['/bin/bash', '-c', 'cft test run TestV2WithGPU --stage teardown --verbose']
161+
133162
tags:
134163
- 'ci'
135164
- 'integration'
136165
substitutions:
137166
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
138-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.24'
167+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.25'

build/lint.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121
- 'lint'
2222
substitutions:
2323
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
24-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.24'
24+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.25'
2525
options:
2626
env:
2727
- DISABLE_TFLINT=1

examples/v2_with_gpu/main.tf

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 "google_service_account" "sa" {
18+
project = var.project_id
19+
account_id = "ci-cloud-run-v2-sa"
20+
display_name = "Service account for ci-cloud-run-v2"
21+
}
22+
23+
module "cloud_run_v2_gpu" {
24+
source = "GoogleCloudPlatform/cloud-run/google//modules/v2"
25+
26+
service_name = "ci-cloud-run-v2-gpu"
27+
project_id = var.project_id
28+
location = "us-central1"
29+
create_service_account = false
30+
service_account = google_service_account.sa.email
31+
32+
cloud_run_deletion_protection = var.cloud_run_deletion_protection
33+
34+
containers = [{
35+
container_image = "us-docker.pkg.dev/cloudrun/container/hello"
36+
resources = {
37+
limits = {
38+
cpu = "4"
39+
memory = "16Gi"
40+
nvidia_gpu = "1"
41+
}
42+
cpu_idle = false
43+
}
44+
}]
45+
node_selector = {
46+
"accelerator" = "nvidia-l4"
47+
}
48+
gpu_zonal_redundancy_disabled = true
49+
}

examples/v2_with_gpu/outputs.tf

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 "service_name" {
18+
value = module.cloud_run_v2_gpu.service_name
19+
description = "Name of the created service"
20+
}
21+
22+
output "revision" {
23+
value = module.cloud_run_v2_gpu.latest_created_revision
24+
description = "Deployed revision for the service"
25+
}
26+
27+
output "service_url" {
28+
value = module.cloud_run_v2_gpu.service_uri
29+
description = "The URL on which the deployed service is available"
30+
}
31+
32+
output "service_id" {
33+
value = module.cloud_run_v2_gpu.service_id
34+
description = "Unique Identifier for the created service"
35+
}
36+
37+
output "service_location" {
38+
value = module.cloud_run_v2_gpu.location
39+
description = "Location in which the Cloud Run service was created"
40+
}

examples/v2_with_gpu/variables.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
variable "project_id" {
18+
description = "The project ID to deploy to"
19+
type = string
20+
}
21+
22+
variable "cloud_run_deletion_protection" {
23+
type = bool
24+
description = "This field prevents Terraform from destroying or recreating the Cloud Run v2 Jobs and Services"
25+
default = false
26+
}

examples/v2_with_iap/main.tf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
module "cloud_run_v2" {
18+
source = "GoogleCloudPlatform/cloud-run/google//modules/v2"
19+
version = "~> 0.16"
20+
21+
service_name = "ci-cloud-run-v2-iap"
22+
project_id = var.project_id
23+
location = "us-central1"
24+
containers = [
25+
{
26+
container_image = "us-docker.pkg.dev/cloudrun/container/hello"
27+
container_name = "hello-world"
28+
}
29+
]
30+
31+
launch_stage = "BETA"
32+
iap_members = ["user:[email protected]"]
33+
cloud_run_deletion_protection = false
34+
}

examples/v2_with_iap/outputs.tf

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
value = module.cloud_run_v2.project_id
19+
description = "Project ID of the service"
20+
}
21+
22+
output "service_name" {
23+
value = module.cloud_run_v2.service_name
24+
description = "Name of the created service"
25+
}
26+
27+
output "service_uri" {
28+
value = module.cloud_run_v2.service_uri
29+
description = "The URL on which the deployed service is available"
30+
}
31+
32+
output "service_id" {
33+
value = module.cloud_run_v2.service_id
34+
description = "Unique Identifier for the created service with format projects/{{project}}/locations/{{location}}/services/{{name}}"
35+
}
36+
37+
output "service_location" {
38+
value = module.cloud_run_v2.location
39+
description = "Location in which the Cloud Run service was created"
40+
}
41+
42+
output "traffic_statuses" {
43+
value = module.cloud_run_v2.traffic_statuses
44+
description = "Detailed status information for corresponding traffic targets."
45+
}
46+
47+
output "observed_generation" {
48+
value = module.cloud_run_v2.observed_generation
49+
description = "The generation of this Service currently serving traffic."
50+
}

examples/v2_with_iap/variables.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
variable "project_id" {
18+
description = "The project ID to deploy to"
19+
type = string
20+
}

0 commit comments

Comments
 (0)