Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

include check for aws executable in import_users #111

@packetfairy

Description

@packetfairy

Operating System: Linux
AWS CLI Version: aws-cli/1.11.13 Python/3.5.2 Linux/4.13.0-1006-gcp botocore/1.4.70

--

import_users.sh should include a check for aws executable, and exit if it fails to find it.

We replaced the apt supplied aws cli tool for a pip supplied tool today. The pip supplied tool was dropped into /usr/local/bin, which was not part of root's default PATH. When import_users.sh ran, it found no aws command, so iam_users was empty, which resulted in the removal of all local users. This was a difficult afternoon. :)

I've used this at the top of the file:

AWS=$(which aws)
if [ -z "${AWS}" ]; then
echo "aws executable not found - exiting!"
exit 1
fi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions