DynamoDB Table now refreshes the state when NotFoundException occurs

This commit is contained in:
stack72 2016-02-01 21:55:10 +00:00
parent dce2994151
commit 9c17e5d3e8

View File

@ -583,6 +583,11 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro
result, err := dynamodbconn.DescribeTable(req)
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
}