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

TF not warning same resource being declared twice #10621

Closed
ghost opened this issue Oct 24, 2019 · 3 comments
Closed

TF not warning same resource being declared twice #10621

ghost opened this issue Oct 24, 2019 · 3 comments
Labels
service/sqs Issues and PRs that pertain to the sqs service.

Comments

@ghost
Copy link

ghost commented Oct 24, 2019

This issue was originally opened by @sandyleo26 as hashicorp/terraform#23175. It was migrated here as a result of the provider split. The original body of the issue is below.


Not sure if this is reported because but it seems very problematic to me if this is expected behaviour.

plan and then apply the following will give me one queue named test with 60s visibility_timeout_seconds. I expect TF would raise warning at least or bubble up errors from AWS but it's all green.

Terraform Version

Terraform v0.12.10
+ provider.aws v2.33.0

Terraform Configuration Files

resource "aws_sqs_queue" "sha-test" {
  visibility_timeout_seconds = 120
  name = "test"
}

resource "aws_sqs_queue" "sha-test2" {
  name = "test"
  visibility_timeout_seconds = 60
}

Expected Behavior

TF warn me the two resources actually the same.

Actual Behavior

TF proceed and overwrite the configuration. And the state file contains duplicate queues.

Steps to Reproduce

  1. terraform init
  2. terraform plan
  3. terraform apply
@ghost ghost added the service/sqs Issues and PRs that pertain to the sqs service. label Oct 24, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 24, 2019
@radeksimko
Copy link
Member

Related: hashicorp/terraform-plugin-sdk#224

@ryndaniels
Copy link
Contributor

Hi @sandyleo26 - thanks for taking the time to open this issue. Unfortunately, I am not able to reproduce this behavior with the latest versions of both Terraform and the AWS Provider with the configuration you provided. With the latest version, this config gives me the following error:

Error: Error creating SQS queue: QueueAlreadyExists: A queue already exists with the same name and a different value for attribute VisibilityTimeout

We're going to go ahead and close this issue for now, but if you are still seeing this behavior when you are using the latest versions, please feel free to open another issue.

@ryndaniels ryndaniels removed the needs-triage Waiting for first response or review from a maintainer. label Nov 4, 2019
@ghost
Copy link
Author

ghost commented Mar 29, 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 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/sqs Issues and PRs that pertain to the sqs service.
Projects
None yet
Development

No branches or pull requests

2 participants