diff --git a/mmv1/products/cloudrunv2/Service.yaml b/mmv1/products/cloudrunv2/Service.yaml index c660602f657..88929c429ed 100644 --- a/mmv1/products/cloudrunv2/Service.yaml +++ b/mmv1/products/cloudrunv2/Service.yaml @@ -266,6 +266,11 @@ properties: name: 'minInstanceCount' description: | Minimum number of instances for the service, to be divided among all revisions receiving traffic. + - !ruby/object:Api::Type::Boolean + name: 'defaultUriDisabled' + min_version: beta + description: |- + Disables public resolution of the default URI of this service. - !ruby/object:Api::Type::NestedObject name: 'template' required: true diff --git a/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb b/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb index b4379dc5a55..e8e95eeab0e 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb +++ b/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb @@ -895,6 +895,60 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceAttributionLabel(t *testing.T) { }) } +func testAccCloudRunV2Service_cloudrunv2ServiceWithAttributionLabel(context map[string]interface{}) string { + return acctest.Nprintf(` +provider "google" { + add_terraform_attribution_label = %{add_attribution} + terraform_attribution_label_addition_strategy = "%{attribution_strategy}" +} + +resource "google_cloud_run_v2_service" "default" { + name = "tf-test-cloudrun-service%{random_suffix}" + location = "us-central1" + + labels = { + user_label = "foo" + } + + template { + containers { + image = "us-docker.pkg.dev/cloudrun/container/hello" + ports { + container_port = 8080 + } + } + } +} +`, context) +} + +func testAccCloudRunV2Service_cloudrunv2ServiceWithAttributionLabelUpdate(context map[string]interface{}) string { + return acctest.Nprintf(` +provider "google" { + add_terraform_attribution_label = %{add_attribution} + terraform_attribution_label_addition_strategy = "%{attribution_strategy}" +} + +resource "google_cloud_run_v2_service" "default" { + name = "tf-test-cloudrun-service%{random_suffix}" + location = "us-central1" + + labels = { + user_label = "bar" + } + + template { + containers { + image = "us-docker.pkg.dev/cloudrun/container/hello" + ports { + container_port = 8080 + } + } + } +} +`, context) +} + <% unless version == 'ga' -%> func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testing.T) { t.Parallel() @@ -907,7 +961,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testin CheckDestroy: testAccCheckCloudRunV2ServiceDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstances(context), + Config: testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled(context), }, { ResourceName: "google_cloud_run_v2_service.default", @@ -960,7 +1014,7 @@ resource "google_cloud_run_v2_service" "default" { `, context) } -func testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstances(context map[string]interface{}) string { +func testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" @@ -979,6 +1033,7 @@ resource "google_cloud_run_v2_service" "default" { scaling { min_instance_count = 1 } + default_uri_disabled = true template { containers { name = "container-1" @@ -995,57 +1050,3 @@ resource "google_cloud_run_v2_service" "default" { `, context) } <% end -%> - -func testAccCloudRunV2Service_cloudrunv2ServiceWithAttributionLabel(context map[string]interface{}) string { - return acctest.Nprintf(` -provider "google" { - add_terraform_attribution_label = %{add_attribution} - terraform_attribution_label_addition_strategy = "%{attribution_strategy}" -} - -resource "google_cloud_run_v2_service" "default" { - name = "tf-test-cloudrun-service%{random_suffix}" - location = "us-central1" - - labels = { - user_label = "foo" - } - - template { - containers { - image = "us-docker.pkg.dev/cloudrun/container/hello" - ports { - container_port = 8080 - } - } - } -} -`, context) -} - -func testAccCloudRunV2Service_cloudrunv2ServiceWithAttributionLabelUpdate(context map[string]interface{}) string { - return acctest.Nprintf(` -provider "google" { - add_terraform_attribution_label = %{add_attribution} - terraform_attribution_label_addition_strategy = "%{attribution_strategy}" -} - -resource "google_cloud_run_v2_service" "default" { - name = "tf-test-cloudrun-service%{random_suffix}" - location = "us-central1" - - labels = { - user_label = "bar" - } - - template { - containers { - image = "us-docker.pkg.dev/cloudrun/container/hello" - ports { - container_port = 8080 - } - } - } -} -`, context) -}