Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example for NAT_gateway provisioning #485

Open
ayon0110 opened this issue May 30, 2016 · 1 comment
Open

example for NAT_gateway provisioning #485

ayon0110 opened this issue May 30, 2016 · 1 comment

Comments

@ayon0110
Copy link

this is ideally not an issue.
sorry, am no developer; so was wondering if one could present an example for launching a NAT gateway within a public subnet in a VPC similar to multiple others that have been presented in docs/examples.

Thank you.

@JeroenAP
Copy link

JeroenAP commented Dec 20, 2016

I think it might be something like this:

aws_vpc 'production-vpc' do
  cidr_block '10.0.0.0/16'
  internet_gateway true
  main_routes '0.0.0.0/0' => :internet_gateway
  aws_tags({'Name' => 'production-vpc', 'Company' => 'company'})
end

aws_subnet 'public-subnet-a' do
  vpc 'production-vpc'
  cidr_block '10.0.0.0/24'
  availability_zone 'eu-west-1a'
  map_public_ip_on_launch false
end

aws_subnet 'public-subnet-b' do
  vpc 'production-vpc'
  cidr_block '10.0.1.0/24'
  availability_zone 'eu-west-1b'
  map_public_ip_on_launch false
end


aws_subnet 'private-subnet-a' do
  vpc 'production-vpc'
  cidr_block '10.0.2.0/24'
  availability_zone 'eu-west-1a'
  map_public_ip_on_launch false
end

aws_subnet 'private-subnet-b' do
  vpc 'production-vpc'
  cidr_block '10.0.3.0/24'
  availability_zone 'eu-west-1b'
  map_public_ip_on_launch false
end

aws_eip_address 'eip-nat-gateway'

aws_nat_gateway 'nat-gateway' do
  vpc 'production-vpc'
  subnet 'subnet-a'
  eip_address 'eip-nat-gateway'
end

aws_route_table 'public-route-table' do
  vpc 'production-vpc'
  routes '0.0.0.0/0' => :internet_gateway
end

aws_route_table 'private-route-table' do
  vpc 'production-vpc'
  routes '0.0.0.0/0' => :nat_gateway
end

Maybe someone can check this and add corrections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants