@@ -50,38 +50,38 @@ To get more information about RegionNetworkEndpointGroup, see:
50
50
51
51
52
52
``` hcl
53
- // Cloud Functions Example
54
- resource "google_compute_region_network_endpoint_group" "function_neg" {
55
- name = "function-neg"
56
- network_endpoint_type = "SERVERLESS"
57
- region = "us-central1"
58
- cloud_function {
59
- function = google_cloudfunctions_function.function_neg.name
60
- }
61
- }
62
-
63
- resource "google_cloudfunctions_function" "function_neg" {
64
- name = "function-neg"
65
- description = "My function"
66
- runtime = "nodejs20"
67
-
68
- available_memory_mb = 128
69
- source_archive_bucket = google_storage_bucket.bucket.name
70
- source_archive_object = google_storage_bucket_object.archive.name
71
- trigger_http = true
72
- timeout = 60
73
- entry_point = "helloGET"
74
- }
75
-
76
- resource "google_storage_bucket" "bucket" {
77
- name = "cloudfunctions-function-example-bucket"
78
- location = "US"
79
- }
80
-
81
- resource "google_storage_bucket_object" "archive" {
82
- name = "index.zip"
83
- bucket = google_storage_bucket.bucket.name
84
- source = "path/to/index.zip"
53
+ // Cloud Functions Example
54
+ resource "google_compute_region_network_endpoint_group" "function_neg" {
55
+ name = "function-neg"
56
+ network_endpoint_type = "SERVERLESS"
57
+ region = "us-central1"
58
+ cloud_function {
59
+ function = google_cloudfunctions_function.function_neg.name
60
+ }
61
+ }
62
+
63
+ resource "google_cloudfunctions_function" "function_neg" {
64
+ name = "function-neg"
65
+ description = "My function"
66
+ runtime = "nodejs20"
67
+
68
+ available_memory_mb = 128
69
+ source_archive_bucket = google_storage_bucket.bucket.name
70
+ source_archive_object = google_storage_bucket_object.archive.name
71
+ trigger_http = true
72
+ timeout = 60
73
+ entry_point = "helloGET"
74
+ }
75
+
76
+ resource "google_storage_bucket" "bucket" {
77
+ name = "cloudfunctions-function-example-bucket"
78
+ location = "US"
79
+ }
80
+
81
+ resource "google_storage_bucket_object" "archive" {
82
+ name = "index.zip"
83
+ bucket = google_storage_bucket.bucket.name
84
+ source = "path/to/index.zip"
85
85
}
86
86
```
87
87
<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
@@ -93,32 +93,32 @@ resource "google_storage_bucket_object" "archive" {
93
93
94
94
95
95
``` hcl
96
- // Cloud Run Example
97
- resource "google_compute_region_network_endpoint_group" "cloudrun_neg" {
98
- name = "cloudrun-neg"
99
- network_endpoint_type = "SERVERLESS"
100
- region = "us-central1"
101
- cloud_run {
102
- service = google_cloud_run_service.cloudrun_neg.name
103
- }
104
- }
105
-
106
- resource "google_cloud_run_service" "cloudrun_neg" {
107
- name = "cloudrun-neg"
108
- location = "us-central1"
109
-
110
- template {
111
- spec {
112
- containers {
113
- image = "us-docker.pkg.dev/cloudrun/container/hello"
114
- }
115
- }
116
- }
117
-
118
- traffic {
119
- percent = 100
120
- latest_revision = true
121
- }
96
+ // Cloud Run Example
97
+ resource "google_compute_region_network_endpoint_group" "cloudrun_neg" {
98
+ name = "cloudrun-neg"
99
+ network_endpoint_type = "SERVERLESS"
100
+ region = "us-central1"
101
+ cloud_run {
102
+ service = google_cloud_run_service.cloudrun_neg.name
103
+ }
104
+ }
105
+
106
+ resource "google_cloud_run_service" "cloudrun_neg" {
107
+ name = "cloudrun-neg"
108
+ location = "us-central1"
109
+
110
+ template {
111
+ spec {
112
+ containers {
113
+ image = "us-docker.pkg.dev/cloudrun/container/hello"
114
+ }
115
+ }
116
+ }
117
+
118
+ traffic {
119
+ percent = 100
120
+ latest_revision = true
121
+ }
122
122
}
123
123
```
124
124
<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
@@ -130,80 +130,80 @@ resource "google_cloud_run_service" "cloudrun_neg" {
130
130
131
131
132
132
``` hcl
133
- // App Engine Example
134
- resource "google_compute_region_network_endpoint_group" "appengine_neg" {
135
- name = "appengine-neg"
136
- network_endpoint_type = "SERVERLESS"
137
- region = "us-central1"
138
- app_engine {
139
- service = google_app_engine_flexible_app_version.appengine_neg.service
140
- version = google_app_engine_flexible_app_version.appengine_neg.version_id
141
- }
142
- }
143
-
144
- resource "google_app_engine_flexible_app_version" "appengine_neg" {
145
- version_id = "v1"
146
- service = "appengine-neg"
147
- runtime = "nodejs"
148
- flexible_runtime_settings {
149
- operating_system = "ubuntu22"
150
- runtime_version = "20"
151
- }
152
-
153
- entrypoint {
154
- shell = "node ./app.js"
155
- }
156
-
157
- deployment {
158
- zip {
159
- source_url = "https://storage.googleapis.com/${google_storage_bucket.appengine_neg.name}/${google_storage_bucket_object.appengine_neg.name}"
160
- }
161
- }
162
-
163
- liveness_check {
164
- path = "/"
165
- }
166
-
167
- readiness_check {
168
- path = "/"
169
- }
170
-
171
- env_variables = {
172
- port = "8080"
173
- }
174
-
175
- handlers {
176
- url_regex = ".*\\/my-path\\/*"
177
- security_level = "SECURE_ALWAYS"
178
- login = "LOGIN_REQUIRED"
179
- auth_fail_action = "AUTH_FAIL_ACTION_REDIRECT"
180
-
181
- static_files {
182
- path = "my-other-path"
183
- upload_path_regex = ".*\\/my-path\\/*"
184
- }
185
- }
186
-
187
- automatic_scaling {
188
- cool_down_period = "120s"
189
- cpu_utilization {
190
- target_utilization = 0.5
191
- }
192
- }
193
-
194
- delete_service_on_destroy = true
195
- }
196
-
197
- resource "google_storage_bucket" "appengine_neg" {
198
- name = "appengine-neg"
199
- location = "US"
200
- uniform_bucket_level_access = true
201
- }
202
-
203
- resource "google_storage_bucket_object" "appengine_neg" {
204
- name = "hello-world.zip"
205
- bucket = google_storage_bucket.appengine_neg.name
206
- source = "./test-fixtures/hello-world.zip"
133
+ // App Engine Example
134
+ resource "google_compute_region_network_endpoint_group" "appengine_neg" {
135
+ name = "appengine-neg"
136
+ network_endpoint_type = "SERVERLESS"
137
+ region = "us-central1"
138
+ app_engine {
139
+ service = google_app_engine_flexible_app_version.appengine_neg.service
140
+ version = google_app_engine_flexible_app_version.appengine_neg.version_id
141
+ }
142
+ }
143
+
144
+ resource "google_app_engine_flexible_app_version" "appengine_neg" {
145
+ version_id = "v1"
146
+ service = "appengine-neg"
147
+ runtime = "nodejs"
148
+ flexible_runtime_settings {
149
+ operating_system = "ubuntu22"
150
+ runtime_version = "20"
151
+ }
152
+
153
+ entrypoint {
154
+ shell = "node ./app.js"
155
+ }
156
+
157
+ deployment {
158
+ zip {
159
+ source_url = "https://storage.googleapis.com/${google_storage_bucket.appengine_neg.name}/${google_storage_bucket_object.appengine_neg.name}"
160
+ }
161
+ }
162
+
163
+ liveness_check {
164
+ path = "/"
165
+ }
166
+
167
+ readiness_check {
168
+ path = "/"
169
+ }
170
+
171
+ env_variables = {
172
+ port = "8080"
173
+ }
174
+
175
+ handlers {
176
+ url_regex = ".*\\/my-path\\/*"
177
+ security_level = "SECURE_ALWAYS"
178
+ login = "LOGIN_REQUIRED"
179
+ auth_fail_action = "AUTH_FAIL_ACTION_REDIRECT"
180
+
181
+ static_files {
182
+ path = "my-other-path"
183
+ upload_path_regex = ".*\\/my-path\\/*"
184
+ }
185
+ }
186
+
187
+ automatic_scaling {
188
+ cool_down_period = "120s"
189
+ cpu_utilization {
190
+ target_utilization = 0.5
191
+ }
192
+ }
193
+
194
+ delete_service_on_destroy = true
195
+ }
196
+
197
+ resource "google_storage_bucket" "appengine_neg" {
198
+ name = "appengine-neg"
199
+ location = "US"
200
+ uniform_bucket_level_access = true
201
+ }
202
+
203
+ resource "google_storage_bucket_object" "appengine_neg" {
204
+ name = "hello-world.zip"
205
+ bucket = google_storage_bucket.appengine_neg.name
206
+ source = "./test-fixtures/hello-world.zip"
207
207
}
208
208
```
209
209
<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
@@ -215,13 +215,13 @@ resource "google_storage_bucket_object" "appengine_neg" {
215
215
216
216
217
217
``` hcl
218
- // App Engine Example
219
- resource "google_compute_region_network_endpoint_group" "appengine_neg" {
220
- name = "appengine-neg"
221
- network_endpoint_type = "SERVERLESS"
222
- region = "us-central1"
223
- app_engine {
224
- }
218
+ // App Engine Example
219
+ resource "google_compute_region_network_endpoint_group" "appengine_neg" {
220
+ name = "appengine-neg"
221
+ network_endpoint_type = "SERVERLESS"
222
+ region = "us-central1"
223
+ app_engine {
224
+ }
225
225
}
226
226
```
227
227
<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
0 commit comments