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 7, 2022
1 parent db0e999 commit 594a89b
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 @@ -263,7 +263,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 @@ -1033,6 +1033,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 if configured outside this resource
Expand Down

0 comments on commit 594a89b

Please sign in to comment.