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

Provider produced inconsistent result after apply when HTTPS instead of https as protocol for an aws_sns_topic_subscription #17509

Closed
madpipeline opened this issue Feb 8, 2021 · 5 comments
Labels
bug Addresses a defect in current functionality. service/sns Issues and PRs that pertain to the sns service.

Comments

@madpipeline
Copy link
Contributor

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.24
Provider: 2.45

Affected Resource(s)

  • aws_sns_topic_subscription

Terraform Configuration Files

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

variable "sns_subscriptions" {
  description = "A list of objects with `protocol` and `endpoint` to be created as subscriptions to the sns topic."
  type = list(object({
    protocol = string
    endpoint = string
  }))
  default = []
}

resource "aws_sns_topic_subscription" "sns_subscriptions" {
  count                  = length(var.sns_subscriptions)
  topic_arn              = aws_sns_topic.sns.arn
  protocol               = element(var.sns_subscriptions.*.protocol, count.index)
  endpoint               = element(var.sns_subscriptions.*.endpoint, count.index)
  endpoint_auto_confirms = true
}

# value of var.sns_subscriptions is:
sns_subscriptions = [
  {
    protocol = "HTTPS"
    endpoint = "https://events.pagerduty.com/integration/XXXXXXX/enqueue"
  }
]

Debug Output

https://gist.github.com/madpipeline/43def6a230de01cdab0be20720efbc4b

Expected Behavior

module.sns.aws_sns_topic.sns: Refreshing state... [id=arn:aws:sns:us-east-1:XXXXXX:XXX]
module.sns.aws_sns_topic_subscription.sns_subscriptions[0]: Creating...
module.sns.aws_sns_topic_subscription.sns_subscriptions[0]: Creation complete after 2s [id=arn:aws:sns:us-east-1:XXXX:XXXX:XXXX]

Actual Behavior

module.sns.aws_sns_topic.sns: Refreshing state... [id=arn:aws:sns:us-east-1:XXXXXX:XXX]
module.sns.aws_sns_topic_subscription.sns_subscriptions[0]: Creating...
Error: Provider produced inconsistent result after apply

When applying changes to
module.sns.aws_sns_topic_subscription.sns_subscriptions[0], provider
"registry.terraform.io/-/aws" produced an unexpected new value for was
present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Steps to Reproduce

  1. terraform apply

Important Factoids

The issue goes away if you change the value of protocol from HTTPS to https.

@ghost ghost added the service/sns Issues and PRs that pertain to the sns service. label Feb 8, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 8, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 8, 2021
@ewbankkit
Copy link
Contributor

@madpipeline Thanks for raising this issue.
It has already been noticed in #11737. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@madpipeline
Copy link
Contributor Author

Hello @ewbankkit . Sorry for the duplicate. I didn't find that ticket when I looked if it was already reported. I'll be more careful next time.

@ewbankkit
Copy link
Contributor

@madpipeline No worries, there are a lot of open issues.

@ghost
Copy link

ghost commented Mar 11, 2021

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 Mar 11, 2021
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/sns Issues and PRs that pertain to the sns service.
Projects
None yet
Development

No branches or pull requests

2 participants