Skip to content

Resource: awsEgressOnlyInternetGateway

[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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsVpcExample = new aws.vpc.Vpc(this, "example", {
  assignGeneratedIpv6CidrBlock: true,
  cidrBlock: "10.1.0.0/16",
});
const awsEgressOnlyInternetGatewayExample =
  new aws.egressOnlyInternetGateway.EgressOnlyInternetGateway(
    this,
    "example_1",
    {
      tags: {
        Name: "main",
      },
      vpcId: awsVpcExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsEgressOnlyInternetGatewayExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • vpcId - (Required) The VPC ID to create in.
  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the egress-only Internet gateway.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

Egress-only Internet gateways can be imported using the id, e.g.,

$ terraform import aws_egress_only_internet_gateway.example eigw-015e0e244e24dfe8a