From 9c1ea03504d16c4a72eab9460df933bb94cc1ca5 Mon Sep 17 00:00:00 2001 From: Venelin Date: Thu, 11 Jul 2024 13:16:26 +0100 Subject: [PATCH 1/4] fix firestore database autoname --- provider/resources.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/resources.go b/provider/resources.go index ce175e3a92..c662e3a880 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -1306,7 +1306,7 @@ func Provider() tfbridge.ProviderInfo { // Firestore resources "google_firestore_index": {Tok: gcpResource(gcpFirestore, "Index")}, "google_firestore_document": {Tok: gcpResource(gcpFirestore, "Document")}, - "google_firestore_database": {Tok: gcpResource(gcpFirestore, "Database")}, + "google_firestore_database": {Tok: gcpResource(gcpFirestore, "Database"), Fields: nameField(lowercaseAutoName())}, "google_firestore_field": { Tok: gcpResource(gcpFirestore, "Field"), Fields: map[string]*tfbridge.SchemaInfo{ From 5d4d420c6651efec7947f928fdd88eb524a356cb Mon Sep 17 00:00:00 2001 From: Venelin Date: Tue, 20 Aug 2024 12:36:07 +0100 Subject: [PATCH 2/4] test --- provider/provider_yaml_test.go | 8 ++++++++ .../test-programs/firestore-db-autoname/Pulumi.yaml | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 provider/test-programs/firestore-db-autoname/Pulumi.yaml diff --git a/provider/provider_yaml_test.go b/provider/provider_yaml_test.go index 38ff531dcf..16c88d2a0c 100644 --- a/provider/provider_yaml_test.go +++ b/provider/provider_yaml_test.go @@ -920,3 +920,11 @@ func TestFirestoreFieldPermadiffRegress2166(t *testing.T) { pt.Up() pt.Preview(optpreview.ExpectNoChanges()) } + +func TestFirestoreDatabaseAutoname(t *testing.T) { + pt := pulumiTest(t, "test-programs/firestore-db-autoname") + proj := getProject() + pt.SetConfig("gcpProj", proj) + pt.Up() +} + diff --git a/provider/test-programs/firestore-db-autoname/Pulumi.yaml b/provider/test-programs/firestore-db-autoname/Pulumi.yaml new file mode 100644 index 0000000000..7065f031f5 --- /dev/null +++ b/provider/test-programs/firestore-db-autoname/Pulumi.yaml @@ -0,0 +1,12 @@ +name: firestore-db-autoname +runtime: yaml +config: + gcpProj: string +resources: + myFirestoreDatabase: + type: gcp:firestore:Database + properties: + type: "FIRESTORE_NATIVE" + project: ${gcpProj} + locationId: "us-central" + deletionPolicy: DELETE From 4899e2f26c1ccd4412f8cc83395e736425a9081c Mon Sep 17 00:00:00 2001 From: Venelin Date: Tue, 20 Aug 2024 12:41:36 +0100 Subject: [PATCH 3/4] lint --- provider/provider_yaml_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/provider/provider_yaml_test.go b/provider/provider_yaml_test.go index 16c88d2a0c..d56c8c6e53 100644 --- a/provider/provider_yaml_test.go +++ b/provider/provider_yaml_test.go @@ -927,4 +927,3 @@ func TestFirestoreDatabaseAutoname(t *testing.T) { pt.SetConfig("gcpProj", proj) pt.Up() } - From be3365c450e948372643764904405213bd9ddda7 Mon Sep 17 00:00:00 2001 From: Venelin Date: Tue, 20 Aug 2024 13:19:24 +0100 Subject: [PATCH 4/4] fix test --- provider/test-programs/firestore-db-autoname/Pulumi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/test-programs/firestore-db-autoname/Pulumi.yaml b/provider/test-programs/firestore-db-autoname/Pulumi.yaml index 7065f031f5..a8e42c0f8f 100644 --- a/provider/test-programs/firestore-db-autoname/Pulumi.yaml +++ b/provider/test-programs/firestore-db-autoname/Pulumi.yaml @@ -8,5 +8,5 @@ resources: properties: type: "FIRESTORE_NATIVE" project: ${gcpProj} - locationId: "us-central" + locationId: "us-central1" deletionPolicy: DELETE