Skip to content

Commit b363509

Browse files
SCSAndreSamir-CitNickElliot
authored
Add Terraform support for GCS in Global Internal Load Balancers (#14679)
Co-authored-by: samir-cit <samir@ciandt.com> Co-authored-by: Nick Elliot <nickelliot@google.com>
1 parent a161067 commit b363509

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mmv1/products/compute/BackendBucket.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ examples:
115115
backend_bucket_name: 'global-ilb-backend-bucket'
116116
bucket_name: 'global-ilb-bucket'
117117
exclude_docs: true
118+
skip_vcr: true
118119
parameters:
119120
properties:
120121
- name: 'bucketName'
@@ -273,7 +274,9 @@ properties:
273274
client when the resource is created.
274275
- name: 'enableCdn'
275276
type: Boolean
276-
description: 'If true, enable Cloud CDN for this BackendBucket.'
277+
description: |
278+
If true, enable Cloud CDN for this BackendBucket.
279+
Note: This cannot be set to true when loadBalancingScheme is set to INTERNAL_MANAGED.
277280
include_empty_value_in_cai: true
278281
- name: 'name'
279282
type: String
@@ -295,6 +298,7 @@ properties:
295298
description: |
296299
The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer.
297300
If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both.
301+
Important: CDN cannot be enabled (enableCdn cannot be set to true) when loadBalancingScheme is set to INTERNAL_MANAGED.
298302
enum_values:
299303
- 'INTERNAL_MANAGED'
300304
send_empty_value: true

mmv1/templates/terraform/examples/backend_bucket_global_ilb.tf.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Note: This example must be run in a project without Cloud Armor tier configured,
2+
# as it may cause conflicts with the INTERNAL_MANAGED load balancing scheme.
3+
# This test is skipped in VCR mode due to non-determinism in project creation and resource management.
4+
15
resource "google_project" "unarmored" {
26
project_id = "tf-test%{random_suffix}"
37
name = "tf-test%{random_suffix}"
@@ -14,7 +18,7 @@ resource "google_project_service" "project" {
1418

1519
resource "google_compute_backend_bucket" "{{$.PrimaryResourceId}}" {
1620
name = "{{index $.Vars "backend_bucket_name"}}"
17-
project = google_project.unarmored.name
21+
project = google_project.unarmored.number
1822
bucket_name = google_storage_bucket.{{$.PrimaryResourceId}}.name
1923
load_balancing_scheme = "INTERNAL_MANAGED"
2024

0 commit comments

Comments
 (0)