@@ -1557,3 +1557,78 @@ resource "google_project_iam_member" "logs_writer" {
1557
1557
}
1558
1558
`, context)
1559
1559
}
1560
+
1561
+ {{ if ne $.TargetVersionName `ga` -}}
1562
+ func TestAccCloudRunV2Service_cloudrunv2ServiceIapUpdate(t *testing.T) {
1563
+ t.Parallel()
1564
+
1565
+ context := map[string]interface{}{
1566
+ "random_suffix": acctest.RandString(t, 10),
1567
+ }
1568
+
1569
+ acctest.VcrTest(t, resource.TestCase{
1570
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
1571
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
1572
+ CheckDestroy: testAccCheckCloudRunV2ServiceDestroyProducer(t),
1573
+ Steps: []resource.TestStep{
1574
+ {
1575
+ Config: testAccCloudRunV2Service_cloudrunv2ServiceIap(context),
1576
+ },
1577
+ {
1578
+ ResourceName: "google_cloud_run_v2_service.default",
1579
+ ImportState: true,
1580
+ ImportStateVerify: true,
1581
+ ImportStateVerifyIgnore: []string{"annotations", "deletion_protection", "labels", "location", "name", "terraform_labels"},
1582
+ },
1583
+ {
1584
+ Config: testAccCloudRunV2Service_cloudrunv2ServiceIapUpdate(context),
1585
+ },
1586
+ {
1587
+ ResourceName: "google_cloud_run_v2_service.default",
1588
+ ImportState: true,
1589
+ ImportStateVerify: true,
1590
+ ImportStateVerifyIgnore: []string{"annotations", "deletion_protection", "labels", "location", "name", "terraform_labels"},
1591
+ },
1592
+ },
1593
+ })
1594
+ }
1595
+
1596
+ func testAccCloudRunV2Service_cloudrunv2ServiceIap(context map[string]interface{}) string {
1597
+ return acctest.Nprintf(`
1598
+ resource "google_cloud_run_v2_service" "default" {
1599
+ provider = google-beta
1600
+ name = "tf-test-cloudrun-iap-service%{random_suffix}"
1601
+ location = "us-central1"
1602
+ deletion_protection = false
1603
+ ingress = "INGRESS_TRAFFIC_ALL"
1604
+ launch_stage = "BETA"
1605
+ iap_enabled = true
1606
+
1607
+ template {
1608
+ containers {
1609
+ image = "us-docker.pkg.dev/cloudrun/container/hello"
1610
+ }
1611
+ }
1612
+ }
1613
+ `, context)
1614
+ }
1615
+
1616
+ func testAccCloudRunV2Service_cloudrunv2ServiceIapUpdate(context map[string]interface{}) string {
1617
+ return acctest.Nprintf(`
1618
+ resource "google_cloud_run_v2_service" "default" {
1619
+ provider = google-beta
1620
+ name = "tf-test-cloudrun-iap-service%{random_suffix}"
1621
+ location = "us-central1"
1622
+ deletion_protection = false
1623
+ ingress = "INGRESS_TRAFFIC_ALL"
1624
+ iap_enabled = false
1625
+
1626
+ template {
1627
+ containers {
1628
+ image = "us-docker.pkg.dev/cloudrun/container/hello"
1629
+ }
1630
+ }
1631
+ }
1632
+ `, context)
1633
+ }
1634
+ {{- end }}
0 commit comments