- Lead: Mircea Alexandru
- Sponsor: nearForm
Terraform deploy project.
Terraform configuration to create all required resources for running this project with distinct instances for each microservice on AWS.
If you're using this project, and need help, you can:
- Post a github issue,
- Tweet to @nodezoo,
- Ask on the Gitter.
This project is part of the NodeZoo org system. Please follow the link below for details on obtaining and running the complete system.
To install Terraform please check documentation site.
To run this project you need to set-up and AWS account and generate then security access keys from IAM.
Please follow documentation on site for more details.
To use the access key into project you can:
- enter their values each time you run a Terraform command and when you are prompted or
- create a
terraform.tfvars
with following content:
access_key = "....your access key....."
secret_key = "....your secret key....."
Be careful not to share these keys by committing the file.
In order to run command remotly and generate/install packages on remote instances you need to generate ssh keys. You can do that by running:
$ ssh-keygen -t rsa -C "nodezoo" -P '' -f ssh/nodezoo
In the keypairs.tf
file this key is set, so it can be used into the Terraform project. If you place your key in another folder or use another name please update the keypairs.tf
accordingly.
Run:
make setup
The project contains various files and their role is explained bellow:
The structure of the file is:
|-- ssh # Folder where ssh keys are placed
|-- 1.security.tf # Configuration for security resources including
# key pairs, security groups, a.s.o
|-- 2.network.tf # Configuration for network resources (load balancer)
|-- 3.servers-infrastructure.tf
# Configuration for infrastructure servers
# like redis, elasticsearch and mesh base
|-- 4.servers-app.tf # Configuration for instances with microservices running.
|-- keypairs.tf # Definition for keypairs used for SSH access on remote instances
|-- outputs.tf # Configuration for outputs variables to be displayed after
# a ```terraform apply``` command is successfully executed.
|-- variables.tf # Variables used by Terraform project. Here you can change the zone of
# deployment and also the instance types to be created by this project.
# Note that the size of the instances to be used are keeped at minimum.
# You can choose to use other instance types or AWS zone.
To verify the plan to be created by this project, after completing the above steps you can run
terraform plan
This command will verify/validate the configuration files and will present a plan to be created on AWS.
To create the plan simply run
terraform apply
This should create all resources and all should be working properly.
To destroy the resources you should run
terraform destroy
and respond yes when prompted.
This will destroy all resources create by this plan.
The main instances created by this plan are:
- VPC - Virtual Private Cloud
- Security
- Default security group - the security group used by default in the VPC
- Private security group - the security group used by microservice instances
- Network
- An Internet Gateway
- A sub-network
- A route table
- An Elastic IP for the WEB instance. This allows setting the fixed public IP for WEB instance.
- Infrastructure instances
- Elastic search instance
- Redis instance
- Mesh base instance
- Microservice instances
- WEB app
- NPM microservice
- GitHub microservice
- Coveralls microservice
- Travis microservice
- Updater microservice
- Dequeue microservice
- Info microservice
The NodeZoo org encourages open and safe participation.
If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.
Copyright (c) 2016, Mircea Alexandru and other contributors. Licensed under MIT.