@@ -50,38 +50,38 @@ To get more information about RegionNetworkEndpointGroup, see:
5050
5151
5252``` 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"
8585}
8686```
8787<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
@@ -93,32 +93,32 @@ resource "google_storage_bucket_object" "archive" {
9393
9494
9595``` 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+ }
122122}
123123```
124124<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
@@ -130,80 +130,80 @@ resource "google_cloud_run_service" "cloudrun_neg" {
130130
131131
132132``` 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"
207207}
208208```
209209<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
@@ -215,13 +215,13 @@ resource "google_storage_bucket_object" "appengine_neg" {
215215
216216
217217``` 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+ }
225225}
226226```
227227<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
0 commit comments