terraform-aws-wordpress
terraform-aws-wordpress copied to clipboard
This is Terraform configuration to install and configure wordpress on AWS. March, 2019
What's this:
This is to set up wordpress using AWS infrastructure. We are using terraform to provision infrastructure. Code uses and creates following aws services.
- VPC and it's components
- Subnets, Route Tables, Internet Gateway, Nat Gateway.
- EC2 instance
- EIP for NAT Gateway
- RDS mysql instance.
- Security Groups to access both EC2 and MYSQL
Note:
You may get charged by aws for using services
Pre-requisite:
-
You need to have Ssh keys generated and should be put into
~/.ssh/
, if your machine is windows then feel free to use diff path and update the same in thessh_key
variable in thevars.tf
-
create an IAM user and create security credentials(AccessKey, SecretKey) and update in the
~/.aws/credentials
file like below
Note : if you have default profile, just erase the profile
attribute in provider.tf
Usage:
provisioning:
- git clone https://github.com/aleti-pavan/terraform-aws-wordpress.git
- cd terraform-aws-wordpress
- terraform init
- terraform plan
- terraform apply -auto-approve
Destroying the Infra:
- cd terraform-aws-wordpress (Be in the repo directory)
- terraform destroy -auto-approve
Change: (latest detail from top)
Code has been changed on 11th April, 2020. Code is now compatible with below versions.
Versions:
Terraform v0.12.24
- provider.aws v2.12.0
- provider.template v2.1.2
(Old) Code slightly changed on 31st May, 2019. I have added providers.tf with versions required for each provider