Merge branch 'pr-7075'
* pr-7075: provider/aws: Log ElasticCache subnet removal provider/aws: Update state on `aws_elasticache_subnet_group` not found exception
This commit is contained in:
commit
c667b2d8cd
|
@ -87,6 +87,12 @@ func resourceAwsElasticacheSubnetGroupRead(d *schema.ResourceData, meta interfac
|
||||||
|
|
||||||
res, err := conn.DescribeCacheSubnetGroups(req)
|
res, err := conn.DescribeCacheSubnetGroups(req)
|
||||||
if err != nil {
|
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
|
return err
|
||||||
}
|
}
|
||||||
if len(res.CacheSubnetGroups) == 0 {
|
if len(res.CacheSubnetGroups) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue