Created
June 17, 2019 16:15
-
-
Save sjmcgrath/4ce7f91471e9c5a86ea4b6738427152b to your computer and use it in GitHub Desktop.
Retrieve the Role ARN for a/all AWS CodePipeline Pipelines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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