diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e3834c..03fcf95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,35 +1,42 @@ # Versions -* v1.0.0 +## Version 1.x + +* 1.0.0 - tag initial release for tf 0.11 -* v2.0.0 +## Version 2.x + +* 2.0.0 - for tf-0.12 support -* v2.0.1 +* 2.0.1 - add create_access_key variable, but do not implement - format - change saml_role to list -* v2.0.2 +* 2.0.2 - do not include groups if groups empty - add ```service_account``` variable (true|false) - if service account, use contact vs user -* v2.1 +* 2.1 - add pre-commit to generate docs -* v2.2 +* 2.2 - add enable_sending_mail to enable email address in SES (this generates a request to the user) -* v2.3 +* 2.3 - change default for enable_sending_mail to false -* v2.4.0 -- 20210405 +* 2.4.0 -- 20210405 - use `ldap-get-attribute` to get email address -* v2.5.0 -- 20210512 +* 2.5.0 -- 20210512 - add `attached_policies` to enable adding policies for an IAM account (generally, just services) -* v2.5.1 -- 20210526 +* 2.5.1 -- 20210526 - change computing of output of user_password + +* 2.6.0 -- 2022-05-20 + - update bin/show-user-info.sh to accept TFCOMMAND for an alternate terraform binary, or to pull from the git root file diff --git a/bin/show-user-info.sh b/bin/show-user-info.sh index dbc7da6..360706e 100755 --- a/bin/show-user-info.sh +++ b/bin/show-user-info.sh @@ -1,5 +1,15 @@ #!/bin/bash +get_git_root() +{ + TOP=$(git rev-parse --show-toplevel 2>/dev/null) + if [ -z "$TOP" ] + then + TOP=$HOME + fi +} + +VERSION="1.1.0" if [ ! -x /usr/bin/jq ] then echo "* no 'jq' program installed, cannot execute" @@ -19,7 +29,44 @@ fi VARS="user_name user_arn user_password" declare -A values -jsondata=$(terraform output -json $MODULE) +# path or name of terraform binary +# get from top of git repo or $HOME/.tf-control +get_git_root +if [ -z "$TFCONTROL" ] +then + if [ -r $TOP/.tf-control ] + then + TFCONTROL=$TOP/.tf-control + elif [ -r $HOME/.tf-control ] + then + TFCONTROL=$HOME/.tf-control + fi +fi +if [ ! -z "$TFCONTROL" ] +then + source $TFCONTROL +fi + +if [ -z $TFCOMMAND ] +then + TFCOMMAND="terraform" +fi + +# look for config file +if [ -z "$TF_CLI_CONFIG_FILE" ] +then + if [ -r $TOP/.tf-control.tfrc ] + then + export TF_CLI_CONFIG_FILE=$TOP/.tf-control.tfrc + elif [ -r $HOME/.tf-control.tfrc ] + then + export TF_CLI_CONFIG_FILE=$HOME/.tf-control.tfrc + else + unset TF_CLI_CONFIG_FILE + fi +fi + +jsondata=$($TERRAFORM output -json $MODULE) echo "# $(date +%Y%m%d)" for k in $VARS do diff --git a/version.tf b/version.tf index 5624ad5..b061df5 100644 --- a/version.tf +++ b/version.tf @@ -1,3 +1,3 @@ locals { - _module_version = "2.5.1" + _module_version = "2.6.0" }