Skip to content

[Bug]: aws_s3_bucket_lifecycle_configuration "couldn't find resource" since 5.86 #41363

@Dave-EMIS

Description

@Dave-EMIS

Terraform Core Version

1.10

AWS Provider Version

5.86.0

Affected Resource(s)

  • aws_s3_bucket_lifecycle_configuration
  • aws_s3_bucket

Expected Behavior

When creating an S3 bucket and lifecycle configuration policy there should be no error

Actual Behavior

Getting:

│ Error: creating S3 Bucket (my-bucket) Lifecycle Configuration
│ 
│   with module.bucket.aws_s3_bucket_lifecycle_configuration.xxx,
│   on ../modules/bucket/main.tf line 93, in resource "aws_s3_bucket_lifecycle_configuration" "xxx":
│   93: resource "aws_s3_bucket_lifecycle_configuration" "xxx" {
│ 
│ couldn't find resource

Relevant Error/Panic Output Snippet

Terraform Configuration Files

I've had failures with 2 different lifecylce configurations, I've shown them both here, but I don't think the rule's are the problem

resource "aws_s3_bucket" "xxx" {
  bucket = "my-bucket"
  tags = {
    Name = "name"
  }
}

resource "aws_s3_bucket_lifecycle_configuration" "xxx" {
  bucket = aws_s3_bucket.xxx.id

  rule {
    id = "Retain last 30 days"
    # Expires after 30 days
    expiration {
      days = 30
    }
    # Deleted 1 day after expiration
    noncurrent_version_expiration {
      noncurrent_days = 1
    }
    status = "Enabled"
  }
}

# OR

resource "aws_s3_bucket_lifecycle_configuration" "xxx" {
  bucket = aws_s3_bucket.xxx.id

  rule {
    id = "Archive to Glacier Deep Archive"
    transition {
      days          = 30
      storage_class = "DEEP_ARCHIVE"
    }
    status = "Enabled"
  }
}

Steps to Reproduce

⬇️ ⬇️ See my comment below with a minimal repo ⬇️ ⬇️

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/s3Issues and PRs that pertain to the s3 service.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions