Skip to content

Commit

Permalink
Merge pull request #1480 from handlerbot/sns-sub-resub
Browse files Browse the repository at this point in the history
Fix SNS subscription sub/unsub/sub bug.
  • Loading branch information
radeksimko authored Aug 29, 2017
2 parents 90d830c + f85582e commit ad79d53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aws/resource_aws_sns_topic_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func resourceAwsSnsTopicSubscriptionUpdate(d *schema.ResourceData, meta interfac
snsconn := meta.(*AWSClient).snsconn

// If any changes happened, un-subscribe and re-subscribe
if d.HasChange("protocol") || d.HasChange("endpoint") || d.HasChange("topic_arn") {
if !d.IsNewResource() && (d.HasChange("protocol") || d.HasChange("endpoint") || d.HasChange("topic_arn")) {
log.Printf("[DEBUG] Updating subscription %s", d.Id())
// Unsubscribe
_, err := snsconn.Unsubscribe(&sns.UnsubscribeInput{
Expand Down

0 comments on commit ad79d53

Please sign in to comment.