Merge pull request #4943 from stack72/f-aws-dynamodbtable-refresh

provider/aws: DynamoDB Table Refresh State on Error
This commit is contained in:
Paul Stack 2016-02-06 23:47:41 +00:00
commit 00ea9c969d
1 changed files with 5 additions and 0 deletions

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
}