Module for deploying a Ghost blog to AWS
The defaults will deploy an fully featured deployment of Ghost, where all components are covered under the first 12 months of the AWS free-tier.
This includes:
- A VPC with a public and private subnets
- EC2 Instance running Flatcar Linux (
t2
/t3.micro
)- Configuration to run Ghost and Nginx Docker containers
- EBS persistent volume
- Security groups to prevent direct access to the instance
- A separate RDS instance to host the database (
db.
(t4g
/t3
/t2
).micro
) - A Cloudfront CDN
- ACM certificates for TLS
Some additional configuration is required after running the module. The details are given as outputs. You can either enter these into your DNS provider manually, or use this module in a larger terraform deployment that creates the DNS records.
Name | Version |
---|---|
terraform | ~> 1.0 |
aws | ~> 5.0 |
ct | ~> 0.13.0 |
template | ~> 2.0 |
Name | Version |
---|---|
aws | 5.36.0 |
aws.global | 5.36.0 |
ct | 0.13.0 |
template | 2.2.0 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
admin_ip | IP address with subnet mask (ideally /32 ) of admin to allow direct access to the instance. Only creates security group rule if set. |
string |
null |
no |
aws_region | AWS Region to use for running the machine | string |
n/a | yes |
cached_paths | Paths which should be cached for all clients. | list(string) |
[ |
no |
db_password | The password for accessing the database. It is recommended to pass this as an environment variable, e.g. TF_VAR_db_password . |
string |
n/a | yes |
deployment_name | Name used for the deployment. | string |
"ghost" |
no |
domain_name | The fully qualified domain name used to access the website. Does not require a protocol prefix. | string |
n/a | yes |
ghost_extra_env_vars | A map of k/v pairs to add as additional environment variables for the Ghost container. See https://ghost.org/docs/config/ | map(string) |
{} |
no |
ghost_image | The image of Ghost to run. | string |
n/a | yes |
instance_type | Instance type for the machine. If unset, a free-tier instance will be used. | string |
null |
no |
private_cidrs | List of CIDRs to use for private subnets. | list(string) |
[ |
no |
public_cidrs | List of CIDRs to use for public subnets. | list(string) |
[ |
no |
ssh_keys | SSH public keys for user 'core' | list(string) |
n/a | yes |
uncached_paths | Paths which should not be cached. | list(string) |
[ |
no |
vpc_cidr | The CIDR block for the VPC. | string |
"10.0.0.0/16" |
no |
Name | Description |
---|---|
dns_acm_validation_records | Record(s) required by ACM to validate TLS certificates. |
dns_cloudfront_record | Record required to point domain at the CDN. Use an ALIAS record if the domain_name is the apex, otherwise use a CNAME. |
ec2_connection_details | Use the following to connect to the EC2 instance as admin. |