mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
DynamoDB Table now refreshes the state when NotFoundException occurs
This commit is contained in:
parent
dce2994151
commit
9c17e5d3e8
@ -583,6 +583,11 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro
|
|||||||
result, err := dynamodbconn.DescribeTable(req)
|
result, err := dynamodbconn.DescribeTable(req)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" {
|
||||||
|
log.Printf("[WARN] Dynamodb Table (%s) not found, error code (404)", d.Id())
|
||||||
|
d.SetId("")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user