Skip to content

Provision of resources needed for nodejs app created using molecular with the help of terraform scripts.

Notifications You must be signed in to change notification settings

nitheesb/Molecular-nodejs-app

Repository files navigation

Terraform Code for Deployment of Ec2 Instances

This script deployes 4 Ec2 instances,

  1. First for api server with publically exposed port(80) for api access with help of public subnet.
  2. Second Instance for Service#1 with private subnet.
  3. Third Instance for service#2 with private subnet.
  4. Fourth instance for Nats server.

Note: All four instances's port 80 is accesible by each other instances for communication between them.

To Run the script:

  1. Prerequisite

  2. Initialize our directory with terraform

    • From the caller-module directory run the command terraform init This will initialize the provider and download all the required modules.
  3. Validate the code

    • run command from the caller-module directory terraform validate This validates the configuration files in our directory.
  4. Plan

    • run command from the caller-module directory terraform plan The "terraform plan" is a command which is used to create an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files. This command is useful to check whether our execution plan matches our expectations without making any changes to real resources.
  5. Deployment

    • finally run the command from the caller-module directory terraform apply This will deploy all the resources which are defined in the script to the AWS account for which access keys were provided.

Note: Incase you would want to delete all created resources, terraform destroy will clean up all the resources created for you. Note: In Backend.tf mention the bucket to store terraform state files.

About

Provision of resources needed for nodejs app created using molecular with the help of terraform scripts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages