-
Notifications
You must be signed in to change notification settings - Fork 120
multiaccount support without root feature added #1787
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
base: main
Are you sure you want to change the base?
multiaccount support without root feature added #1787
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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.
Lets bump integration version to 0.3.0-dev
in the pyproject.toml
for account in member_accounts: | ||
if account["Id"] == self._application_account_id: | ||
# Skip the current account as it is already added | ||
# Replace the Temp account details with the current account details | ||
self._aws_accessible_accounts[0] = account | ||
continue |
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.
in this case all accessible accounts, including the application account will not have complete data, how are we compensating for this ?
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.
This case is handled using a function named "_get_member_accounts", which converts the list of member account IDs into a list of dictionaries. Each dictionary contains both the Id and Name of the account.
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.
I'm actually curios about what resources ingested into Accounts kind look like, it will all be dummy accounts, No ?
e.g [{"Id": f"{account_id}", "Name": "No name found"}, {"Id": f"{account_id}", "Name": "No name found"} ...]
since self._aws_accessible_accounts isn't getting updated with actual properties, we aren't getting the full data that describes and Account.
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.
We will be passing list of accounts like this - OCEAN__INTEGRATION__CONFIG__MEMBER_ACCOUNTS: ["12333222232","232932392832"], which would be actual account ids. Just to support format that is being used, we are converting this list to dict which would have ID and Name as key.
Got the idea to convert the list to a dictionary from here. - https://github.com/port-labs/ocean/blob/main/integrations/aws/aws/session_manager.py#L56
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.
I've raised a PR for the Helm chart to add support for arrays in the integration config - port-labs/helm-charts#188
Done |
User description
Description
What -
Why -
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
PR Type
Enhancement
Description
• Added multi-account AWS support without requiring root account access
• Introduced
member_accounts
configuration parameter for direct account specification• Enhanced session manager to handle member accounts independently from organization access
Changes walkthrough 📝
session_manager.py
Enhanced session manager for rootless multi-account support
integrations/aws/aws/session_manager.py
• Added
_get_member_accounts()
method to retrieve configured memberaccounts
• Implemented
_update_available_access_credentials_without_root()
for non-rootmulti-account access
• Enhanced
reset()
method to call new credentialupdate function
• Added concurrent processing for member account
credential updates
spec.yaml
Added member accounts configuration parameter
integrations/aws/.port/spec.yaml
• Added
memberAccounts
configuration parameter as optional array• Set
default value as empty array for member accounts list
• Added
description explaining usage without organizationRoleArn