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

Need a feature for getting IAM Role's trust policy alone in CLI. #8909

Closed
1 of 2 tasks
nrssutharsanan opened this issue Sep 10, 2024 · 7 comments
Closed
1 of 2 tasks
Assignees
Labels
closed-for-staleness feature-request A feature should be added or improved. iam p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@nrssutharsanan
Copy link

Describe the feature

Need a feature request for getting IAM Role's trust policy alone in CLI.
As of now we have to perform iam get-role CLI command and then manipulate to get the role's trust policy alone.
I feel its valuable to add a new feature / command to get role's trust policy alone.
Suggested code --
aws iam get-role-trust-policy --role-name <<your role name>> __

Use Case

This is required when we want to do some manipulations to the existing Trust policy and add new policies , since the CLI gives only the option to overwrite an existing policy.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

2.17.47

Environment details (OS name and version, etc.)

Windows/Linux,etc

@nrssutharsanan nrssutharsanan added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 10, 2024
@nrssutharsanan
Copy link
Author

Python/3.12.5 Linux/5.10.223-211.872.amzn2.x86_64 source/x86_64.alpine.3

@adev-code adev-code self-assigned this Sep 10, 2024
@adev-code adev-code added investigating This issue is being investigated and/or work is in progress to resolve the issue. iam p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 10, 2024
@adev-code
Copy link

Hi nrssutharsanan@, thanks for reaching out. As you have mentioned, the $ aws iam get-role --role-name already includes the Trust Policy. To isolate it, you could do Client side filtering ( https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-filter.html#cli-usage-filter-client-side ). An example command would be:
$ aws iam get-role --role-name --query 'Role.AssumeRolePolicyDocument'
Could you clarify why this doesn't work for your use case?
Thank you.

@adev-code adev-code added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Sep 11, 2024
@nrssutharsanan
Copy link
Author

Hey @adev-code --
Yes that does work, but whenever I want to update any Trust policy for a mass of accounts, I had to do an extra hop to getting this by running the above command and had to do some JQ modifications and then do an update trust policy.

So having to just get the Trust Policy alone , just like get managed policy etc , which even can be got in get-role, but still we do have separate command for.it, so similar ly if I have a separate command to fetch only the trust policy, it is better for me to go and do updates at scale.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 12, 2024
@adev-code
Copy link

Hi @nrssutharsanan, I have submitted a feature request to the IAM team to create an operation that gives the Trust Policy of the role. Please refer to an SDK or AWS CLI changelog (https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst) for updates about this going forward.
Please let me know if you have any other questions. Thanks!

@adev-code adev-code added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 12, 2024
@nrssutharsanan
Copy link
Author

Hey @adev-code , will this be solved by IAM team or can I solve as well ?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 13, 2024
@adev-code
Copy link

Hi @nrssutharsanan, the IAM team would provide updates on the SDK or AWS CLI changelog (https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst)
Please let me know if you have any other questions. Thanks!

@adev-code adev-code added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 13, 2024
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness feature-request A feature should be added or improved. iam p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants