Skip to content

Commit 747f5a9

Browse files
Add Cloud Run - Traffic Splitting example (#3500) (#2062)
Signed-off-by: Modular Magician <[email protected]>
1 parent 0334d71 commit 747f5a9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.changelog/3500.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:none
2+
```

website/docs/r/cloud_run_service.html.markdown

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,37 @@ resource "google_cloud_run_service" "default" {
185185
autogenerate_revision_name = true
186186
}
187187
```
188+
## Example Usage - Cloud Run Service Traffic Split
189+
190+
191+
```hcl
192+
resource "google_cloud_run_service" "default" {
193+
name = "cloudrun-srv"
194+
location = "us-central1"
195+
196+
template {
197+
spec {
198+
containers {
199+
image = "gcr.io/cloudrun/hello"
200+
}
201+
}
202+
metadata {
203+
name = "cloudrun-srv-green"
204+
}
205+
}
206+
207+
traffic {
208+
percent = 25
209+
revision_name = "cloudrun-srv-green"
210+
}
211+
212+
traffic {
213+
percent = 75
214+
# This revision needs to already exist
215+
revision_name = "cloudrun-srv-blue"
216+
}
217+
}
218+
```
188219

189220
## Argument Reference
190221

0 commit comments

Comments
 (0)