Skip to content

flugel-it/workshop-live-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Live Infrastructure Example

Description

This code is used to deploy an AWS EC2 instance as well as an Amazon Virtual Private Cloud (VPC).

Requirements

These are the requirements for this module.

Terraform
>= 1.0.11
Terragrunt
>= 0.31.0

Setup

  1. Clone terraform modules repository at the top level directory
git clone [email protected]:flugel-it/workshop-live-infra.git
  1. Configure your environment with the correct AWS profile
export AWS_PROFILE=<profile name>
  1. Optional: Initialize each environment's resource you're going to work on
  • To initialize all the resources
./scripts/initialize.sh <environment> # environment: dev, staging
  • To initialize only one resource
cd <environment>/<resource>  # ex: dev/vpc
terragrunt init

Terragrunt takes care of creating the appropiate resources for tracking infrastructure state remotely.

  1. Review the changes to be applied
  • For the whole environment
cd <environment>/  # ex: dev/
terragrunt run-all plan
  • For only one resource
cd <environment>/<resource>  # ex: dev/vpc
terragrunt plan
  1. Apply your changes
  • For the whole environment
cd <environment>/  # ex: dev/
terragrunt run-all apply
  • For only one resource
cd <environment>/<resource>  # ex: dev/vpc
terragrunt apply

Region

The deploy region is configured on a per-environment basis, and loaded in the root terragrunt.hcl config on execution.

This region configuration is held in each environment directory's env.hcl file, and can be modified as follows:

// dev/env.hcl
// ...
locals {
  aws_region = "us-east-1"
  // ...
}
//...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •