Code Monkey home page Code Monkey logo

wp-docker-demo's Introduction

Terraform AWS EC2 for Docker Compose

This repository contains Terraform code that uses the AWS Provider to build an AWS EC2 instance using Docker Compose to launch WordPress.

Table of Contents

Tools

Usage

If you want to override the default variables in variables.tf, copy terraform.tfvars.sample to terraform.tfvars and fill in your specific information.

  1. Initialize the Terraform directory (.terraform/) by running terraform init
  2. Create the Terraform execution plan by running terraform plan
  3. If everything looks correct, you can apply the Terraform changes by running terraform apply and typing yes when prompted.
  4. From your web browser, access the public_ip displayed from the successful terraform apply to finish configuring WordPress.
  5. If this is NOT production and you are finished testing, you can destroy the infrastructure by running terraform destroy and typing yes when prompted.

Optional - RDS Multi-AZ MySQL

  1. cd rds
  2. terraform init
  3. terraform plan
  4. terraform apply
  5. You can find your randomly generated RDS password encrypted in Systems Manager > Parameter Store.

Notes

  • 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.

Author Information

This repository is maintained by Nick Adams.

License

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.

wp-docker-demo's People

Contributors

nickkadams avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.