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

aws_s3_bucket resources with same name are not emitting "bucket already exists" errors #25622

Closed
rnikoopour opened this issue Jun 29, 2022 · 2 comments
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@rnikoopour
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 other comments that do not add relevant new information or questions, 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 CLI and Terraform AWS Provider Version

 % terraform -v                                                                                                                                                              
Terraform v1.2.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.20.1

Affected Resource(s)

  • aws_s3_bucket resource

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_s3_bucket" "first" {
  name = "my_new_s3_bucket_12345"
}

// The bucket name is deliberately the same
resource "aws_s3_bucket" "second" {
  name = "my_new_s3_bucket_12345"
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

I start off by only having resource "first" in the file and run a terraform apply. After this successfully runs, I add resource "second" to the file with the same exact bucket name. Then I run a terraform apply. This should fail with a bucket name already exists error.

Actual Behavior

After adding resource "second" to the file and running a terraform apply, it runs to completion saying that it created resource "second" even though the bucket already existed and was deployed through resource "first".

Steps to Reproduce

  1. Create the following bucket:
resource "aws_s3_bucket" "first" {
  name = "my_new_s3_bucket_12345"
}
  1. Run terraform apply
  2. Update the terraform file to add the second bucket with the same name:
resource "aws_s3_bucket" "first" {
  name = "my_new_s3_bucket_12345"
}

resource "aws_s3_bucket" "second" {
  name = "my_new_s3_bucket_12345"
}
  1. Run terraform apply

Important Factoids

N/A

References

N/A

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/s3 Issues and PRs that pertain to the s3 service. labels Jun 29, 2022
@rnikoopour rnikoopour changed the title aws_s3_bucket resources with same name are getting automatically imported aws_s3_bucket resources with same name are not emitting "bucket already exists errors" Jun 29, 2022
@rnikoopour rnikoopour changed the title aws_s3_bucket resources with same name are not emitting "bucket already exists errors" aws_s3_bucket resources with same name are not emitting "bucket already exists" errors Jun 29, 2022
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 7, 2022
@gdavison
Copy link
Contributor

This is a duplicate of #13587

@gdavison gdavison closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2022
@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 Aug 27, 2022
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. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

3 participants