This repository contains Terraform code that uses the AWS Provider to build an AWS EC2 instance using Docker Compose to launch WordPress.
- Local:
- Remote:
If you want to override the default variables in variables.tf, copy terraform.tfvars.sample to terraform.tfvars
and fill in your specific information.
- Initialize the Terraform directory (
.terraform/
) by runningterraform init
- Create the Terraform execution plan by running
terraform plan
- If everything looks correct, you can apply the Terraform changes by running
terraform apply
and typingyes
when prompted. - From your web browser, access the public_ip displayed from the successful terraform apply to finish configuring WordPress.
- If this is NOT production and you are finished testing, you can destroy the infrastructure by running
terraform destroy
and typingyes
when prompted.
cd rds
terraform init
terraform plan
terraform apply
- You can find your randomly generated RDS password encrypted in Systems Manager > Parameter Store.
- For HTTPS see Let's Encrypt with Docker
- The default AWS Security Group restricts SSH/HTTP/HTTPS to your ISP's address. You can change that in sg.tf
- This is by no means a production grade, high availability (HA) deployment of WordPress. To achieve that outcome, I would look at a reference architectures such as ECS or EKS and codify the additional Terraform resources.
- Thank you to ksatirli for the Terraform linting best practices.
This repository is maintained by Nick Adams.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, without WARRANTIES or conditions of any kind, either express or implied.
See the License for the specific language governing permissions and limitations under the License.