Skip to content
Permalink
04b798ecfd
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 17 lines (14 sloc) 903 Bytes
#!/bin/sh
[ $# -eq 0 ] && { echo "Usage: $0 name_of_idp "; exit 1; }
# call to create the saml provider in the AWS accounts
aws iam create-saml-provider --saml-metadata-document file://idp.xml --name $1 --profile=$2
if [ $? -ne 0 ]
then
echo "creation failed, read the readme and make sure you have an IAM role to perform this action"
exit 1
fi
# create iam roles that saml users can assume, currently administrator or readonly roles:
aws iam create-role --role-name administrator --assume-role-policy-document file://shibpolicy.json --profile=$2
aws iam attach-role-policy --role-name administrator --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --profile=$2
aws iam create-role --role-name readonly --assume-role-policy-document file://shibpolicy.json --profile=$2
aws iam attach-role-policy --role-name readonly --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --profile=$2