Skip to content

Commit

Permalink
Merge pull request #3 from iheartradio/debugging
Browse files Browse the repository at this point in the history
adding some debugging logs/outputs
  • Loading branch information
nhyne authored Nov 9, 2020
2 parents 162e8ae + 81b5846 commit cdd9248
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions assume_role.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ fi
ACCOUNT="$1"
ROLE="$2"

echo "Got account ID: $ACCOUNT and role: $ROLE"

role_session_name=`cat /proc/sys/kernel/random/uuid 2>/dev/null || date | cksum | cut -d " " -f 1`
aws_creds=$(aws sts assume-role --role-arn arn:aws:iam::${ACCOUNT}:role/$ROLE --role-session-name $role_session_name --duration-seconds 3600 --output json)

Expand Down
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,10 @@ output "id" {
value = null_resource.cli_resource.id
}

output "assumed_role" {
value = local.account_id
}
output "assumed_role_command" {
value = local.assume_role_cmd
}

0 comments on commit cdd9248

Please sign in to comment.