Giter Club home page Giter Club logo

terraform-aws-fck-nat's People

Contributors

github-actions[bot] avatar kralizek avatar rajiska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terraform-aws-fck-nat's Issues

Attaching the same elastic IP not working

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?

Architecture

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?

Allow to use non-arm instances

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.

Current state?

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 =)

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.