99 "github.com/hashicorp/terraform-plugin-testing/plancheck"
1010
1111 "github.com/hashicorp/terraform-provider-google/google/acctest"
12+ "github.com/hashicorp/terraform-provider-google/google/envvar"
1213)
1314
1415func TestAccSaasRuntimeUnitKind_update(t *testing.T) {
@@ -21,6 +22,7 @@ func TestAccSaasRuntimeUnitKind_update(t *testing.T) {
2122 })
2223
2324 context := map[string]interface{}{
25+ "project": envvar.GetTestProjectFromEnv(),
2426 "random_suffix": acctest.RandString(t, 10),
2527 }
2628
@@ -60,23 +62,24 @@ func testAccSaasRuntimeUnitKind_basic(context map[string]interface{}) string {
6062resource "google_saas_runtime_saas" "example_saas" {
6163 provider = google-beta
6264 saas_id = "tf-test-example-saas%{random_suffix}"
63- location = "global "
65+ location = "us-east1 "
6466
6567 locations {
66- name = "us-central1 "
68+ name = "us-east1 "
6769 }
6870}
6971
7072resource "google_saas_runtime_unit_kind" "cluster_unit_kind" {
7173 provider = google-beta
72- location = "global "
74+ location = "us-east1 "
7375 unit_kind_id = "tf-test-cluster-unitkind%{random_suffix}"
7476 saas = google_saas_runtime_saas.example_saas.id
77+ default_release = "projects/%{project}/locations/us-east1/releases/tf-test-example-release%{random_suffix}"
7578}
7679
7780resource "google_saas_runtime_unit_kind" "example" {
7881 provider = google-beta
79- location = "global "
82+ location = "us-east1 "
8083 unit_kind_id = "tf-test-app-unitkind%{random_suffix}"
8184 saas = google_saas_runtime_saas.example_saas.id
8285
@@ -85,6 +88,16 @@ resource "google_saas_runtime_unit_kind" "example" {
8588 alias = "cluster"
8689 }
8790}
91+
92+ resource "google_saas_runtime_release" "example_release" {
93+ provider = google-beta
94+ location = "us-east1"
95+ release_id = "tf-test-example-release%{random_suffix}"
96+ unit_kind = google_saas_runtime_unit_kind.cluster_unit_kind.id
97+ blueprint {
98+ package = "us-central1-docker.pkg.dev/ci-test-project-188019/test-repo/tf-test-easysaas-alpha-image@sha256:7992fdbaeaf998ecd31a7f937bb26e38a781ecf49b24857a6176c1e9bfc299ee"
99+ }
100+ }
88101`, context)
89102}
90103
@@ -93,23 +106,24 @@ func testAccSaasRuntimeUnitKind_update(context map[string]interface{}) string {
93106resource "google_saas_runtime_saas" "example_saas" {
94107 provider = google-beta
95108 saas_id = "tf-test-example-saas%{random_suffix}"
96- location = "global "
109+ location = "us-east1 "
97110
98111 locations {
99- name = "us-central1 "
112+ name = "us-east1 "
100113 }
101114}
102115
103116resource "google_saas_runtime_unit_kind" "cluster_unit_kind" {
104117 provider = google-beta
105- location = "global "
118+ location = "us-east1 "
106119 unit_kind_id = "tf-test-cluster-unitkind%{random_suffix}"
107120 saas = google_saas_runtime_saas.example_saas.id
121+ default_release = "projects/%{project}/locations/us-east1/releases/tf-test-example-release%{random_suffix}"
108122}
109123
110124resource "google_saas_runtime_unit_kind" "example" {
111125 provider = google-beta
112- location = "global "
126+ location = "us-east1 "
113127 unit_kind_id = "tf-test-app-unitkind%{random_suffix}"
114128 saas = google_saas_runtime_saas.example_saas.id
115129
@@ -159,6 +173,16 @@ resource "google_saas_runtime_unit_kind" "example" {
159173 "annotation-one": "bar"
160174 }
161175}
176+
177+ resource "google_saas_runtime_release" "example_release" {
178+ provider = google-beta
179+ location = "us-east1"
180+ release_id = "tf-test-example-release%{random_suffix}"
181+ unit_kind = google_saas_runtime_unit_kind.cluster_unit_kind.id
182+ blueprint {
183+ package = "us-central1-docker.pkg.dev/ci-test-project-188019/test-repo/tf-test-easysaas-alpha-image@sha256:7992fdbaeaf998ecd31a7f937bb26e38a781ecf49b24857a6176c1e9bfc299ee"
184+ }
185+ }
162186`, context)
163187}
164188{{- end }}
0 commit comments