Skip to content

Instantly share code, notes, and snippets.

@mattmcla
Created October 14, 2018 01:15
Show Gist options
  • Save mattmcla/44f709bb2bb1131a70be2d4a78bf42ae to your computer and use it in GitHub Desktop.
Save mattmcla/44f709bb2bb1131a70be2d4a78bf42ae to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
APPSERVER_COUNT=$(aws ec2 describe-instances \
--region us-west-2 \
--filters "Name=tag:Environment,Values=production" "Name=tag:Name,Values=AppServer" "Name=instance-state-code,Values=16" \
| jq '.Reservations | length')
curl -k -d $APPSERVER_COUNT -X PUT https://127.0.0.1:8500/v1/kv/prod/cluster/appserver_count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment