Skip to content

Commit dacda8f

Browse files
Update Cloud Run Resource to make containerPort be optional (#5677) (#11040)
* change to optional per docs * fix formatting issues Signed-off-by: Modular Magician <[email protected]>
1 parent ed2c3bc commit dacda8f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.changelog/5677.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
cloudrun: updated `containers.ports.container_port` to be optional instead of required on `google_cloud_run_service`
3+
```

google/resource_cloud_run_service.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,19 @@ https://cloud.google.com/run/docs/reference/rest/v1/RevisionSpec#ContainerPort`,
295295
Schema: map[string]*schema.Schema{
296296
"container_port": {
297297
Type: schema.TypeInt,
298-
Required: true,
299-
Description: `Port number.`,
298+
Optional: true,
299+
Description: `Port number the container listens on. This must be a valid port number, 0 < x < 65536.`,
300300
},
301301
"name": {
302302
Type: schema.TypeString,
303303
Computed: true,
304304
Optional: true,
305-
Description: `Name of the port.`,
305+
Description: `If specified, used to specify which protocol to use. Allowed values are "http1" and "h2c".`,
306306
},
307307
"protocol": {
308308
Type: schema.TypeString,
309309
Optional: true,
310-
Description: `Protocol used on port. Defaults to TCP.`,
310+
Description: `Protocol for port. Must be "TCP". Defaults to "TCP".`,
311311
},
312312
},
313313
},

website/docs/r/cloud_run_service.html.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -737,15 +737,15 @@ The following arguments are supported:
737737

738738
* `name` -
739739
(Optional)
740-
Name of the port.
740+
If specified, used to specify which protocol to use. Allowed values are "http1" and "h2c".
741741

742742
* `protocol` -
743743
(Optional)
744-
Protocol used on port. Defaults to TCP.
744+
Protocol for port. Must be "TCP". Defaults to "TCP".
745745

746746
* `container_port` -
747-
(Required)
748-
Port number.
747+
(Optional)
748+
Port number the container listens on. This must be a valid port number, 0 < x < 65536.
749749

750750
<a name="nested_resources"></a>The `resources` block supports:
751751

0 commit comments

Comments
 (0)