Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 3.04 KB

beanstalk.md

File metadata and controls

62 lines (49 loc) · 3.04 KB

Set up by Beanstalk

Beanstalk is easy to deploy a simple app, but hard to integrate with other services and customize settings.

Basic

  1. Get into AWS Beanstalk
  2. Get Started
  3. Naming the sample application, choose PHP as our platform and start with Sample Application
  4. Click Configuration More Options
  5. Try choose Custom Configuration and click modify on each panel
  6. Read every field in each panel, try to understand the meaning, and how to control in free tier
  7. Choose back to Low Cost and click Create app
  8. Waiting for creating to finish, and access sample web page by subdomain.region.elasticbeanstalk.com.
  9. Follow AWS Quick Start to try and understand more.

Upgrade Instance

  • In beanstalk Configuration Page, Choose Instances to modify
  • Upgrade EC2 instance to t2.micro
    • free tier

      750 hours per month of Linux, RHEL, or SLES t2.micro instance usage

  • Set EBS (Amazon Elastic Block Storage) for your instance
    • free tier

      30 GB of Amazon Elastic Block Storage in any combination of General Purpose (SSD) or Magnetic, plus 2 million I/Os (with EBS Magnetic) and 1 GB of snapshot storage*

  • Try to connect ec2 instance by SSH
    • Set EC2 key pair
    • Set EC2 Key Pair in Beanstalk Configuration security section
    • Check port 22 open for public in EC2 security group and Network ACL

Auto Scaling

To add a Load Balancer, we have to enable load balancing

  • In beanstalk Configuration Page, Choose Capacity to modify
  • Change Type to Load Balanced, Follow step in docs: Environment Types
  • Setting for free tier
    • Instances max:1, min:1
    • Scaling Trigger aims to keep at least 1 healthy host

Add Load Balancer

  • In beanstalk Configuration Page, Choose Load balancer to modify
  • Create a Classic Load Balancer for free tier

RDS (SQL Database)

We don't want use Beanstalk integrated database because it's not for production useAdding a Database to Your Elastic Beanstalk Environment

  • Choose RDS Service
  • Create RDS SQL database, choose one Database Engine you like
    • 750 Hours per month of db.t2.micro database usage (applicable DB engines)
    • 20 GB of General Purpose (SSD) database storage
    • 20 GB of storage for database backups and DB Snapshots
  • Check Only enable options eligible for RDS Free Usage Tier
  • Set everything
  • Try to connect database from ec2
  • Write a simple app that could get query result from database and show on web page