From d9dcd70d0ba507b3ad02261a5eaf75c4e43d572d Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 4 Feb 2022 19:33:20 +0000 Subject: [PATCH] Update Cloud Run Resource to make containerPort be optional (#5677) * change to optional per docs * fix formatting issues Signed-off-by: Modular Magician --- .changelog/5677.txt | 3 +++ google/resource_cloud_run_service.go | 8 ++++---- website/docs/r/cloud_run_service.html.markdown | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .changelog/5677.txt diff --git a/.changelog/5677.txt b/.changelog/5677.txt new file mode 100644 index 00000000000..897cc4901b1 --- /dev/null +++ b/.changelog/5677.txt @@ -0,0 +1,3 @@ +```release-note:bug +cloudrun: updated `containers.ports.container_port` to be optional instead of required on `google_cloud_run_service` +``` diff --git a/google/resource_cloud_run_service.go b/google/resource_cloud_run_service.go index 3734d41cea9..ae69cc432d5 100644 --- a/google/resource_cloud_run_service.go +++ b/google/resource_cloud_run_service.go @@ -295,19 +295,19 @@ https://cloud.google.com/run/docs/reference/rest/v1/RevisionSpec#ContainerPort`, Schema: map[string]*schema.Schema{ "container_port": { Type: schema.TypeInt, - Required: true, - Description: `Port number.`, + Optional: true, + Description: `Port number the container listens on. This must be a valid port number, 0 < x < 65536.`, }, "name": { Type: schema.TypeString, Computed: true, Optional: true, - Description: `Name of the port.`, + Description: `If specified, used to specify which protocol to use. Allowed values are "http1" and "h2c".`, }, "protocol": { Type: schema.TypeString, Optional: true, - Description: `Protocol used on port. Defaults to TCP.`, + Description: `Protocol for port. Must be "TCP". Defaults to "TCP".`, }, }, }, diff --git a/website/docs/r/cloud_run_service.html.markdown b/website/docs/r/cloud_run_service.html.markdown index a65cfbbab78..5551039dcbb 100644 --- a/website/docs/r/cloud_run_service.html.markdown +++ b/website/docs/r/cloud_run_service.html.markdown @@ -737,15 +737,15 @@ The following arguments are supported: * `name` - (Optional) - Name of the port. + If specified, used to specify which protocol to use. Allowed values are "http1" and "h2c". * `protocol` - (Optional) - Protocol used on port. Defaults to TCP. + Protocol for port. Must be "TCP". Defaults to "TCP". * `container_port` - - (Required) - Port number. + (Optional) + Port number the container listens on. This must be a valid port number, 0 < x < 65536. The `resources` block supports: