Skip to content

Commit

Permalink
Replace 'suppressUnsetContainerAttribute' with 'suppressMissingOption…
Browse files Browse the repository at this point in the history
…alConfigurationBlock'.
  • Loading branch information
ewbankkit committed Jul 5, 2019
1 parent 8a4e06d commit 6a39c96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions aws/diff_suppress_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,3 @@ func suppressRoute53ZoneNameWithTrailingDot(k, old, new string, d *schema.Resour
}
return strings.TrimSuffix(old, ".") == strings.TrimSuffix(new, ".")
}

// suppressUnsetContainerAttribute ignores a container attribute being unset
// in the Terraform configuration. All child attribute differences still apply.
// Useful when an unset container attribute is equivalent to a container attribute
// populated with default values.
func suppressUnsetContainerAttribute(k, old, new string, d *schema.ResourceData) bool {
if old == "1" && new == "0" {
return true
}
return false
}
2 changes: 1 addition & 1 deletion aws/resource_aws_s3_bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func resourceAwsS3BucketObject() *schema.Resource {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
DiffSuppressFunc: suppressUnsetContainerAttribute,
DiffSuppressFunc: suppressMissingOptionalConfigurationBlock,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"status": {
Expand Down

0 comments on commit 6a39c96

Please sign in to comment.