Skip to content

Error: AWS S3 directory bucket name fails terraform plan when create_s3_directory_bucket is true #273

@sonjali2023

Description

@sonjali2023

Describe the Bug

When create_s3_directory_bucket is set to true, the created directory bucket name is

[bucket_name]-[availability_zone_id]

This fails terraform plan

Attribute bucket must be in the format [bucket_name]--[azid]--x-s3. Use the aws_s3_bucket resource to manage general purpose buckets, got: [bucket_name]-[azid]

Docs:

Expected Behavior

I expect the generated name of directory bucket to follow [bucket_name]--[azid]--x-s3.

Steps to Reproduce

module "<module name here>" {
  source  = "cloudposse/s3-bucket/aws"
  version = "4.10.0"

  name                 =  "<name here>"
  bucket_name          =  "<bucket name here>"
  namespace            = "<namespace here>"
  stage                = "<stage here>"
  availability_zone_id = "use1-az1"

  sse_algorithm              = "AES256"
  versioning_enabled         = true
  create_s3_directory_bucket = true
}

Screenshots

No response

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions