These are the input parameters for this template. All of these parameters must be supplied for this template to be deployed.
Name of the Toolshed Base CloudFormation Stack.
Launch Template Version
Launch Template Version
SSH Key Pair to be used on the application EC2 instances for emergency administrative access.
Get the latest Amazon Linux AMI ID from the SSM Parameter Store
Load Balancer Settings
The following tags are applied to all resources created by this template.
Metadata is mostly for organizing and presenting Parameters in a better way when using CloudFormation in the AWS Web UI.
This is the EC2 instance deployed by the template.
Create an autoscaling group to manage the toolshed EC2 instances
Create an EC2 Launch Template for toolshed hosts
Basic Updates
Install NFS bits
Make our shared WWW directory for the EFS to mount at
Add EFS volume to fstab and mount the volumes
Install and configure CloudWatch Logs
Overwrite default awscli.conf
Overwrite default awslogs.conf
Turn on awslogs
Install memcache and configure it
Install Python 3 and required modules
Python memcache module
Python Box SDK module
Create a log folder for boxsync
Logrotate for boxsync
Raise the limit on number of open files so boxsync doesn't run into problems with too many sockets open. UITSAPPDEV-2
Copy incommon certificates over for boxsync
Install PHP and required packages (this also installs httpd)
Un-comment NameVirtualHost in httpd.conf
Append some stuff to the end of httpd.conf
Deny access to all .svn and .git directories.
Setup symbolic links for httpd configs
Symbolic Link for cakephp CLI tool
Copy over php.ini file
Create PHP session cache directory and make sure the web server owns it.
Create the default php error log file just in case
Add InCommon certificate chain to openldap
Create a .gitconfig file
Copy git deployment private key out of SSM Parameter Store This should be a deploy-only key in prod, and read/write for nonprod. See src/ssh-parameter.py for loading SSH keys into the parameter store.
Replace sendmail with postfix
Start apache
Setup cron jobs
Sym-link the web root directory to the ec2-user home directory
Update the hostname and restart
This is the IAM role that will be applied to the EC2 Instance. Any AWS specific permissions that the node might need should be defined here.
This is just a little construct to connect a set of roles together into a profile. The profile is referenced by the EC2 Instance.
The load balancer (ALB) constructor along with the Security Group that allows client traffic to the ALB on ports 80 & 443
DNS name to point at the load balancer
Define the Target Group for adding Instances to the ALB as well as the health checks for those Instances
HTTP listener is defined via the lambda function for now since CloudFormation doesn't support redirection rules yet.
Output values that can be viewed from the AWS CloudFormation console.
Toolshed Application Hosts CloudFormation Deployment
This CloudFormation template will deploy two EC2 instances to act as the application hosts for the Toolshed service.
Important
There are many configuration files that must be loaded from the mounted NFS volume. If you are bootstrapping a new service and the NFS volume is empty, this deployment will fail the first time. Once the NFS volume has the required files in it this deployment will work.