A Terraform module for creating a fully functional WordPress Droplet.
Defaults:
image
- The Droplet image ID or slug, defaults towordpress-18-04
name
- The name of the Droplet, defaults towordpress
region
- The region of the Droplet, defaults tonyc1
size
- The instance size, defaults to1gb
backups
- Boolean controlling if backups are made, defaults tofalse
monitoring
- Boolean controlling whether monitoring agent is installed, defaults tofalse
ipv6
- Boolean controlling if IPv6 is enabled, defaults tofalse
private_networking
- Boolean controlling if private networks are enabled, defaults tofalse
resize_disk
- Boolean controlling whether to increase the disk size when resizing a Droplet, defaults totrue
ip
- The public ipv4 address for the Droplet
Take a look at wordpress.tf for a working example.
Create a file with a .tf
extension, and add the following
module "wordpress" {
source = "alexandarp/wordpress/digitalocean"
version = "1.0.7"
name = "my-wordpress-droplet"
}
You can overwrite more default variables if you need to.
Initialize Terraform:
terraform init
Review your changes:
terraform plan
Apply your changes:
terraform apply -auto-approve
Output Droplet information:
terraform show
In order to start the wordpress installation, you will need to ssh into the instance. The credentials will be provided via e-mail.
When contributing to this repository, please first discuss the change you wish to make via a Github issue.