Skip to content

S3 Invalid Attribute Combination warning #104

@ducksauz

Description

@ducksauz

Describe the Bug

I'm creating a Cloudtrail bucket and getting the following warning from the AWS provider due to the lifecycle config built into this module.

 Warning: Invalid Attribute Combination
│
│   with module.account_defaults.module.cloudtrail_s3_bucket.module.s3_bucket.module.aws_s3_bucket.aws_s3_bucket_lifecycle_configuration.default[0],
│   on .terraform/modules/account_defaults.cloudtrail_s3_bucket.s3_bucket.aws_s3_bucket/lifecycle.tf line 157, in resource "aws_s3_bucket_lifecycle_configuration" "default":
│  157: resource "aws_s3_bucket_lifecycle_configuration" "default" {
│
│ No attribute specified when one (and only one) of
│ [rule[0].filter[0].prefix.<.object_size_greater_than,rule[0].filter[0].prefix.<.object_size_less_than,rule[0].filter[0].prefix.<.and,rule[0].filter[0].prefix.<.tag]
│ is required
│
│ This will be an error in a future version of the provider

The Terraform being used to call this module is:

module "cloudtrail_s3_bucket" {
  source = "cloudposse/cloudtrail-s3-bucket/aws"
  # Cloud Posse recommends pinning every module to a specific version
  version     = "0.27.0"
  namespace                     = var.cp_namespace
  stage                         = var.cp_stage
  name                          = var.cp_name
  lifecycle_rule_enabled        = true
  expiration_days               = 400
 }

Expected Behavior

Not to get a warning (looking to ward off future errors with this bug report)

Steps to Reproduce

Create a cloudtrail bucket with the above configuration

Screenshots

No response

Environment

Terraform: 1.11.4
AWS: 5.98.0
Cloudposse Cloudtrail-S3-Bucket: 0.27.0

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions