-
Notifications
You must be signed in to change notification settings - Fork 398
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
Add support for SQS RawMessageDelievery attribute in subscriptions - issue #193 #640
Add support for SQS RawMessageDelievery attribute in subscriptions - issue #193 #640
Conversation
recheck |
@alinabuzachis @jillr can you review the PR please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to submit this PR.
Please remove the .ansible-test directory, and Docker and Pipfile files. If you believe they should be added in general then open a separate PR, however they look like they're re-inventing ansible-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to submit this PR. A couple of small issues.
…or RawMessageDelievery (SQS) Add sqs subscription for testing
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Sorry it's taken so long to get back to this review. I've rebased this against the latest change sets and I think it's ready to be merged |
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #1302 🤖 @patchback |
…or RawMessageDelievery (SQS) (#640) Add support for SQS RawMessageDelievery attribute in subscriptions - issue #193 SUMMARY Added support to configure RawMessageDelievery option when configuring sqs endpoints. It use boto3 set_subscription_attributes() to configure changes. It currently supports only this option, but should be easily extended in the future. Attributes are expected in the form as in the boto3 docs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.set_subscription_attributes Fixes #193 ISSUE TYPE Feature Pull Request COMPONENT NAME updates sns_topic.py to support new functionality example: - sns_topic: name: '{{ sns_topic_topic_name }}' display_name: My new topic name subscriptions: - endpoint: "{{ sqs_arn }}" protocol: sqs attributes: RawMessageDelivery: true Reviewed-by: Jill R <None> Reviewed-by: None <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: Mark Chappell <None> (cherry picked from commit 932263d)
…or RawMessageDelievery (SQS) (#640) (#1302) [PR #640/932263d4 backport][stable-4] Add support for SQS RawMessageDelievery attribute in subscriptions - issue #193 This is a backport of PR #640 as merged into main (932263d). SUMMARY Added support to configure RawMessageDelievery option when configuring sqs endpoints. It use boto3 set_subscription_attributes() to configure changes. It currently supports only this option, but should be easily extended in the future. Attributes are expected in the form as in the boto3 docs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.set_subscription_attributes Fixes #193 ISSUE TYPE Feature Pull Request COMPONENT NAME updates sns_topic.py to support new functionality example: - sns_topic: name: '{{ sns_topic_topic_name }}' display_name: My new topic name subscriptions: - endpoint: "{{ sqs_arn }}" protocol: sqs attributes: RawMessageDelivery: true Reviewed-by: Mark Chappell <None>
sns_topic - Fix Permission Issue for Cross Account Subscriptions SUMMARY sns_topic currently fails with the following error if it has any cross account subscriptions: Couldn't get subscription attributes for subscription arn:aws:sns:us-east-1:123412341234:my-sns-topic-name:555950dc-7c5f-416c-8f8e-e8f38eabfa54: An error occurred (AuthorizationError) when calling the GetSubscriptionAttributes operation: Not authorized to access this subscription This happens, for example, when a Lambda function in account A is subscribed to an SNS topic in account B, as described here. I believe this was caused by #640. I am not sure how to write a test for this specific situation as it would require multiple AWS accounts. ISSUE TYPE Bugfix Pull Request COMPONENT NAME sns_topic ADDITIONAL INFORMATION - community.aws.sns_topic: name: my-sns-topic-in-account-123412341234 subscriptions: - endpoint: "arn:aws:lambda:us-east-1:567856785678:function:my-lambda-function-in-account-567856785678" protocol: lambda state: present Reviewed-by: Mark Chappell <None>
sns_topic - Fix Permission Issue for Cross Account Subscriptions SUMMARY sns_topic currently fails with the following error if it has any cross account subscriptions: Couldn't get subscription attributes for subscription arn:aws:sns:us-east-1:123412341234:my-sns-topic-name:555950dc-7c5f-416c-8f8e-e8f38eabfa54: An error occurred (AuthorizationError) when calling the GetSubscriptionAttributes operation: Not authorized to access this subscription This happens, for example, when a Lambda function in account A is subscribed to an SNS topic in account B, as described here. I believe this was caused by #640. I am not sure how to write a test for this specific situation as it would require multiple AWS accounts. ISSUE TYPE Bugfix Pull Request COMPONENT NAME sns_topic ADDITIONAL INFORMATION - community.aws.sns_topic: name: my-sns-topic-in-account-123412341234 subscriptions: - endpoint: "arn:aws:lambda:us-east-1:567856785678:function:my-lambda-function-in-account-567856785678" protocol: lambda state: present Reviewed-by: Mark Chappell <None> (cherry picked from commit de21c4b)
sns_topic - Fix Permission Issue for Cross Account Subscriptions SUMMARY sns_topic currently fails with the following error if it has any cross account subscriptions: Couldn't get subscription attributes for subscription arn:aws:sns:us-east-1:123412341234:my-sns-topic-name:555950dc-7c5f-416c-8f8e-e8f38eabfa54: An error occurred (AuthorizationError) when calling the GetSubscriptionAttributes operation: Not authorized to access this subscription This happens, for example, when a Lambda function in account A is subscribed to an SNS topic in account B, as described here. I believe this was caused by #640. I am not sure how to write a test for this specific situation as it would require multiple AWS accounts. ISSUE TYPE Bugfix Pull Request COMPONENT NAME sns_topic ADDITIONAL INFORMATION - community.aws.sns_topic: name: my-sns-topic-in-account-123412341234 subscriptions: - endpoint: "arn:aws:lambda:us-east-1:567856785678:function:my-lambda-function-in-account-567856785678" protocol: lambda state: present Reviewed-by: Mark Chappell <None> (cherry picked from commit de21c4b)
…) (#1700) [PR #1418/de21c4bd backport][stable-4] sns_topic - Fix Permission Issue for Cross Account Subscriptions This is a backport of PR #1418 as merged into main (de21c4b). SUMMARY sns_topic currently fails with the following error if it has any cross account subscriptions: Couldn't get subscription attributes for subscription arn:aws:sns:us-east-1:123412341234:my-sns-topic-name:555950dc-7c5f-416c-8f8e-e8f38eabfa54: An error occurred (AuthorizationError) when calling the GetSubscriptionAttributes operation: Not authorized to access this subscription This happens, for example, when a Lambda function in account A is subscribed to an SNS topic in account B, as described here. I believe this was caused by #640. I am not sure how to write a test for this specific situation as it would require multiple AWS accounts. ISSUE TYPE Bugfix Pull Request COMPONENT NAME sns_topic ADDITIONAL INFORMATION - community.aws.sns_topic: name: my-sns-topic-in-account-123412341234 subscriptions: - endpoint: "arn:aws:lambda:us-east-1:567856785678:function:my-lambda-function-in-account-567856785678" protocol: lambda state: present Reviewed-by: Mark Chappell <None>
…) (#1701) [PR #1418/de21c4bd backport][stable-5] sns_topic - Fix Permission Issue for Cross Account Subscriptions This is a backport of PR #1418 as merged into main (de21c4b). SUMMARY sns_topic currently fails with the following error if it has any cross account subscriptions: Couldn't get subscription attributes for subscription arn:aws:sns:us-east-1:123412341234:my-sns-topic-name:555950dc-7c5f-416c-8f8e-e8f38eabfa54: An error occurred (AuthorizationError) when calling the GetSubscriptionAttributes operation: Not authorized to access this subscription This happens, for example, when a Lambda function in account A is subscribed to an SNS topic in account B, as described here. I believe this was caused by #640. I am not sure how to write a test for this specific situation as it would require multiple AWS accounts. ISSUE TYPE Bugfix Pull Request COMPONENT NAME sns_topic ADDITIONAL INFORMATION - community.aws.sns_topic: name: my-sns-topic-in-account-123412341234 subscriptions: - endpoint: "arn:aws:lambda:us-east-1:567856785678:function:my-lambda-function-in-account-567856785678" protocol: lambda state: present Reviewed-by: Mark Chappell <None>
SUMMARY
Added support to configure
RawMessageDelievery
option when configuring sqs endpoints.It use boto3
set_subscription_attributes()
to configure changes.It currently supports only this option, but should be easily extended in the future.
Attributes are expected in the form as in the boto3 docs:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.set_subscription_attributes
Fixes #193
ISSUE TYPE
COMPONENT NAME
updates sns_topic.py to support new functionality