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

No longer able to pass bucket name as empty string #7868

Closed
matthewduren opened this issue Mar 8, 2019 · 4 comments · Fixed by #7881
Closed

No longer able to pass bucket name as empty string #7868

matthewduren opened this issue Mar 8, 2019 · 4 comments · Fixed by #7881
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@matthewduren
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.11
AWS provider v2.1.0

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

variable "bucket_name" {
  default = ""
}

resource "aws_s3_bucket" "main" {
  bucket = "${var.bucket_name}"
....
}

Expected Behavior

The bucket should have been given an auto-generated name

Actual Behavior

Length validation error

aws_s3_bucket.main: expected length of bucket to be in the range (3 - 63), got 

References

See #7778

Offending line:
https://github.com/terraform-providers/terraform-provider-aws/pull/7778/files#diff-ec071549f7daf514c0a6203559384e80R42

ValidateFunc:  validation.StringLenBetween(3, 63),
@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/s3 Issues and PRs that pertain to the s3 service. labels Mar 8, 2019
bflad added a commit that referenced this issue Mar 10, 2019
Reference: #7868

Output from acceptance testing before code change:

```
--- FAIL: TestAccAWSS3Bucket_Bucket_EmptyString (2.15s)
    testing.go:538: Step 0 error: config is invalid: aws_s3_bucket.test: expected length of bucket to be in the range (3 - 63), got
```

Output from acceptance testing:

```
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (26.50s)
```
@bflad
Copy link
Contributor

bflad commented Mar 10, 2019

Fix submitted: #7881

@bflad bflad added this to the v2.2.0 milestone Mar 14, 2019
@bflad
Copy link
Contributor

bflad commented Mar 14, 2019

The fix for this has been merged and will release with version 2.2.0 of the Terraform AWS Provider, likely later today.

@bflad
Copy link
Contributor

bflad commented Mar 15, 2019

This has been released in version 2.2.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 31, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
2 participants