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

Creating/modifying multiple SQS queues with the same name doesn't fail #15429

Closed
tonnydourado opened this issue Oct 1, 2020 · 2 comments
Closed
Labels
bug Addresses a defect in current functionality. service/sqs Issues and PRs that pertain to the sqs service.

Comments

@tonnydourado
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 v0.12.28
+ provider.aws v3.8.0

Affected Resource(s)

  • aws_sqs_queue

Terraform Configuration Files

provider "aws" {
  region     = "eu-west-1"
}

// This will result in a single queue being created, and upon re-applying, 
// the visibility_timeout_seconds will change depending on which resource
// gets applied last:
resource "aws_sqs_queue" "first_queue" {
  name                       = "my-test-queue"
  visibility_timeout_seconds = 4 * 60
}

resource "aws_sqs_queue" "second_queue" {
  name                       = "my-test-queue"
  visibility_timeout_seconds = 5 * 60
}

// This, on the other hand, will always fail:
// resource "aws_s3_bucket" "b1" {
//   bucket = "test-bucket-for-testing-duplication"
//   acl    = "private"
// }

// resource "aws_s3_bucket" "b2" {
//   bucket = "test-bucket-for-testing-duplication"
//   acl    = "private"
// }

Expected Behavior

One of the aws_sqs_queue resources should fail to apply.

Actual Behavior

Both aws_sqs_queue resources are applied, only one queue is created, and if you have different attributes in the aws_sqs_queue resources, the actual queue changea non-deterministically, depending on which resource is applied last

Steps to Reproduce

Applying the terraform code above always reproduces the issue

Important Factoids

The API documentation for SQS says that passing the same parameters of an existing queue to CreateQueue will just return the existing queue, but in this case even changing other parameters, but not the name, only a single queue gets created.

@ghost ghost added service/s3 Issues and PRs that pertain to the s3 service. service/sqs Issues and PRs that pertain to the sqs service. labels Oct 1, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 1, 2020
@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. service/s3 Issues and PRs that pertain to the s3 service. labels Oct 1, 2020
@bflad
Copy link
Member

bflad commented Oct 1, 2020

Hi @tonnydourado 👋 Thank you for submitting this and sorry you ran into trouble here. Please note that this is unexpected behavior in Terraform resources and that this has been previously reported in #10824. To consolidate efforts and discussions, I'm going to close this issue in preference of the existing one. Please 👍 react and subscribe there for further updates.

@ghost
Copy link

ghost commented Nov 1, 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 as resolved and limited conversation to collaborators Nov 1, 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. service/sqs Issues and PRs that pertain to the sqs service.
Projects
None yet
Development

No branches or pull requests

2 participants