CrowdStrike / cloud-resource-estimator

Cloud deployment size calculation utilities
The Unlicense
17 stars 19 forks source link

Allow user to specify custom IAM Role for AWS Organization discovery #26

Closed musayev-io closed 1 year ago

musayev-io commented 1 year ago

Issue: The script assumes into child accounts using the default OrganizationAccountAccessRole role name, which can cause issues if a user specifies a custom name for the role. As a result, there is a need to add a CLI argument to the script that allows for the role name to be overwritten.

Background: AWS Organizations creates a default IAM Role named OrganizationAccountAccessRole in each child account by default. This role is used to manage child accounts with a trust relationship to the root account. However, a user has the option to specify a custom name for this role. If a user specifies a custom name, scripts that use the default role name to assume into child accounts may fail.

Proposed Solution: To address this issue, we recommend adding a CLI argument to the script that allows the user to specify the role name to be used for assuming into child accounts. This would provide more flexibility and allow the script to be customized to work with different role names, regardless of whether the default or a custom name is used.

Additional Information: For more information about the OrganizationAccountAccessRole role and managing accounts in AWS Organizations, please refer to the AWS Organizations documentation: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html