Giter VIP home page Giter VIP logo

tflocalstack's Introduction

.

cd tflocalstack
terraform init
terraform apply -var-file=./env_vars/dev.tfvars -auto-approve

./env_vars/dev.tfvars

project_name          = "dev"
az_count              = 2
pub_sub_per_az_count  = 1
priv_sub_per_az_count = 2

availability_zone_count : x
public_subnets_per_availability_zone : ?
private_subnets_per_availability_zone : ?

public_route_table_count : 1 (only one is needed)
private_route_table_count : x (for each az)

nat_gateway_count : x (1 in each az, inside the (first*)public subnet)

$ terraform output

is_localstack = true

vpc_id = "vpc-ae447d14"
nat_gws = [
  {
    "nat_gw__name" = "nat_gw_az_1"
    "nat_gw_id" = "nat-38000d035a250b0f5"
    "public_ip" = "127.82.136.144"
    "subnet_id" = "subnet-a8f86f5d" # ## ## ##
  },
  {
    "nat_gw__name" = "nat_gw_az_2"
    "nat_gw_id" = "nat-a54422f60fd7fec22"
    "public_ip" = "127.9.111.123"
    "subnet_id" = "subnet-711dc937" # $$ $$ $$
  },
]
pub_subs = [
  {
    "availability_zone" = "us-east-1a"
    "cidr" = "10.0.1.0/24"
    "subnet_id" = "subnet-a8f86f5d" # ## ## ##
    "subnet_name" = "public_subnet_1"
  },
  {
    "availability_zone" = "us-east-1b"
    "cidr" = "10.0.2.0/24"
    "subnet_id" = "subnet-711dc937" # $$ $$ $$
    "subnet_name" = "public_subnet_2"
  },
]
priv_subs = [
  {
    "availability_zone" = "us-east-1a"
    "cidr" = "10.0.11.0/24"
    "subnet_id" = "subnet-3a8db6a5"
    "subnet_name" = "private_subnet_1"
  },
  {
    "availability_zone" = "us-east-1b"
    "cidr" = "10.0.12.0/24"
    "subnet_id" = "subnet-a3b3dd79"
    "subnet_name" = "private_subnet_2"
  },
  {
    "availability_zone" = "us-east-1a"
    "cidr" = "10.0.13.0/24"
    "subnet_id" = "subnet-f9fa107f"
    "subnet_name" = "private_subnet_3"
  },
  {
    "availability_zone" = "us-east-1b"
    "cidr" = "10.0.14.0/24"
    "subnet_id" = "subnet-9dcad2df"
    "subnet_name" = "private_subnet_4"
  },
]
pub_route_tables = [
  {
    "public_table_id" = "rtb-e1a807ae"
    "public_table_name" = "public_route_table_1"
  },
]
priv_route_tables = [
  {
    "private_table_id" = "rtb-cade61e7"
    "private_table_name" = "private_route_table_1"
  },
  {
    "private_table_id" = "rtb-d1d0d9f9"
    "private_table_name" = "private_route_table_2"
  },
]

to-do:
1.change file structure
/envs/dev/main.tf
instead of running apply with the -var-file

2.figure a way to make security groups from a list
while referencing one another id's in the 'inbound rules'???

3.add web servers, databases, load balancers, auto scaling, route53???

https://github.com/antonbabenko/terraform-best-practices
https://docs.localstack.cloud/user-guide/integrations/terraform/
https://registry.terraform.io/browse/providers
https://spacelift.io/blog/terraform-aws-vpc
https://chat.openai.com/share/aa2511b5-6af5-4d25-8312-d0fe08fdd144
awslocal ec2 describe-nat-gateways
awslocal ec2 describe-vpcs
terraform apply -var-file=./env_vars/dev.tfvars -auto-approve
terraform destroy -auto-approve
terraform plan -var-file=./env_vars/dev.tfvars

tflocalstack's People

Contributors

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