#!/bin/bash

ROLE_NAME=$1

# Fake creds
export AWS_ACCESS_KEY_ID=foobar
export AWS_SECRET_ACCESS_KEY=foobar
export AWS_SESSION_TOKEN=foobar

if [[ "${ROLE_NAME}" = "" ]]; then
  echo "Must provide a role name argument: './local-create-role.sh <role_name>"
  exit 1
fi

aws --region us-east-1 --endpoint http://localhost:4566 iam create-role --role-name ${ROLE_NAME} --assume-role-policy-document '{}'