Skip to content

Commit caa3eb7

Browse files
committed
Merge branch 'dependabot/go_modules/github.com/hashicorp/terraform-plugin-testing-1.13.3' of github.com:scaleway/terraform-provider-scaleway into dependabot/go_modules/github.com/hashicorp/terraform-plugin-testing-1.13.3
2 parents 5828bc7 + 1f2dee0 commit caa3eb7

File tree

12 files changed

+4283
-14
lines changed

12 files changed

+4283
-14
lines changed

.github/workflows/acceptance-tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ jobs:
110110
echo "Pattern: $SKIP_PATTERN"
111111
echo ""
112112
echo "Tests that will be skipped:"
113-
go test -list=. ./internal/services/${{ matrix.products }} | grep -E "$SKIP_PATTERN" || true
113+
go tool gotestsum --format github-actions -- -list=. ./internal/services/${{ matrix.products }} | grep -E "$SKIP_PATTERN" || true
114114
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
115115
echo ""
116116
117-
go test -v ./internal/services/${{ matrix.products }} -timeout=2h -skip="$SKIP_PATTERN"
117+
go tool gotestsum --format github-actions -- -v ./internal/services/${{ matrix.products }} -timeout=2h -skip="$SKIP_PATTERN"
118118
TEST_RESULT=$?
119119
else
120-
go test -v ./internal/services/${{ matrix.products }} -timeout=2h
120+
go tool gotestsum --format github-actions -- -v ./internal/services/${{ matrix.products }} -timeout=2h
121121
TEST_RESULT=$?
122122
fi
123123
@@ -155,7 +155,7 @@ jobs:
155155
- name: Install Terraform
156156
uses: hashicorp/setup-terraform@v3
157157
- name: Run scwconfig tests
158-
run: go test -v ./internal/services/scwconfig -timeout=2m
158+
run: go tool gotestsum --format github-actions -- ./internal/services/scwconfig -timeout=2m
159159
env:
160160
TF_LOG: DEBUG
161161
TF_ACC: 1

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
with:
6161
go-version: 1.24.0
6262
- name: Run Acceptance Tests
63-
run: go test -v ./internal/services/${{ matrix.products }} -timeout=4h
63+
run: go tool gotestsum --format github-actions -- -v ./internal/services/${{ matrix.products }} -timeout=4h
6464
env:
6565
TF_LOG: DEBUG
6666
# https://www.terraform.io/docs/extend/testing/acceptance-tests/index.html#running-acceptance-tests

go.mod

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ require (
6464
github.com/bflad/tfproviderdocs v0.12.1 // indirect
6565
github.com/bflad/tfproviderlint v0.31.0 // indirect
6666
github.com/bgentry/speakeasy v0.1.0 // indirect
67+
github.com/bitfield/gotestdox v0.2.2 // indirect
6768
github.com/bmatcuk/doublestar v1.3.4 // indirect
6869
github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect
6970
github.com/cloudflare/circl v1.6.1 // indirect
@@ -72,15 +73,17 @@ require (
7273
github.com/containerd/log v0.1.0 // indirect
7374
github.com/davecgh/go-spew v1.1.1 // indirect
7475
github.com/distribution/reference v0.5.0 // indirect
76+
github.com/dnephin/pflag v1.0.7 // indirect
7577
github.com/docker/go-connections v0.4.0 // indirect
7678
github.com/docker/go-units v0.4.0 // indirect
7779
github.com/fatih/color v1.18.0 // indirect
7880
github.com/felixge/httpsnoop v1.0.4 // indirect
79-
github.com/fsnotify/fsnotify v1.5.4 // indirect
81+
github.com/fsnotify/fsnotify v1.8.0 // indirect
8082
github.com/go-logr/logr v1.4.2 // indirect
8183
github.com/go-logr/stdr v1.2.2 // indirect
8284
github.com/gogo/protobuf v1.3.2 // indirect
8385
github.com/golang/protobuf v1.5.4 // indirect
86+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
8487
github.com/gookit/color v1.5.1 // indirect
8588
github.com/hashicorp/cli v1.1.7 // indirect
8689
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -159,6 +162,7 @@ require (
159162
golang.org/x/net v0.42.0 // indirect
160163
golang.org/x/sync v0.16.0 // indirect
161164
golang.org/x/sys v0.35.0 // indirect
165+
golang.org/x/term v0.34.0 // indirect
162166
golang.org/x/text v0.28.0 // indirect
163167
golang.org/x/time v0.3.0 // indirect
164168
golang.org/x/tools v0.35.0 // indirect
@@ -170,7 +174,7 @@ require (
170174
gopkg.in/ini.v1 v1.66.4 // indirect
171175
gopkg.in/yaml.v2 v2.4.0 // indirect
172176
gopkg.in/yaml.v3 v3.0.1 // indirect
173-
gotest.tools/v3 v3.0.3 // indirect
177+
gotest.tools/gotestsum v1.12.3 // indirect
174178
)
175179

176180
tool (
@@ -179,4 +183,5 @@ tool (
179183
github.com/bflad/tfproviderlint/cmd/tfproviderlintx
180184
github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
181185
github.com/katbyte/terrafmt
186+
gotest.tools/gotestsum
182187
)

go.sum

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ github.com/bflad/tfproviderlint v0.31.0 h1:9N/dUzFARsTpAQOjdZzIWnHKMzQc7UDDEYrSN
119119
github.com/bflad/tfproviderlint v0.31.0/go.mod h1:yZQdJs4uobBIgVHt1Tv5OpHhgM8fwh29OgxL/La5BFs=
120120
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
121121
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
122+
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
123+
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
122124
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
123125
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
124126
github.com/bmatcuk/doublestar/v4 v4.8.1 h1:54Bopc5c2cAvhLRAzqOGCYHYyhcDHsFF4wWIR5wKP38=
@@ -154,6 +156,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK
154156
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
155157
github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
156158
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
159+
github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
160+
github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
157161
github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
158162
github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
159163
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
@@ -178,8 +182,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2
178182
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
179183
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
180184
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
181-
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
182-
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
185+
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
186+
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
183187
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
184188
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
185189
github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM=
@@ -259,6 +263,8 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
259263
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
260264
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
261265
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
266+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
267+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
262268
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
263269
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
264270
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -690,7 +696,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
690696
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
691697
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
692698
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
693-
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
694699
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
695700
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
696701
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -906,9 +911,11 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
906911
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
907912
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
908913
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
914+
gotest.tools/gotestsum v1.12.3 h1:jFwenGJ0RnPkuKh2VzAYl1mDOJgbhobBDeL2W1iEycs=
915+
gotest.tools/gotestsum v1.12.3/go.mod h1:Y1+e0Iig4xIRtdmYbEV7K7H6spnjc1fX4BOuUhWw2Wk=
909916
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
910-
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
911-
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
917+
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
918+
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
912919
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
913920
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
914921
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

internal/services/mongodb/instance.go

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,24 @@ func ResourceInstance() *schema.Resource {
215215
},
216216
Description: "List of tags [\"tag1\", \"tag2\", ...] attached to a MongoDB instance",
217217
},
218+
"snapshot_schedule_frequency_hours": {
219+
Type: schema.TypeInt,
220+
Optional: true,
221+
Computed: true,
222+
Description: "Snapshot schedule frequency in hours",
223+
},
224+
"snapshot_schedule_retention_days": {
225+
Type: schema.TypeInt,
226+
Optional: true,
227+
Computed: true,
228+
Description: "Snapshot schedule retention in days",
229+
},
230+
"is_snapshot_schedule_enabled": {
231+
Type: schema.TypeBool,
232+
Optional: true,
233+
Computed: true,
234+
Description: "Enable or disable automatic snapshot scheduling",
235+
},
218236
"settings": {
219237
Type: schema.TypeMap,
220238
Description: "Map of settings to define for the instance.",
@@ -367,6 +385,11 @@ func ResourceInstanceCreate(ctx context.Context, d *schema.ResourceData, m any)
367385
return diag.FromErr(err)
368386
}
369387

388+
err = configureSnapshotScheduleOnCreate(ctx, d, mongodbAPI, region, res.ID)
389+
if err != nil {
390+
return diag.FromErr(err)
391+
}
392+
370393
return ResourceInstanceRead(ctx, d, m)
371394
}
372395

@@ -401,6 +424,12 @@ func ResourceInstanceRead(ctx context.Context, d *schema.ResourceData, m any) di
401424
_ = d.Set("created_at", instance.CreatedAt.Format(time.RFC3339))
402425
_ = d.Set("region", instance.Region.String())
403426

427+
if instance.SnapshotSchedule != nil {
428+
_ = d.Set("snapshot_schedule_frequency_hours", int(instance.SnapshotSchedule.FrequencyHours))
429+
_ = d.Set("snapshot_schedule_retention_days", int(instance.SnapshotSchedule.RetentionDays))
430+
_ = d.Set("is_snapshot_schedule_enabled", instance.SnapshotSchedule.Enabled)
431+
}
432+
404433
if instance.Volume != nil {
405434
_ = d.Set("volume_type", instance.Volume.Type)
406435
_ = d.Set("volume_size_in_gb", int(instance.Volume.SizeBytes/scw.GB))
@@ -553,6 +582,10 @@ func ResourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, m any)
553582
}
554583
}
555584

585+
if updateSnapshotScheduleFields(d, req) {
586+
shouldUpdateInstance = true
587+
}
588+
556589
if shouldUpdateInstance {
557590
_, err = mongodbAPI.UpdateInstance(req, scw.WithContext(ctx))
558591
if err != nil {
@@ -690,3 +723,61 @@ func ResourceInstanceDelete(ctx context.Context, d *schema.ResourceData, m any)
690723

691724
return nil
692725
}
726+
727+
func updateSnapshotScheduleFields(d *schema.ResourceData, req *mongodb.UpdateInstanceRequest) bool {
728+
hasUpdates := false
729+
730+
if d.HasChange("snapshot_schedule_frequency_hours") {
731+
req.SnapshotScheduleFrequencyHours = types.ExpandUint32Ptr(d.Get("snapshot_schedule_frequency_hours"))
732+
hasUpdates = true
733+
}
734+
735+
if d.HasChange("snapshot_schedule_retention_days") {
736+
req.SnapshotScheduleRetentionDays = types.ExpandUint32Ptr(d.Get("snapshot_schedule_retention_days"))
737+
hasUpdates = true
738+
}
739+
740+
if d.HasChange("is_snapshot_schedule_enabled") {
741+
req.IsSnapshotScheduleEnabled = types.ExpandBoolPtr(d.Get("is_snapshot_schedule_enabled"))
742+
hasUpdates = true
743+
}
744+
745+
return hasUpdates
746+
}
747+
748+
func configureSnapshotScheduleOnCreate(ctx context.Context, d *schema.ResourceData, mongodbAPI *mongodb.API, region scw.Region, instanceID string) error {
749+
mustUpdate := false
750+
updateReq := &mongodb.UpdateInstanceRequest{
751+
Region: region,
752+
InstanceID: instanceID,
753+
}
754+
755+
if snapshotFrequency, ok := d.GetOk("snapshot_schedule_frequency_hours"); ok {
756+
updateReq.SnapshotScheduleFrequencyHours = scw.Uint32Ptr(uint32(snapshotFrequency.(int)))
757+
mustUpdate = true
758+
}
759+
760+
if snapshotRetention, ok := d.GetOk("snapshot_schedule_retention_days"); ok {
761+
updateReq.SnapshotScheduleRetentionDays = scw.Uint32Ptr(uint32(snapshotRetention.(int)))
762+
mustUpdate = true
763+
}
764+
765+
if snapshotEnabled, ok := d.GetOk("is_snapshot_schedule_enabled"); ok {
766+
updateReq.IsSnapshotScheduleEnabled = scw.BoolPtr(snapshotEnabled.(bool))
767+
mustUpdate = true
768+
}
769+
770+
if mustUpdate {
771+
_, err := mongodbAPI.UpdateInstance(updateReq, scw.WithContext(ctx))
772+
if err != nil {
773+
return err
774+
}
775+
776+
_, err = waitForInstance(ctx, mongodbAPI, region, instanceID, d.Timeout(schema.TimeoutCreate))
777+
if err != nil {
778+
return err
779+
}
780+
}
781+
782+
return nil
783+
}

internal/services/mongodb/instance_test.go

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,61 @@ func TestAccMongoDBInstance_VolumeUpdate(t *testing.T) {
100100
})
101101
}
102102

103+
func TestAccMongoDBInstance_SnapshotSchedule(t *testing.T) {
104+
tt := acctest.NewTestTools(t)
105+
defer tt.Cleanup()
106+
107+
resource.ParallelTest(t, resource.TestCase{
108+
PreCheck: func() { acctest.PreCheck(t) },
109+
ProviderFactories: tt.ProviderFactories,
110+
CheckDestroy: IsInstanceDestroyed(tt),
111+
Steps: []resource.TestStep{
112+
{
113+
Config: `
114+
resource scaleway_mongodb_instance main {
115+
name = "test-mongodb-snapshot-schedule"
116+
version = "7.0.12"
117+
node_type = "MGDB-PLAY2-NANO"
118+
node_number = 1
119+
user_name = "my_initial_user"
120+
password = "thiZ_is_v&ry_s3cret"
121+
snapshot_schedule_frequency_hours = 24
122+
snapshot_schedule_retention_days = 7
123+
is_snapshot_schedule_enabled = true
124+
}
125+
`,
126+
Check: resource.ComposeTestCheckFunc(
127+
isMongoDBInstancePresent(tt, "scaleway_mongodb_instance.main"),
128+
resource.TestCheckResourceAttr("scaleway_mongodb_instance.main", "snapshot_schedule_frequency_hours", "24"),
129+
resource.TestCheckResourceAttr("scaleway_mongodb_instance.main", "snapshot_schedule_retention_days", "7"),
130+
resource.TestCheckResourceAttr("scaleway_mongodb_instance.main", "is_snapshot_schedule_enabled", "true"),
131+
),
132+
},
133+
{
134+
Config: `
135+
resource scaleway_mongodb_instance main {
136+
name = "test-mongodb-snapshot-schedule"
137+
version = "7.0.12"
138+
node_type = "MGDB-PLAY2-NANO"
139+
node_number = 1
140+
user_name = "my_initial_user"
141+
password = "thiZ_is_v&ry_s3cret"
142+
snapshot_schedule_frequency_hours = 12
143+
snapshot_schedule_retention_days = 14
144+
is_snapshot_schedule_enabled = false
145+
}
146+
`,
147+
Check: resource.ComposeTestCheckFunc(
148+
isMongoDBInstancePresent(tt, "scaleway_mongodb_instance.main"),
149+
resource.TestCheckResourceAttr("scaleway_mongodb_instance.main", "snapshot_schedule_frequency_hours", "12"),
150+
resource.TestCheckResourceAttr("scaleway_mongodb_instance.main", "snapshot_schedule_retention_days", "14"),
151+
resource.TestCheckResourceAttr("scaleway_mongodb_instance.main", "is_snapshot_schedule_enabled", "false"),
152+
),
153+
},
154+
},
155+
})
156+
}
157+
103158
func TestAccMongoDBInstance_UpdateNameTagsUser(t *testing.T) {
104159
tt := acctest.NewTestTools(t)
105160
defer tt.Cleanup()

0 commit comments

Comments
 (0)