@@ -93,6 +93,61 @@ func TestAccMongoDBInstance_VolumeUpdate(t *testing.T) {
93
93
})
94
94
}
95
95
96
+ func TestAccMongoDBInstance_UpdateNameTagsUser (t * testing.T ) {
97
+ tt := acctest .NewTestTools (t )
98
+ defer tt .Cleanup ()
99
+
100
+ resource .ParallelTest (t , resource.TestCase {
101
+ PreCheck : func () { acctest .PreCheck (t ) },
102
+ ProviderFactories : tt .ProviderFactories ,
103
+ CheckDestroy : IsInstanceDestroyed (tt ),
104
+ Steps : []resource.TestStep {
105
+ {
106
+ Config : `
107
+ resource scaleway_mongodb_instance main {
108
+ name = "test-mongodb-update-initial"
109
+ version = "7.0.12"
110
+ node_type = "MGDB-PLAY2-NANO"
111
+ node_number = 1
112
+ user_name = "user"
113
+ password = "initial_password"
114
+ tags = ["initial_tag1", "initial_tag2"]
115
+ }
116
+ ` ,
117
+ Check : resource .ComposeTestCheckFunc (
118
+ isMongoDBInstancePresent (tt , "scaleway_mongodb_instance.main" ),
119
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "name" , "test-mongodb-update-initial" ),
120
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "user_name" , "user" ),
121
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.#" , "2" ),
122
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.0" , "initial_tag1" ),
123
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.1" , "initial_tag2" ),
124
+ ),
125
+ },
126
+ {
127
+ Config : `
128
+ resource scaleway_mongodb_instance main {
129
+ name = "test-mongodb-update-final"
130
+ version = "7.0.12"
131
+ node_type = "MGDB-PLAY2-NANO"
132
+ node_number = 1
133
+ user_name = "user"
134
+ password = "updated_password"
135
+ tags = ["updated_tag1", "updated_tag2", "updated_tag3"]
136
+ }
137
+ ` ,
138
+ Check : resource .ComposeTestCheckFunc (
139
+ isMongoDBInstancePresent (tt , "scaleway_mongodb_instance.main" ),
140
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "name" , "test-mongodb-update-final" ),
141
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.#" , "3" ),
142
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.0" , "updated_tag1" ),
143
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.1" , "updated_tag2" ),
144
+ resource .TestCheckResourceAttr ("scaleway_mongodb_instance.main" , "tags.2" , "updated_tag3" ),
145
+ ),
146
+ },
147
+ },
148
+ })
149
+ }
150
+
96
151
func TestAccMongoDBInstance_FromSnapshot (t * testing.T ) {
97
152
tt := acctest .NewTestTools (t )
98
153
defer tt .Cleanup ()
0 commit comments