Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
Is CloudFormation considered coding? If so, I code a lot!

Christian Dechery cdechery

👀
Is CloudFormation considered coding? If so, I code a lot!
View GitHub Profile
@cdechery
cdechery / envinspect.config
Created May 16, 2018
Retreive Beanstalk Application name from within EC2 instance
View envinspect.config
packages:
yum:
jq: []
container_commands:
01-getenv-info:
command: |
ENV_ID=`{"Ref": "AWSEBEnvironmentId" }`
ENV_NAME=`{"Ref": "AWSEBEnvironmentName" }`
echo "env.id="$ENV_ID > /tmp/awseb.properties
@cdechery
cdechery / s3edit.sh
Created May 16, 2018
Edit text files on S3
View s3edit.sh
#!/bin/sh
set -e
FILE=$(basename $1)
aws s3 cp "s3:/"$1 .
nano $FILE
read -p "Atualizar no S3? [s/n] " -n 1 -r
@cdechery
cdechery / get_ebenvs_ips.sh
Created Nov 17, 2017
A simple shell script that obtains de IP from all the instances of ElasticBeanstalk apps/envs and adds them to the /etc/hosts of a server.
View get_ebenvs_ips.sh
#!/bin/sh
####################################################
# por: Christian Dechery
# objetivo: obtem os enderecos IP de todas as instancias de aplicacoes
# rodando no ElasticBeanstalk
###################################################
envs=("tecvirt" "hmlg" "mock" "hmlg2" "prod")
cat base_hosts > new_hosts