Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 upgrade, The argument "rule.0.id" is required, but no definition was found. #143

Closed
joemiller opened this issue Mar 30, 2022 · 4 comments

Comments

@joemiller
Copy link

Running into an issue after the v3.x upgrade and after reading the upgrade guide and reviewing the legacy-complete -vs- complete examples, I am unsure how to upgrade some of our resources.

The error:

│ Error: Missing required argument
│
│   with module.bucket.aws_s3_bucket_lifecycle_configuration.this[0],
│   on .terraform/modules/bucket/main.tf line 213, in resource "aws_s3_bucket_lifecycle_configuration" "this":
│  213: resource "aws_s3_bucket_lifecycle_configuration" "this" {
│
│ The argument "rule.0.id" is required, but no definition was found.

The module invocation looks like:

module "bucket" {
  source  = "terraform-aws-modules/s3-bucket/aws"
  version = "~> 2.0"

  bucket                  = local.bucket_name
  acl                     = "private"
  block_public_acls       = true
  block_public_policy     = true
  restrict_public_buckets = true
  ignore_public_acls      = true
  tags                    = local.tags

  lifecycle_rule = [
    {
      enabled = true
      transition = [
        {
          days          = 30
          storage_class = "STANDARD_IA"
        }
      ]
      expiration = {
        days = 395 # 13 months(ish)
      }
    }
  ]

  force_destroy = false
}

Hopefully I am missing something obvious here. Any pointers would be welcome. thanks

@joemiller
Copy link
Author

Figured it out. Lifecycle rule was missing an id attribute.

@antonbabenko
Copy link
Member

id is missing in each lifecycle_rule - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_lifecycle_configuration#id

@antonbabenko
Copy link
Member

All right :)

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants