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

fix: Remove data resource for sns topic to avoid race condition #81

Conversation

bushong1
Copy link
Contributor

Description

Remove the SNS Topic Data Resource and instead craft the SNS Topic ARN as a string.

Motivation and Context

Data Resources are evaluated before any code is executed, so if a single terraform apply intends to create an SNS topic and create this module, the apply will fail because the data resource cannot resolve. Avoiding the use of data resources by deriving the SNS manually corrects the issue in this case.
#46

Breaking Changes

This should not affect any existing deployment aside from seeing a change from removing a data resource.

How Has This Been Tested?

Using the examples

@bushong1 bushong1 changed the title #46 Remove data resource for sns topic to avoid race condition Remove data resource for sns topic to avoid race condition #46 Apr 29, 2020
@bushong1 bushong1 changed the title Remove data resource for sns topic to avoid race condition #46 Remove data resource for sns topic to avoid race condition Apr 29, 2020
@bushong1 bushong1 force-pushed the fix-sns-topic-data-resource branch from 1e8a10f to 3b4c166 Compare April 29, 2020 14:30
@bushong1 bushong1 changed the title Remove data resource for sns topic to avoid race condition fix: Remove data resource for sns topic to avoid race condition Apr 29, 2020
@bushong1 bushong1 force-pushed the fix-sns-topic-data-resource branch from 3b4c166 to d3ba438 Compare April 29, 2020 14:32
…form-aws-modulesGH-46

Data Resources are evaluated before any code is executed, so if a single terraform apply intends to create an SNS topic _and_ create this module, the apply will fail because the data resource cannot resolve.  Avoiding the use of data resources by deriving the SNS manually corrects the issue in this case.
@bushong1 bushong1 force-pushed the fix-sns-topic-data-resource branch from d3ba438 to 64d3aa2 Compare April 29, 2020 14:42
@razorsedge
Copy link

This PR works for me.

@razorsedge
Copy link

@antonbabenko Why has this PR not been reviewed? create_sns_topic = false with sns_topic_name = blah is broken if blah does not already exist.

@antonbabenko antonbabenko merged commit 2c4f15b into terraform-aws-modules:master Mar 1, 2021
@antonbabenko
Copy link
Member

Why has this PR not been reviewed?

Lack of time and various other priorities.

Want to support? Consider sponsoring me on GitHub.

@antonbabenko
Copy link
Member

Finally! :)

v4.12.0 has been just released.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this pull request 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 related to this change, 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 Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants