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

Improve error handling in session tool, do not continue execution if a command has failed #44

Open
bjornrog opened this issue Sep 28, 2023 · 0 comments

Comments

@bjornrog
Copy link
Contributor

Example:

An error occurred (AccessDenied) when calling the CreateAccessKey operation: User: arn:aws:iam::115071183626:user/hmelby is not authorized to perform: iam:CreateAccessKey on resource: user nullhmelby with an explicit deny in an identity-based policy
Expecting value: line 2 column 1 (char 1)
Expecting value: line 2 column 1 (char 1)
ERROR: Unable to create valid credentials for profile awsops, unsafe to continue

This error was because the user lacked the iam:CreateAccessKey action in the policy.

If the user is missing iam:ListAccessKeys, the error is much “bigger” and gives the impression that we do not care about results and error checking.

At least all AWS CLI commands should be checked. Probably will not work to create a wrapper function for it, as we can not do exit in session tool, because that will exit the user from the current shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant