...
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```hcl
18resource "google_cloud_run_v2_service" "default" {
19 name = "cloudrun-service"
20 location = "us-central1"
21
22 template {
23 containers {
24 image = "us-docker.pkg.dev/cloudrun/container/hello"
25 startup_probe {
26 initial_delay_seconds = 0
27 timeout_seconds = 1
28 period_seconds = 3
29 failure_threshold = 1
30 tcp_socket {
31 port = 8080
32 }
33 }
34 liveness_probe {
35 http_get {
36 path = "/"
37 }
38 }
39 }
40 }
41}
42```
View as plain text