rajiska / terraform-aws-fck-nat Goto Github PK
View Code? Open in Web Editor NEWTerraform module for fck-nat
Home Page: https://registry.terraform.io/modules/RaJiska/fck-nat/aws/latest
License: MIT License
Terraform module for fck-nat
Home Page: https://registry.terraform.io/modules/RaJiska/fck-nat/aws/latest
License: MIT License
Hello and thank you for developing this module! I'm trying to pass eip_allocation_ids
so that the NAT instance always has the same public IP but it's not working. I don't see the elastic IPs being associated with the EC2 instances. Here's an example configuration:
resource "aws_eip" "nat" {
count = length(var.external_subnets)
vpc = true
}
module "fck-nat" {
count = length(var.external_subnets)
source = "RaJiska/fck-nat/aws"
version = "1.2.0"
name = "fck-nat-${count.index}"
vpc_id = aws_vpc.main.id
subnet_id = element(aws_subnet.external.*.id, count.index)
ami_id = "ami-00d653f185e930c04"
instance_type = "t4g.nano"
use_spot_instances = false
use_cloudwatch_agent = true
encryption = true
update_route_table = true
route_table_id = element(aws_route_table.internal.*.id, count.index)
ha_mode = true
eip_allocation_ids = [element(aws_eip.nat.*.id, count.index)]
}
I see that the allocation_id
is passed in the user data as eip_id=...
but for some reason it is not associated with the EC2 as it should be happening here. I tried viewing logs from inside the instance with aws ec2 get-console-output --instance-id ...
but didn't have much success as no logs were shown. I'm wondering whether I need to change my configuration to something like
resource "aws_eip" "nat" {
count = length(var.external_subnets)
vpc = true
network_interface = element(fck-nat.*.eni_id, count.index)
}
which would associate the Elastic IP with the Network Interface but then I'm not sure why this call should be made at all. As a matter of fact, I'm also wondering about those calls as well since the network interface is already attached to the EC2. Maybe there's no need to pass eni_id
and eip_id
if the infrastructure is already configured (eip and eni attached)? That would also remove the need for the IAM permissions.
Another eip related thing I'm wondering about is this one. Do you think that if eip_allocation_ids
is provided there's no need to create an ephemeral public network interface since there's already an elastic IP that will be associated with this instance?
@RaJiska, the repository shows use of multiple route tables using route_tables_id (what I wish to use), but the Terraform module is still using the deprecated version.
When will this be updated?
Hello, I'm new to nat instances.
Is the intention with this module, to have 1 module per subnet/AZ in a VPC?
I notice the variables for route table ID's and subnet id's are of type string, and not list. So im thinking i'd need one fck-nat per AZ?
For the HA option - is that HA in the single AZ?
Hi. I'm trying to run this module with t2.micro, and I can't use it b/c of the wrong (?) arm regex checker. I'm not a master of regex, but for me, it looks a little bit wrong. I was trying to use regex101 but found redundant backslashes.
[a-zA-Z]+\\d+g[a-z]*\\..+
should be [a-zA-Z]+\d+g[a-z]*\..+
╷
│ Error: Error in function call
│
│ on .terraform/modules/fck-nat/main.tf line 2, in locals:
│ 2: is_arm = regex("[a-zA-Z]+\\d+g[a-z]*\\..+", var.instance_type) == var.instance_type
│ ├────────────────
│ │ while calling regex(pattern, string)
│ │ var.instance_type is "t2.micro"
│
│ Call to function "regex" failed: pattern did not match any part of the given string.
Hi,
Thank you for this project. I arrived here from a link in a issue in the fck-nat repository.
I was wondering if this is ok to deploy or is it still at a development stage.
I'm not asking if it's production grade. I'm working on a personal project and the managed NAT cost is not sustainable. Most likely I'll switch back to the managed NAT by the time/if I hit production.
So I just need this to be stable enough not to think about it.
Thanks =)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.