User Tools

Site Tools


aws:bash-read-in-values

BASH read in values to script

#!/bin/bash
 
CONTROL_ID=$1
 
if [ -z ${CONTROL_ID} ]; then 
        echo "Please give control id as a parameter, eg ./check.sh IAM.x";
        exit 1
fi
 
 
echo "Set a profile with the AWS SSO:-"
echo "aws configure sso --use-device-code"
echo "profile name needs to be 'OrgDeployRole' "
 
read -p "Is this set (y / n)? " yn
case $yn in 
        y|yes ) echo "ok, using control:- ${CONTROL_ID}";;
        n|no )  echo "exiting... You need to set this up.";
        exit;;
        * ) echo invalid response;
        exit 1;;
esac
 
 
THIS_ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
aws/bash-read-in-values.txt · Last modified: by andrew

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki