Skip to content

Commit

Permalink
set lifecycle_rule with nil if dne for bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Feb 5, 2022
1 parent 6c57dcb commit 0f24b97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/service/s3/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func ResourceBucket() *schema.Resource {
},

"lifecycle_rule": {
Type: schema.TypeSet,
Type: schema.TypeList,
Computed: true,
Deprecated: "Use the aws_s3_bucket_lifecycle_configuration resource instead",
Elem: &schema.Resource{
Expand Down Expand Up @@ -1091,6 +1091,8 @@ func resourceBucketRead(d *schema.ResourceData, meta interface{}) error {
if err := d.Set("lifecycle_rule", flattenBucketLifecycleRules(lifecycle.Rules)); err != nil {
return fmt.Errorf("error setting lifecycle_rule: %s", err)
}
} else {
d.Set("lifecycle_rule", nil)
}

// Read the bucket replication configuration
Expand Down

0 comments on commit 0f24b97

Please sign in to comment.