fix(quicksight): Detect identity region via list_namespaces API - #1518
Open
NithinChandranR-AWS wants to merge 1 commit into
Open
NithinChandranR-AWS wants to merge 1 commit into
NithinChandranR-AWS wants to merge 1 commit into
Conversation
Replace the try/error approach that parses AccessDeniedException messages with the list_namespaces API which returns CapacityRegion directly. The old method relied on fragile regex matching of error messages that could change without notice. The describe_user fallback is preserved for environments where list_namespaces permissions are not available. Fixes aws-solutions-library-samples#943
Contributor
Author
|
Hi, gentle nudge on this PR — it's been quiet for a while and is ready for review whenever you have bandwidth. Thanks! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #943
Description
Replaces the fragile try/error approach for detecting the QuickSight identity region with the
list_namespacesAPI, which returns theCapacityRegiondirectly.Before (current behavior)
describe_userin the current regionAccessDeniedException, parse the error message with a regex to extract the identity regionAfter (this PR)
list_namespacesand queryNamespaces[? Name=='default'].CapacityRegiondescribe_usermethod iflist_namespacesfails (e.g., missing permissions)Backward Compatibility
The old behavior is preserved as a fallback. If
list_namespacesraises any exception (permissions, throttling, etc.), the code falls back to the originaldescribe_user+ regex approach.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.