Skip to content

Commit

Permalink
Merge pull request #10539 from spavuluri/5204-cloudformation-onfailure
Browse files Browse the repository at this point in the history
Added check for on_failure before resetting disable_rollback during refresh
  • Loading branch information
YakDriver authored May 28, 2021
2 parents f3acf30 + 3a6313c commit be7b9ad
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 67 deletions.
3 changes: 3 additions & 0 deletions .changelog/10539.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_cloudformation_stack: Avoid conflicts with `on_failure` and `disable_rollback`
```
6 changes: 6 additions & 0 deletions aws/resource_aws_cloudformation_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ func resourceAwsCloudFormationStackRead(d *schema.ResourceData, meta interface{}
}
if stack.DisableRollback != nil {
d.Set("disable_rollback", stack.DisableRollback)

// takes into account that disable_rollback conflicts with on_failure and
// prevents forced new creation if disable_rollback is reset during refresh
if d.Get("on_failure") != nil {
d.Set("disable_rollback", false)
}
}
if len(stack.NotificationARNs) > 0 {
err = d.Set("notification_arns", flattenStringSet(stack.NotificationARNs))
Expand Down
Loading

0 comments on commit be7b9ad

Please sign in to comment.