Skip to content

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

@bjornrog

Description

@bjornrog

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions