@@ -602,7 +602,7 @@ func resourceTableCreate(ctx context.Context, d *schema.ResourceData, meta inter
602
602
603
603
input .TableCreationParameters = tcp
604
604
605
- _ , err := tfresource .RetryWhen (ctx , createTableTimeout , func () (interface {}, error ) {
605
+ importTableOutput , err := tfresource .RetryWhen (ctx , createTableTimeout , func () (interface {}, error ) {
606
606
return conn .ImportTableWithContext (ctx , input )
607
607
}, func (err error ) (bool , error ) {
608
608
if tfawserr .ErrCodeEquals (err , "ThrottlingException" ) {
@@ -621,6 +621,12 @@ func resourceTableCreate(ctx context.Context, d *schema.ResourceData, meta inter
621
621
if err != nil {
622
622
return create .AppendDiagError (diags , names .DynamoDB , create .ErrActionCreating , ResNameTable , tableName , err )
623
623
}
624
+
625
+ importArn := importTableOutput .(* dynamodb.ImportTableOutput ).ImportTableDescription .ImportArn
626
+ if _ , err = waitImportComplete (ctx , conn , aws .StringValue (importArn ), d .Timeout (schema .TimeoutCreate )); err != nil {
627
+ d .SetId (tableName )
628
+ return create .AppendDiagError (diags , names .DynamoDB , create .ErrActionCreating , ResNameTable , tableName , err )
629
+ }
624
630
} else {
625
631
input := & dynamodb.CreateTableInput {
626
632
BillingMode : aws .String (d .Get ("billing_mode" ).(string )),
0 commit comments