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

AWS NAT Instance AMI no longer supported #192

Open
dleber opened this issue Jan 11, 2024 · 1 comment
Open

AWS NAT Instance AMI no longer supported #192

dleber opened this issue Jan 11, 2024 · 1 comment
Labels
bug 🐛 An issue with the system

Comments

@dleber
Copy link

dleber commented Jan 11, 2024

Describe the Bug

It seems AWS no longer offers a NAT instance AMI.

When nat_instance_enabled=true, it causes

Error: Your query returned no results. Please change your search criteria and try again.

which comes from data "aws_ami" "nat_instance" in nat-instance.tf.

According to this page, maintenance support ended 2023-12-01. They recommend using NAT gateways, or creating your own NAT instance AMI.

The nat_instance_ami_id parameter in the docs notes the phasing out of the AWS AMI.

Expected Behavior

Given this stems from AWS, the solution is probably to provide a clear error to the user if nat_instance_enabled = true and nat_instance_ami_id not specified. In other words, if users want to use NAT instances, they must provide their own AMIs.

Steps to Reproduce

module "subnets" {
  source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=0.39.8"

  namespace = var.default_namespace
  stage     = var.default_stage
  name      = var.default_name

  availability_zones  = slice(data.aws_availability_zones.available.names, 0, var.max_availability_zones)
  vpc_id              = module.vpc.vpc_id
  igw_id              = module.vpc.igw_id
  cidr_block          = module.vpc.vpc_cidr_block

  nat_gateway_enabled = false
  nat_instance_enabled = true
  nat_instance_type = "t3a.nano"
}

Screenshots

No response

Environment

No response

Additional Context

I'm using v 0.39.8 of the module. I've checked the latest code in data "aws_ami" "nat_instance" in nat-instance.tf and it appears it would have the same problem.

@dleber dleber added the bug 🐛 An issue with the system label Jan 11, 2024
@cannonkalra
Copy link

cannonkalra commented Jul 11, 2024

I've been trying to get this working with fck-nat AMI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

2 participants