Skip to content

Commit

Permalink
Merge branch 'pr-7075'
Browse files Browse the repository at this point in the history
* pr-7075:
  provider/aws: Log ElasticCache subnet removal
  provider/aws: Update state on `aws_elasticache_subnet_group` not found exception
  • Loading branch information
catsby committed Jun 8, 2016
2 parents a31cb50 + 1624c7e commit c667b2d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ func resourceAwsElasticacheSubnetGroupRead(d *schema.ResourceData, meta interfac

res, err := conn.DescribeCacheSubnetGroups(req)
if err != nil {
if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "CacheSubnetGroupNotFoundFault" {
// Update state to indicate the db subnet no longer exists.
log.Printf("[WARN] Elasticache Subnet Group (%s) not found, removing from state", d.Id())
d.SetId("")
return nil
}
return err
}
if len(res.CacheSubnetGroups) == 0 {
Expand Down

0 comments on commit c667b2d

Please sign in to comment.