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

Support email sns_topic_subscription #12286

Closed
mtekel opened this issue Mar 6, 2020 · 5 comments · Fixed by #14923
Closed

Support email sns_topic_subscription #12286

mtekel opened this issue Mar 6, 2020 · 5 comments · Fixed by #14923
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sns Issues and PRs that pertain to the sns service.
Milestone

Comments

@mtekel
Copy link

mtekel commented Mar 6, 2020

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

Description

Please support email protocol for sns_topic_subscription. I understand that creation is not possible (as per note in docs, see below in references). But existing topics can be imported (that works already). The use case is - for TF destroy and for monitoring changes (with terraform plan - vs any modifications done outside of TF) and applying changes that don't need resource re-creation. If the subscription is in non-confirmed state, then import should fail, preventing inability of TF to destroy or modify unconfirmed resource.

I understand that this is limited functionality, but still very valuable.

New or Affected Resource(s)

sns_topic_subscription

Potential Terraform Configuration

resource "aws_sns_topic_subscription" "abc" {
  endpoint             = "abc@def.com"
  protocol             = "email"
  raw_message_delivery = "false"
  topic_arn            = aws_sns_topic.abc.id
}.

References

#7782

Docs: https://www.terraform.io/docs/providers/aws/r/sns_topic_subscription.html

Unsupported protocols include the following:

email -- delivery of message via SMTP
email-json -- delivery of JSON-encoded message via SMTP
These are unsupported because the endpoint needs to be authorized and does not generate an ARN until the target email address has been validated. This breaks the Terraform model and as a result are not currently supported.

@mtekel mtekel added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 6, 2020
@ghost ghost added the service/sns Issues and PRs that pertain to the sns service. label Mar 6, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 6, 2020
@marcelboettcher
Copy link

I think this should be possible now as the sns api has a new attribute:
--return-subscription-arn

Sets whether the response from the Subscribe request includes the subscription ARN, even if the subscription is not yet confirmed.

As AWS now returns an ARN, I guess this feature should be possible and easy to implement.

@mtekel
Copy link
Author

mtekel commented Mar 25, 2020

So with http protocol/endpoints, TF does not support ones that don't have auto confirmation. Nevertheless, if you have one already created, TF imports it fine. This is because http(s) endpoints are not explicitly blacklisted like the email protocol. So the only change needed to support this functionality seems to be to remove that blacklist.

@gblues
Copy link

gblues commented Nov 16, 2020

Seems to me like leveraging the return-subscription-arn flag would probably eliminate the auto-confirm requirement for http/s endpoints too.

@YakDriver YakDriver self-assigned this Feb 19, 2021
@YakDriver YakDriver removed the needs-triage Waiting for first response or review from a maintainer. label Feb 19, 2021
@github-actions github-actions bot added this to the v3.30.0 milestone Feb 25, 2021
@ghost
Copy link

ghost commented Feb 26, 2021

This has been released in version 3.30.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 28, 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 28, 2021
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

Successfully merging a pull request may close this issue.

4 participants