Resource: aws_egress_only_internet_gateway

[IPv6 only] Creates an egress-only Internet gateway for your VPC. An egress-only Internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the Internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.

Example Usage

resource "aws_vpc" "example" {
  cidr_block                       = "10.1.0.0/16"
  assign_generated_ipv6_cidr_block = true
}

resource "aws_egress_only_internet_gateway" "example" {
  vpc_id = aws_vpc.example.id

  tags = {
    Name = "main"
  }
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Egress-only Internet gateways using the id. For example:

import {
  to = aws_egress_only_internet_gateway.example
  id = "eigw-015e0e244e24dfe8a"
}

Using terraform import, import Egress-only Internet gateways using the id. For example:

% terraform import aws_egress_only_internet_gateway.example eigw-015e0e244e24dfe8a