This repository contains the tools to create a WordPress deployment in an AWS environment.
Tools used:
- cloudformation-ruby-dsl - Used to manage the creation of CloudFormation templates
- berkshelf - berkshelf is used to manage the chef cookbook dependencies
- chef-client - chef-client (in local_mode) is used to converge the EC2 instance into the expected state (running httpd, PHP, MySQL, WordPress)
The expanded CloudFormation templates can be found in the expanded directory. These expanded templates are the output of the cloudformation-ruby-dsl and are ready for use.
Key | Type | Description | Default |
---|---|---|---|
Environment | string | What environment to deploy the CMS in | development |
Application | string | Which CMS to deploy | wordpress |
Hostname | string | What hostname to use for the CMS | dev.wordpress.andyboutte.com |
DBRootPassword | string | Password to use for root DB user | redacted |
DBCMSPassword | string | Password to use when creating initial DB user for the CMS | redacted |
CMSAdminPassword | string | Password to use when creating initial user in the CMS | redacted |
CMSAdminEmail | string | Email address to use when creating initial user in the CMS | redacted |
KeyName | string | SSH key name to use | redacted |
SSHLocation | string | Public IP of workstation location used at launch time | NA |
FrontendInstanceType | string | EC2 instance size to use | t2.small |
If development work is needed in the CloudFormation area go through this section.
- AWS credentials setup. Example using environment variables in
~/.bash_profile
:
export AWS_ACCESS_KEY_ID="xxxxxxxx"
export AWS_SECRET_ACCESS_KEY="xxxxxxxx"
- A sane Ruby environment setup on your workstation. The recommended approach would be to install the ChefDK
# Clone repo from GitHub
git clone https://github.com/andyboutte/cms-deployment.git
cd cms-deployment
gem install bundler
bundle install
cd applications/cms/
$ ./cms.rb
usage: ./cms.rb <expand|diff|validate|create|update|cancel-update|delete|describe|describe-resource|get-template>
bundle exec ./cms.rb create --region us-west-2 --stack-name wordpress-production-$(date '+%s') --disable-rollback --parameters "Application=wordpress;Environment=production;Hostname=wordpress.andyboutte.com"
bundle exec ./cms.rb expand --region us-west-2 --parameters "Application=wordpress;Environment=production;Hostname=wordpress.andyboutte.com" > expanded/us-west-2-production.json
bundle exec ./cms.rb expand --region us-east-1 --parameters "Application=wordpress;Environment=production;Hostname=wordpress.andyboutte.com" > expanded/us-east-1-production.json
bundle exec ./cms.rb expand --region us-west-2 --parameters "Application=wordpress;Environment=development;Hostname=dev.wordpress.andyboutte.com" > expanded/us-west-2-development.json
bundle exec ./cms.rb expand --region us-east-1 --parameters "Application=wordpress;Environment=development;Hostname=dev.wordpress.andyboutte.com" > expanded/us-east-1-development.json