/ mozey.co / blog

typical aws web application

December 1, 2015

🔗 Typical web application

🔗 5 AWS mistakes you should avoid

🔗 managing infrastructure manually

Use AWS CloudFormation to describe resources (EC2 instance, security groups, subnets, etc) in a template.

Typical web app CloudFormation template

🔗 not using Auto Scaling Groups

Auto scaling is achieved by setting alarms on metrics, like CPU usage or number of requests the load balancer received, if the alarm threshold is reached you can define an action like increase the number of machines in the group.

🔗 not analyzing metrics in CloudWatch

The second step, once you analyzed your metrics is to define alarms on them. Not the other way around!

🔗 ignoring Trusted Adviser

Check AWS account for best practices

🔗 underutilizing virtual machines

Use auto scaling groups to scale up or down.

🔗 Sync your AWS SecurityGroups with DynDNS for SSH security

if [ "$(dig +short myhome.domain.org)" != "$(cat /tmp/dynip.txt)" ];
        echo "Updating security group."
        aws ec2 revoke-security-group-ingress --group-id sg-8af907ef --protocol tcp --port 22 --cidr `cat /tmp/dynip.txt`/32
        aws ec2 authorize-security-group-ingress --group-id sg-8af907ef --protocol tcp --port 22 --cidr `dig +short myhome.domain.org`/32
        dig +short myhome.domain.org>/tmp/dynip.txt
        echo $(date) "Nothing to change"