Skip to content

Instantly share code, notes, and snippets.

@sjmcgrath
Created June 17, 2019 16:15
Show Gist options
  • Save sjmcgrath/4ce7f91471e9c5a86ea4b6738427152b to your computer and use it in GitHub Desktop.
Save sjmcgrath/4ce7f91471e9c5a86ea4b6738427152b to your computer and use it in GitHub Desktop.
Retrieve the Role ARN for a/all AWS CodePipeline Pipelines
#!/bin/bash
if [[ $# -eq 1 ]]
then
aws codepipeline get-pipeline \
--name "${1}" \
--query pipeline.roleArn \
--output text
else
for pipeline in $( aws codepipeline list-pipelines --query 'pipelines[].name' --output text )
do
aws codepipeline get-pipeline \
--name "${pipeline}" \
--query '[pipeline.name, pipeline.roleArn]' \
--output text
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment