Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafalwilinski/elastic-beanstalk-terraform-setup
🎬 Playbook for setting up & deploying AWS Beanstalk Applications on Docker with 1 command
https://github.com/rafalwilinski/elastic-beanstalk-terraform-setup
aws beanstalk deploy docker terraform
Last synced: 3 months ago
JSON representation
🎬 Playbook for setting up & deploying AWS Beanstalk Applications on Docker with 1 command
- Host: GitHub
- URL: https://github.com/rafalwilinski/elastic-beanstalk-terraform-setup
- Owner: RafalWilinski
- Created: 2017-03-16T21:46:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-19T09:29:09.000Z (about 3 years ago)
- Last Synced: 2024-10-23T10:09:15.034Z (3 months ago)
- Topics: aws, beanstalk, deploy, docker, terraform
- Language: HCL
- Homepage: https://dynobase.com
- Size: 11.7 KB
- Stars: 88
- Watchers: 3
- Forks: 32
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Elastic Beanstalk + Docker Deploy Setup
Purpose of this repo is to document and simplify deployment & setup process of Docker-based applications on AWS Elastic Beanstalk.
### Prerequisities
- AWS IAM Role with access to IAM, EC2, Beanstalk & Elastic Container Registry/Engine and it's access & secret keys. Profile must be set inside `~/.aws/credentials` directory.
- Terraform### Contents of repo
- ```Dockerrun.aws.json``` - AWS Beanstalk standard task definition. Tells Beanstalk which image from ECR it should use
- ```deploy.sh``` - script for deploying applications. App must be first set up
- ```*.tf``` files - Terraform infrastructure definition written in HCL (HashiCorp Configuration Language)
- ```clean.sh``` - script for cleaning temporary files### Setup
1. Run ```terraform plan -out plan.tfplan```
- Fill out Name, Description & environment
- Profile is name of your profile inside `~/.aws/credentials` file (Standard AWS way). Default profile is called `default`. You can insert many profiles inside `credentials` file.
2. Run ```terraform apply plan.tfplan``` - this may take up to 15 minutesAlternatively you can place variables inside `terraform.tfvars` file instead of pasting them into CLI input.
### Rollbacking setup
```
terraform destroy
```### Manual deployment
```
./deploy.sh
```
For example:
```
./deploy.sh my-app-name staging us-east-1 f0478bd7c2f584b41a49405c91a439ce9d944657
```If you don't have your AWS credentials set as ENV variables:
```
AWS_ACCOUNT_ID=XX677677XXXX \
AWS_ACCESS_KEY_ID=AKIAIXEXIX5JW5XM6XXX \
AWS_SECRET_ACCESS_KEY=XXXxmxxXlxxbA3vgOxxxxCk+uXXXXOrdmpC/oXxx \
./deploy.sh my-app-name staging us-east-1 f0478bd7c2f584b41a49405c91a439ce9d944657
```### Automatic deployment
Edit your `circle.yml` file to invoke `deploy.sh` script in `post.test` or `deploy` hook. Don't forget to fill out ENV variables in CircleCI setup.