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

[PR #1418/de21c4bd backport][stable-4] sns_topic - Fix Permission Issue for Cross Account Subscriptions #1700

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Feb 3, 2023

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

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)
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 3m 49s
✔️ build-ansible-collection SUCCESS in 5m 32s
ansible-test-sanity-docker-devel FAILURE in 11m 19s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 9m 17s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 15s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 12s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 10m 22s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 18s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 13s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 23s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 7m 10s
✔️ ansible-test-changelog SUCCESS in 2m 14s
✔️ ansible-test-splitter SUCCESS in 2m 49s
✔️ integration-community.aws-1 SUCCESS in 6m 33s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
⚠️ integration-community.aws-14 SKIPPED
⚠️ integration-community.aws-15 SKIPPED
⚠️ integration-community.aws-16 SKIPPED
⚠️ integration-community.aws-17 SKIPPED
⚠️ integration-community.aws-18 SKIPPED
⚠️ integration-community.aws-19 SKIPPED
⚠️ integration-community.aws-20 SKIPPED
⚠️ integration-community.aws-21 SKIPPED
⚠️ integration-community.aws-22 SKIPPED

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Feb 3, 2023
@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Feb 3, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 4m 23s
✔️ build-ansible-collection SUCCESS in 6m 11s
ansible-test-sanity-docker-devel FAILURE in 9m 35s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 10m 42s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 13s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 22s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 13m 08s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 17s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 08s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 7m 29s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 7m 25s
✔️ ansible-test-changelog SUCCESS in 2m 17s
✔️ ansible-test-splitter SUCCESS in 2m 31s
✔️ integration-community.aws-1 SUCCESS in 8m 12s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
⚠️ integration-community.aws-14 SKIPPED
⚠️ integration-community.aws-15 SKIPPED
⚠️ integration-community.aws-16 SKIPPED
⚠️ integration-community.aws-17 SKIPPED
⚠️ integration-community.aws-18 SKIPPED
⚠️ integration-community.aws-19 SKIPPED
⚠️ integration-community.aws-20 SKIPPED
⚠️ integration-community.aws-21 SKIPPED
⚠️ integration-community.aws-22 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 4631d2d into stable-4 Feb 3, 2023
@softwarefactory-project-zuul softwarefactory-project-zuul bot deleted the patchback/backports/stable-4/de21c4bdda68d6c9f1c14c7d4d0d8604b06929a6/pr-1418 branch February 3, 2023 14:18
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
 GHA: Exclude Python 3.9 runs for milestone branch

SUMMARY
At least for sanity tests.
Ref: ansible-collections/news-for-maintainers#56
ISSUE TYPE

Test Pull Request

COMPONENT NAME
GHA sanity tests

Reviewed-by: Alina Buzachis
Reviewed-by: Mark Chappell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review mergeit Merge the PR (SoftwareFactory) module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants