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 multiple aws_sns_topic with the same name #6245

Closed
abrechon opened this issue Oct 23, 2018 · 3 comments
Closed

creating multiple aws_sns_topic with the same name #6245

abrechon opened this issue Oct 23, 2018 · 3 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sns Issues and PRs that pertain to the sns service.

Comments

@abrechon
Copy link

abrechon commented Oct 23, 2018

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.8

Affected Resource(s)

  • aws_sns_topic

Terraform Configuration Files

resource "aws_sns_topic" "topic" {
  name = "${var.topic}"
}

Expected Behavior

Terraform should not allow creation of multiple sns topics with the same name as aws API create topic action is idempotent.

https://docs.aws.amazon.com/cli/latest/reference/sns/create-topic.html
This action is idempotent, so if the requester already owns a topic with the specified name, that >topic's ARN is returned without creating a new topic.

Actual Behavior

you can create multiple sns topics with the same name that are in fact the same topic as AWS API returns the same arn.

Steps to Reproduce

create two aws_sns_topic with the same name in different vpc's and delete one of them. both will be deleted as the state points to the same arn.

@nywilken nywilken added the service/sns Issues and PRs that pertain to the sns service. label Feb 5, 2019
@aeschright aeschright added the needs-triage Waiting for first response or review from a maintainer. label Jun 24, 2019
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 5, 2019
@bflad
Copy link
Contributor

bflad commented Nov 5, 2019

Hi folks 👋 Thanks for submitting this. We would certainly like to address this problem, likely more generically for all Terraform resources that could be potentially duplicated by same dimension (such as per-region and per-name). The enhancement that would be available to all Terraform resources, which we could then implement in the aws_sns_topic resource, can be tracked upstream in the Terraform Plugin SDK.

@bflad
Copy link
Contributor

bflad commented Jul 30, 2020

Hi folks 👋 Thank you for submitting this and this is an excellent use case of somewhere that Terraform and the Terraform AWS Provider could be much more helpful since in many cases they have enough information to return an error upfront during planning instead of unexpected behavior during apply.

I believe this falls under the provider-wide enhancement proposal of #14394, so by adding this link here it will add a reference to that issue so we can include it as a use case when thinking about the implementation details. Since this is likely something we will want more broadly across many resources, I'm going to close this particular issue to consolidate discussions, efforts, and prioritization on the topic while the reference would serve as the cue to make this specific resource one of the initial implementations. I would suggest those 👍 upvoting and subscribing here to do so on #14394 so we can appropriately gauge interest. Please feel free to provide feedback there.

Thanks again!

@bflad bflad closed this as completed Jul 30, 2020
@ghost
Copy link

ghost commented Aug 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 Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sns Issues and PRs that pertain to the sns service.
Projects
None yet
Development

No branches or pull requests

4 participants