Skip to content

epomatti/aws-nat-instance

Repository files navigation

AWS NAT Instance

Debian NAT instance running on AWS.

Create the .auto.tfvars with the following:

# NAT instance
instance_type = "t4g.nano"
userdata      = "debian.sh"
ami           = "ami-0c758b376a9cf7862"

# Server
create_private_server = true
create_vpc_endpoints  = false

Apply your infrastructure:

terraform init
terraform apply -auto-approve

After creating the resources, confirm that the NAT instance has been set up correctly:

cloud-init status

ip link show
sysctl -ar ip_forward

Now set create_private_server = true and apply again.

To test it, connect to the private server using Sessions Manager.

If you wish to enable VPC endpoints, set the variable:

create_vpc_endpoints = true

To use another distro like Ubuntu, change the variables:

# NAT instance
instance_type = "t4g.nano"
userdata      = "ubuntu.sh"
ami           = "ami-05983a09f7dc1c18f"

Useful articles here and here.

Cohesive Networks

mkdir keys
ssh-keygen -f keys/vns3

https://docs.cohesive.net/docs/nate/

https://aws.amazon.com/marketplace/pp/prodview-wf7yma4f6mdw4 https://aws.amazon.com/marketplace/pp/prodview-beu27g23xt4ok

https://docs.cohesive.net/tutorials/getting-started/ https://docs.cohesive.net/docs/cloud-setup/aws/

https://docs.cohesive.net/docs/vns3/aws-features/