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