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-5] sns_topic - Fix Permission Issue for Cross Account Subscriptions #1701

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)
@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 5m 15s
✔️ build-ansible-collection SUCCESS in 5m 40s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 47s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 9m 36s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 38s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 37s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 10m 16s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 36s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 24s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 7m 07s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 10m 17s
✔️ ansible-test-changelog SUCCESS in 2m 19s
✔️ ansible-test-splitter SUCCESS in 2m 33s
✔️ integration-community.aws-1 SUCCESS in 7m 07s
⚠️ 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 287672c into stable-5 Feb 3, 2023
@softwarefactory-project-zuul softwarefactory-project-zuul bot deleted the patchback/backports/stable-5/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
Backup selection bugfix

SUMMARY
Fix bug in backup_selection where an existing backup selection was not updated to add Conditions if that value was previously empty.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
backup_selection
ADDITIONAL INFORMATION
Split into two commits, the first commit adds comprehensive integration tests to cover the scenarios that were failing and the second commit fixes the code.

Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Alina Buzachis
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