{"id":19968453,"url":"https://github.com/pecigonzalo/wordpress-aws","last_synced_at":"2026-05-09T19:03:42.723Z","repository":{"id":68773941,"uuid":"197297965","full_name":"pecigonzalo/wordpress-aws","owner":"pecigonzalo","description":"Demo repository of HA Wordpress deployment on AWS","archived":false,"fork":false,"pushed_at":"2019-07-17T03:31:26.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T17:48:22.842Z","etag":null,"topics":["aws","docker","wordpress"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pecigonzalo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-17T02:12:09.000Z","updated_at":"2019-07-17T03:31:28.000Z","dependencies_parsed_at":"2023-02-26T22:45:38.261Z","dependency_job_id":null,"html_url":"https://github.com/pecigonzalo/wordpress-aws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pecigonzalo/wordpress-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecigonzalo%2Fwordpress-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecigonzalo%2Fwordpress-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecigonzalo%2Fwordpress-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecigonzalo%2Fwordpress-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pecigonzalo","download_url":"https://codeload.github.com/pecigonzalo/wordpress-aws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecigonzalo%2Fwordpress-aws/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502492,"owners_count":23618619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","docker","wordpress"],"created_at":"2024-11-13T02:45:51.521Z","updated_at":"2026-05-09T19:03:37.696Z","avatar_url":"https://github.com/pecigonzalo.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wordpress AWS Demo Stack\n\nThis projects creates a demo Wordpress stack, its not meant to be production ready, but rather demo AWS and cloud technologies.\n\n### Architecture\n\n![diagram](https://cloudonaut.io/images/2016/10/wordpress-overview.png)\n\n## Instructions\n- Check and apply the `base` which will create base resources required for this\n- Configure required or desired variables in `local.auto.tfvars`\n- Run `make plan` and review the plan output\n- If plan looks correct, run `make apply`\n- Wait for the site to respond\n  - This might take a moment the first time the instances are bootstrapping\n- Get default credentials with `terraform output`\n- Site URL will be shown in the output, append `/wp-admin` to enter the admin interface\n- Remember to change your default WP credentials!\n- You can iterate over changes using `make replan` and `make reapply`\n- Use `make destroy` to destroy created resources\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|:----:|:-----:|:-----:|\n| chamber\\_key\\_arn | Chamber KMS Key ARN | string | n/a | yes |\n| chamber\\_key\\_id | Chamber KMS Key ID | string | n/a | yes |\n| internal\\_dns\\_zone\\_id | Input from ./base output | string | n/a | yes |\n| private\\_subnet\\_ids | Input from ./base output | list | n/a | yes |\n| public\\_subnet\\_ids | Input from ./base output | list | n/a | yes |\n| vpc\\_id | Input from ./base output | string | n/a | yes |\n| image\\_id | AMI ID to use | string | `\"ami-0c15064daa40f95b5\"` | no |\n| instance\\_type | The instance type to use, e.g t2.small | string | `\"t3.small\"` | no |\n| name | Name of this wordpress stack | string | `\"demo\"` | no |\n| ssh\\_key\\_name | The aws ssh key name. | string | `\"\"` | no |\n| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map | `\u003cmap\u003e` | no |\n| wordpress\\_admin\\_email | Wordpress Admin email | string | `\"null@null.com\"` | no |\n| wordpress\\_site\\_title | Wordpress Site default Title | string | `\"Demo Wordpress Site\"` | no |\n| wordpress\\_version | Wordpress Docker image version | string | `\"5.2\"` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| cf\\_dns\\_name | Cloudfront DNS Name |\n| lb\\_dns\\_name | Loadbalancer DNS Name |\n| wordpress\\_password | Wordpress password |\n| wordpress\\_url | Wordpress Site URL |\n| wordpress\\_user | Wordpress username |\n\n## Notes\n- Terraform is not configured with `remote-state`, if you wish to copy this to a production deployt, I recommend enabling that\n- You can install default plugins using the `wp-cli` in `user_data/bootstrap.sh`\n- SSM Is used a backend to store secrets and pass them to the container\n- Some of the `user_data/bootstrap.sh` logic could be baked in a Docker image, but this allows us to reuse the official Wordpress image as is\n- `wp-cli` can be used to further tweak and configure the initial deployment, installing plugins/etc\n- To ensure this can be easily reused, the setup uses `80` on the LB, but `443` and the default CloudFront certificate on its distribution. If you have a private domain, you can easily integrate your domain to this setup, change `user_data/bootstrap.sh` as documented and `cloudfront.tf` to use `HTTPS` while traffic is outside the VPC (Cloudfront -\u003e ALB)\n- Many settings have been set to a static value for this setup (cloudfront protocol targets, ports, timeouts, etc) this can be easily transformed to vars to reuse this code\n- This stack can be easily transfered to EKS/ECS-EC2/DockerSwarm/EB/etc\n\n## Tech Stack\n- Terraform\n- Cloud-Init\n- Chamber\n- AWS\n  - EC2 ASG\n  - CloudFront\n  - RDS - MySQL\n  - ALB\n  - VPC\n  - Subnets\n  - Security Groups\n  - SSM Parameter Store\n- Wordpress\n- Docker\n\n## References\n- https://d1.awsstatic.com/whitepapers/wordpress-best-practices-on-aws.pdf\n- https://cloudonaut.io/wordpress-on-aws-you-are-holding-it-wrong/\n- https://cloudonaut.io/wordpress-on-aws-smooth-and-pain-free/\n- https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/\n- Public modules ideas\n  - https://github.com/cloudposse\n  - https://github.com/terraform-aws-modules\n\n## License\n\nMIT (see [LICENSE](LICENSE))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecigonzalo%2Fwordpress-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpecigonzalo%2Fwordpress-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecigonzalo%2Fwordpress-aws/lists"}