Skip to content

Instantly share code, notes, and snippets.

@hiroki1117
Created December 3, 2020 06:22
Show Gist options
  • Save hiroki1117/88b815a26a1419db35a3b4d822ca2b29 to your computer and use it in GitHub Desktop.
Save hiroki1117/88b815a26a1419db35a3b4d822ca2b29 to your computer and use it in GitHub Desktop.
VPCピアリングで実験したやつ
provider "aws" {
region = "ap-northeast-1"
}
module "vpc_general" {
source = "terraform-aws-modules/vpc/aws"
name = "general_vpc"
cidr = "10.0.0.0/16"
azs = ["ap-northeast-1a", "ap-northeast-1c", "ap-northeast-1d"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
enable_nat_gateway = false
enable_vpn_gateway = true
tags = {
Terraform = "true"
Environment = "dev"
}
}
module "vpc_secondary" {
source = "terraform-aws-modules/vpc/aws"
name = "secondary_vpc"
cidr = "192.168.0.0/16"
azs = ["ap-northeast-1a"]
private_subnets = ["192.168.1.0/24"]
public_subnets = ["192.168.101.0/24"]
enable_nat_gateway = false
enable_vpn_gateway = true
tags = {
Terraform = "true"
Environment = "dev"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment