@@ -279,41 +279,25 @@ func resourceStackSetInstanceCreate(ctx context.Context, d *schema.ResourceData,
279
279
return create .AppendDiagError (diags , names .CloudFormation , create .ErrActionFlatteningResourceId , ResNameStackSetInstance , id , err )
280
280
}
281
281
282
- _ , err = tfresource .RetryWhen (ctx , propagationTimeout ,
283
- func () (interface {} , error ) {
282
+ output , err : = tfresource .RetryGWhen (ctx , propagationTimeout ,
283
+ func () (* cloudformation. CreateStackInstancesOutput , error ) {
284
284
input .OperationId = aws .String (sdkid .UniqueId ())
285
285
286
- output , err := conn .CreateStackInstances (ctx , input )
287
-
288
- if err != nil {
289
- return nil , err
290
- }
291
-
292
- d .SetId (id )
293
-
294
- operation , err := waitStackSetOperationSucceeded (ctx , conn , stackSetName , aws .ToString (output .OperationId ), callAs , d .Timeout (schema .TimeoutCreate ))
295
-
296
- if err != nil {
297
- return nil , fmt .Errorf ("waiting for create: %w" , err )
298
- }
299
-
300
- return operation , nil
286
+ return conn .CreateStackInstances (ctx , input )
301
287
},
302
288
isRetryableIAMPropagationErr ,
303
-
304
- // IAM eventual consistency
305
- if strings .Contains (message , "The security token included in the request is invalid" ) {
306
- return true , err
307
- }
308
-
309
- return false , err
310
- },
311
289
)
312
-
313
290
if err != nil {
314
291
return sdkdiag .AppendErrorf (diags , "creating CloudFormation StackSet (%s) Instance: %s" , stackSetName , err )
315
292
}
316
293
294
+ d .SetId (id )
295
+
296
+ _ , err = waitStackSetOperationSucceeded (ctx , conn , stackSetName , aws .ToString (output .OperationId ), callAs , d .Timeout (schema .TimeoutCreate ))
297
+ if err != nil {
298
+ return sdkdiag .AppendErrorf (diags , "creating CloudFormation StackSet (%s) Instance: waiting for completion: %s" , stackSetName , err )
299
+ }
300
+
317
301
return append (diags , resourceStackSetInstanceRead (ctx , d , meta )... )
318
302
}
319
303
0 commit comments