Last active
February 7, 2019 03:44
-
-
Save matschaffer/36977dd7ee07d514934fcbb95b25589f to your computer and use it in GitHub Desktop.
A script for pulling an elasticbeanstalk solution name for a given runtime version
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
#!/usr/bin/env bash | |
set -euo pipefail | |
MINOR_VERSION=$(awk -F. '{print $1 "." $2}' $(dirname $0)/../.ruby-version) | |
NAME_FILTER="{\"Type\":\"PlatformName\",\"Operator\":\"begins_with\",\"Values\":[\"Puma with Ruby ${MINOR_VERSION}\"]}" | |
VERSION_FILTER='{"Type":"PlatformVersion","Operator":"=","Values":["latest"]}' | |
PLATFORM_ARN=$( | |
aws elasticbeanstalk list-platform-versions \ | |
--filters "[${NAME_FILTER},${VERSION_FILTER}]" \ | |
--query 'PlatformSummaryList[].PlatformArn' \ | |
--output text | |
) | |
aws elasticbeanstalk describe-platform-version \ | |
--platform-arn "${PLATFORM_ARN}" \ | |
--query PlatformDescription.SolutionStackName \ | |
--output text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment