@@ -982,7 +982,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testin
982
982
CheckDestroy : testAccCheckCloudRunV2ServiceDestroyProducer (t ),
983
983
Steps : []resource.TestStep {
984
984
{
985
- Config : testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled (context ),
985
+ Config : testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstances (context ),
986
986
},
987
987
{
988
988
ResourceName : "google_cloud_run_v2_service.default" ,
@@ -1010,7 +1010,6 @@ resource "google_cloud_run_v2_service" "default" {
1010
1010
description = "description creating"
1011
1011
location = "us-central1"
1012
1012
deletion_protection = false
1013
- launch_stage = "BETA"
1014
1013
annotations = {
1015
1014
generated-by = "magic-modules"
1016
1015
}
@@ -1035,6 +1034,73 @@ resource "google_cloud_run_v2_service" "default" {
1035
1034
1036
1035
` , context )
1037
1036
}
1037
+ func testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstances (context map [string ]interface {}) string {
1038
+ return acctest .Nprintf (`
1039
+ resource "google_cloud_run_v2_service" "default" {
1040
+ name = "tf-test-cloudrun-service%{random_suffix}"
1041
+ description = "description creating"
1042
+ location = "us-central1"
1043
+ deletion_protection = false
1044
+ annotations = {
1045
+ generated-by = "magic-modules"
1046
+ }
1047
+ ingress = "INGRESS_TRAFFIC_ALL"
1048
+ labels = {
1049
+ label-1 = "value-1"
1050
+ }
1051
+ client = "client-1"
1052
+ client_version = "client-version-1"
1053
+ scaling {
1054
+ min_instance_count = 1
1055
+ }
1056
+ template {
1057
+ containers {
1058
+ name = "container-1"
1059
+ image = "us-docker.pkg.dev/cloudrun/container/hello"
1060
+ }
1061
+ }
1062
+ lifecycle {
1063
+ ignore_changes = [
1064
+ launch_stage,
1065
+ ]
1066
+ }
1067
+ }
1068
+
1069
+ ` , context )
1070
+ }
1071
+
1072
+ func TestAccCloudRunV2Service_cloudrunv2ServiceWithDefaultUriDisabled (t * testing.T ) {
1073
+ t .Parallel ()
1074
+ context := map [string ]interface {}{
1075
+ "random_suffix" : acctest .RandString (t , 10 ),
1076
+ }
1077
+ acctest .VcrTest (t , resource.TestCase {
1078
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
1079
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
1080
+ CheckDestroy : testAccCheckCloudRunV2ServiceDestroyProducer (t ),
1081
+ Steps : []resource.TestStep {
1082
+ {
1083
+ Config : testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled (context ),
1084
+ },
1085
+ {
1086
+ ResourceName : "google_cloud_run_v2_service.default" ,
1087
+ ImportState : true ,
1088
+ ImportStateVerify : true ,
1089
+ ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "labels" , "terraform_labels" , "launch_stage" , "deletion_protection" },
1090
+ },
1091
+ {
1092
+ Config : testAccCloudRunV2Service_cloudrunv2ServiceWithNoMinInstances (context ),
1093
+ },
1094
+ {
1095
+ ResourceName : "google_cloud_run_v2_service.default" ,
1096
+ ImportState : true ,
1097
+ ImportStateVerify : true ,
1098
+ ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "labels" , "terraform_labels" , "launch_stage" , "deletion_protection" },
1099
+ },
1100
+ },
1101
+ })
1102
+ }
1103
+
1038
1104
func testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled (context map [string ]interface {}) string {
1039
1105
return acctest .Nprintf (`
1040
1106
resource "google_cloud_run_v2_service" "default" {
0 commit comments