provider/aws: Refresh `aws_cloudwatch_event_target` from state on `ResourceNotFoundException` (#8442)
* provider/aws: Refresh `aws_cloudwatch_event_target` from state on `ResourceNotFoundException` Fixes #6928 @radeksimko FYI :) * Update resource_aws_cloudwatch_event_target.go
This commit is contained in:
parent
fbda254401
commit
50556c58b8
|
@ -112,6 +112,13 @@ func resourceAwsCloudWatchEventTargetRead(d *schema.ResourceData, meta interface
|
||||||
d.SetId("")
|
d.SetId("")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if awsErr.Code() == "ResourceNotFoundException" {
|
||||||
|
log.Printf("[WARN] CloudWatch Event Target (%q) not found. Removing it from state.", d.Id())
|
||||||
|
d.SetId("")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue