terraform-aws-fck-nat icon indicating copy to clipboard operation
terraform-aws-fck-nat copied to clipboard

Question: why two private IPv4 addresses?

Open madtechsupport opened this issue 2 months ago • 1 comments

Hi,

I've set up and am using fck-nat via the Terraform module. My module config looks like this:

  module "fck-nat" {
  source = "git::https://github.com/RaJiska/terraform-aws-fck-nat.git?ref=ab69ccf34629e49033f52c4e6351e188be7a1f8f"

  name      = "${local.label}-fck-nat"
  vpc_id    = aws_vpc.vpc.id
  subnet_id = aws_subnet.public_subnet01.id
  ha_mode   = false # Enables high-availability mode
  #  eip_allocation_ids = ["eipalloc-0137b6eb9d101f063"] # Allocation ID of an existing EIP / see https://github.com/RaJiska/terraform-aws-fck-nat/issues/5
  instance_type = var.instance_type

  update_route_tables = true
  route_tables_ids = {
    "private_rt" = aws_route_table.private_rt.id
  }

  tags = {
    Name = "${local.label}-fck-nat"
  }

  # To ensure proper ordering, add an explicit dependency on the Internet Gateway for the VPC.
  depends_on = [aws_internet_gateway.igw]
}

and I end up with two private IPv4 addresses against the instance:

image

and I'm not sure why. I don't think it's part of the AMI (tested by starting an instance with the AMI and I got only one private IPv4 address) and I've glanced (not studied) the module's Terraform config where it wasn't immediately obvious to me why two private IPv4 addresses are assigned.

Is there a reason why there are two IPv4 addresses assigned to the fck-nat instance when using the Terraform module?

Regards,

Warren.

madtechsupport avatar May 06 '24 20:05 madtechsupport