-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Cross-account SNS subscription fails with provider bug message #10225
Comments
We are also having a similar issue with creating an SNS topic subscription in one account (
ResultResource created in Console but Terraform returns the following:
Terraform Version0.12.9 |
@kelseymok We noticed that the unit tests were only using lowercase for |
Should we also allow uppercase |
My thought would be to enforce uppercase as that's what is used in ELBs. But either way the validator must only allow the correct case to pass, unlike at the moment. |
…l consistency, enforce lowercase protocol argument validation Reference: #10225 Reference: #11737 Reference: #12692 Reference: #16695 Reference: #16796 The `protocol` validation update is to catch where the API accepts uppercase values such as `HTTPS`, but prevents proper handling when the API canonicalizes it to lowercase. The API documentation and existing Terraform documentation solely use lowercase. Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (95.60s) --- PASS: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (137.43s) --- PASS: TestAccAWSSNSTopicSubscription_basic (66.20s) --- PASS: TestAccAWSSNSTopicSubscription_deliveryPolicy (69.55s) --- PASS: TestAccAWSSNSTopicSubscription_disappears (74.02s) --- PASS: TestAccAWSSNSTopicSubscription_disappears_topic (75.13s) --- PASS: TestAccAWSSNSTopicSubscription_email (16.78s) --- PASS: TestAccAWSSNSTopicSubscription_filterPolicy (71.62s) --- PASS: TestAccAWSSNSTopicSubscription_firehose (140.29s) --- PASS: TestAccAWSSNSTopicSubscription_rawMessageDelivery (69.77s) --- PASS: TestAccAWSSNSTopicSubscription_redrivePolicy (64.88s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSSNSTopicSubscription_basic (70.13s) --- PASS: TestAccAWSSNSTopicSubscription_deliveryPolicy (106.45s) --- PASS: TestAccAWSSNSTopicSubscription_disappears (82.09s) --- PASS: TestAccAWSSNSTopicSubscription_disappears_topic (68.14s) --- PASS: TestAccAWSSNSTopicSubscription_email (20.04s) --- PASS: TestAccAWSSNSTopicSubscription_filterPolicy (106.32s) --- PASS: TestAccAWSSNSTopicSubscription_rawMessageDelivery (95.36s) --- PASS: TestAccAWSSNSTopicSubscription_redrivePolicy (110.75s) --- SKIP: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (1.41s) --- SKIP: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (1.41s) --- SKIP: TestAccAWSSNSTopicSubscription_firehose (53.36s) ```
…l consistency, enforce lowercase protocol argument validation (#18475) * resource/aws_sns_topic_subscription: Handle read-after-create eventual consistency, enforce lowercase protocol argument validation Reference: #10225 Reference: #11737 Reference: #12692 Reference: #16695 Reference: #16796 The `protocol` validation update is to catch where the API accepts uppercase values such as `HTTPS`, but prevents proper handling when the API canonicalizes it to lowercase. The API documentation and existing Terraform documentation solely use lowercase. Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (95.60s) --- PASS: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (137.43s) --- PASS: TestAccAWSSNSTopicSubscription_basic (66.20s) --- PASS: TestAccAWSSNSTopicSubscription_deliveryPolicy (69.55s) --- PASS: TestAccAWSSNSTopicSubscription_disappears (74.02s) --- PASS: TestAccAWSSNSTopicSubscription_disappears_topic (75.13s) --- PASS: TestAccAWSSNSTopicSubscription_email (16.78s) --- PASS: TestAccAWSSNSTopicSubscription_filterPolicy (71.62s) --- PASS: TestAccAWSSNSTopicSubscription_firehose (140.29s) --- PASS: TestAccAWSSNSTopicSubscription_rawMessageDelivery (69.77s) --- PASS: TestAccAWSSNSTopicSubscription_redrivePolicy (64.88s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSSNSTopicSubscription_basic (70.13s) --- PASS: TestAccAWSSNSTopicSubscription_deliveryPolicy (106.45s) --- PASS: TestAccAWSSNSTopicSubscription_disappears (82.09s) --- PASS: TestAccAWSSNSTopicSubscription_disappears_topic (68.14s) --- PASS: TestAccAWSSNSTopicSubscription_email (20.04s) --- PASS: TestAccAWSSNSTopicSubscription_filterPolicy (106.32s) --- PASS: TestAccAWSSNSTopicSubscription_rawMessageDelivery (95.36s) --- PASS: TestAccAWSSNSTopicSubscription_redrivePolicy (110.75s) --- SKIP: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (1.41s) --- SKIP: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (1.41s) --- SKIP: TestAccAWSSNSTopicSubscription_firehose (53.36s) ``` * Update CHANGELOG for #18475
This has been released in version 3.35.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! |
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! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Which yields the following with a plan:
Expected Behavior
A subscription to the given topic for the given endpoint should have occurred.
Actual Behavior
Looking, I can see that the subscription was created but not confirmed.
Steps to Reproduce
Create a cross-account subscription request (see configuration above).
terraform apply
Important Factoids
There are two separate accounts - a
root
account in which the topic resides, and ademo
account in which the sqs endpoint resides. Theprovider = aws.root
gives admin access to the root account, while access to the subaccounts is provided via role switching, which is possibly the problem here. The providers are set up like so:The default 'root' profile has the keys, while the 'demo' profile provides the role definition necessary to access the demo (which has admin privileges in demo). So I can see it using the root account to create the subscription, then failing to obtain the confirmation URL from the SQS queue because it can't figure out how to access the demo account (because of
provider=aws.root
). Maybe aprovider_endpoint
that specifies permissions to obtain the endpoint subscription confirmation?The text was updated successfully, but these errors were encountered: