@@ -11,6 +11,7 @@ import (
11
11
"github.com/YakDriver/regexache"
12
12
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
13
13
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
14
+ "github.com/hashicorp/terraform-plugin-testing/plancheck"
14
15
"github.com/hashicorp/terraform-plugin-testing/terraform"
15
16
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
16
17
"github.com/hashicorp/terraform-provider-aws/internal/conns"
@@ -186,11 +187,23 @@ func TestAccIoTBillingGroup_migrateFromPluginSDK(t *testing.T) {
186
187
resource .TestCheckResourceAttr (resourceName , acctest .CtTagsPercent , "0" ),
187
188
resource .TestCheckResourceAttr (resourceName , names .AttrVersion , "1" ),
188
189
),
190
+ ConfigPlanChecks : resource.ConfigPlanChecks {
191
+ PreApply : []plancheck.PlanCheck {
192
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionCreate ),
193
+ },
194
+ },
189
195
},
190
196
{
191
197
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
192
198
Config : testAccBillingGroupConfig_basic (rName ),
193
- PlanOnly : true ,
199
+ ConfigPlanChecks : resource.ConfigPlanChecks {
200
+ PreApply : []plancheck.PlanCheck {
201
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionNoop ),
202
+ },
203
+ PostApplyPostRefresh : []plancheck.PlanCheck {
204
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionNoop ),
205
+ },
206
+ },
194
207
},
195
208
},
196
209
})
@@ -217,11 +230,23 @@ func TestAccIoTBillingGroup_migrateFromPluginSDK_properties(t *testing.T) {
217
230
Check : resource .ComposeAggregateTestCheckFunc (
218
231
testAccCheckBillingGroupExists (ctx , resourceName ),
219
232
),
233
+ ConfigPlanChecks : resource.ConfigPlanChecks {
234
+ PreApply : []plancheck.PlanCheck {
235
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionCreate ),
236
+ },
237
+ },
220
238
},
221
239
{
222
240
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
223
241
Config : testAccBillingGroupConfig_properties (rName ),
224
- PlanOnly : true ,
242
+ ConfigPlanChecks : resource.ConfigPlanChecks {
243
+ PreApply : []plancheck.PlanCheck {
244
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionNoop ),
245
+ },
246
+ PostApplyPostRefresh : []plancheck.PlanCheck {
247
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionNoop ),
248
+ },
249
+ },
225
250
},
226
251
{
227
252
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
@@ -232,6 +257,11 @@ func TestAccIoTBillingGroup_migrateFromPluginSDK_properties(t *testing.T) {
232
257
resource .TestCheckResourceAttr (resourceName , "properties.0.description" , "test description 2" ),
233
258
resource .TestCheckResourceAttr (resourceName , names .AttrVersion , "2" ),
234
259
),
260
+ ConfigPlanChecks : resource.ConfigPlanChecks {
261
+ PreApply : []plancheck.PlanCheck {
262
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionUpdate ),
263
+ },
264
+ },
235
265
},
236
266
},
237
267
})
0 commit comments