Skip to content

Commit

Permalink
Merge pull request #26 from jackstockley89/update-collection-script
Browse files Browse the repository at this point in the history
feat: update to the collection script
  • Loading branch information
jackstockley89 authored Mar 3, 2022
2 parents fc6fe18 + a5c0012 commit c428d96
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions environment-collection.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!bin/bash
set -x
#set -x

properties=~/properties
devfile=.development.txt
Expand All @@ -13,7 +13,7 @@ cp $properties/laaopsproperties.txt $properties/.laaopsproperties
#collect a list of environments and place them in a text file
## DEV
aws-vault exec laa-development-lz -- aws ec2 describe-instances \
--filter "Name=tag:Name,Values=ccms-*" \
--filters Name=tag:Name,Values=ccms-* Name=instance-state-name,Values=running \
--query "Reservations [*].Instances[*].{Instance:PrivateIpAddress,AZ:Placement.AvailabilityZone,Name:Tags[?Key=='Name'].Value | [0]}" \
--output text > $properties/.development.txt

Expand Down Expand Up @@ -63,7 +63,7 @@ sed -i '' 's/pui.dev.appC=<INPUT>/pui.dev.appC='${output}'/g' $properties/.laaop

## TEST
aws-vault exec laa-test-lz -- aws ec2 describe-instances \
--filter "Name=tag:Name,Values=ccms-*" \
--filters Name=tag:Name,Values=ccms-* Name=instance-state-name,Values=running \
--query "Reservations [*].Instances[*].{Instance:PrivateIpAddress,AZ:Placement.AvailabilityZone,Name:Tags[?Key=='Name'].Value | [0]}" \
--output text > $properties/.testing.txt

Expand Down Expand Up @@ -113,7 +113,7 @@ sed -i '' 's/pui.test.appC=<INPUT>/pui.test.appC='${output}'/g' $properties/.laa

## PRE-PROD
aws-vault exec laa-staging-lz -- aws ec2 describe-instances \
--filter "Name=tag:Name,Values=ccms-*" \
--filters Name=tag:Name,Values=ccms-* Name=instance-state-name,Values=running \
--query "Reservations [*].Instances[*].{Instance:PrivateIpAddress,AZ:Placement.AvailabilityZone,Name:Tags[?Key=='Name'].Value | [0]}" \
--output text > $properties/.staging.txt

Expand Down Expand Up @@ -163,7 +163,7 @@ sed -i '' 's/pui.preprod.appC=<INPUT>/pui.preprod.appC='${output}'/g' $propertie

## PROD
aws-vault exec laa-production-lz -- aws ec2 describe-instances \
--filter "Name=tag:Name,Values=ccms-*" \
--filters Name=tag:Name,Values=ccms-* Name=instance-state-name,Values=running \
--query "Reservations [*].Instances[*].{Instance:PrivateIpAddress,AZ:Placement.AvailabilityZone,Name:Tags[?Key=='Name'].Value | [0]}" \
--output text > $properties/.production.txt

Expand Down

0 comments on commit c428d96

Please sign in to comment.