Skip to content

Commit

Permalink
Fix firestore backup schedule permadiff (#2114)
Browse files Browse the repository at this point in the history
Enables PRC for firestore backup schedule in order to fix a permadiff
with the resource.

Adds a regression test.

fixes #2066
  • Loading branch information
VenelinMartinov authored Jun 26, 2024
1 parent d1c1c8a commit 605c5c9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions provider/provider_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/pulumi/providertest/pulumitest/assertpreview"
"github.com/pulumi/providertest/pulumitest/opttest"
"github.com/pulumi/providertest/replay"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview"
)

func TestDNSRecordSetUpgrade(t *testing.T) {
Expand Down Expand Up @@ -950,3 +951,9 @@ func TestImport(t *testing.T) {
})
}
}

func TestFirestoreBackupScheduleNoPermadiff(t *testing.T) {
pt := pulumiTest(t, "test-programs/firestore-backup-schedule")
pt.Up()
pt.Preview(optpreview.ExpectNoChanges())
}
3 changes: 2 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ func Provider() tfbridge.ProviderInfo {
shimv2.WithDiffStrategy(shimv2.PlanState),
shimv2.WithPlanResourceChange(func(s string) bool {
switch s {
case "google_datastream_connection_profile":
case "google_datastream_connection_profile",
"google_firestore_backup_schedule":
return true
default:
return false
Expand Down
15 changes: 15 additions & 0 deletions provider/test-programs/firestore-backup-schedule/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: firestore-backup-schedule
runtime: yaml
resources:
firestoredb:
type: gcp:firestore:Database
properties:
locationId: us-central1
type: FIRESTORE_NATIVE

firestoreBackupsSchedule:
type: gcp:firestore:BackupSchedule
properties:
database: ${firestoredb.name}
retention: 8467200s
dailyRecurrence: {}

0 comments on commit 605c5c9

Please sign in to comment.