Skip to content

Data Source: awsCustomerGateway

Get an existing AWS Customer Gateway.

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 awsVpnGatewayMain = new aws.vpnGateway.VpnGateway(this, "main", {
  amazonSideAsn: 7224,
  vpcId: "${aws_vpc.main.id}",
});
const dataAwsCustomerGatewayFoo =
  new aws.dataAwsCustomerGateway.DataAwsCustomerGateway(this, "foo", {
    filter: [
      {
        name: "tag:Name",
        values: ["foo-prod"],
      },
    ],
  });
new aws.vpnConnection.VpnConnection(this, "transit", {
  customerGatewayId: dataAwsCustomerGatewayFoo.id,
  staticRoutesOnly: false,
  type: dataAwsCustomerGatewayFoo.type,
  vpnGatewayId: awsVpnGatewayMain.id,
});

Argument Reference

The following arguments are supported:

  • id - (Optional) ID of the gateway.
  • filter - (Optional) One or more name-value pairs to filter by.

Attribute Reference

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

  • arn - ARN of the customer gateway.
  • bgpAsn - Gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
  • certificateArn - ARN for the customer gateway certificate.
  • deviceName - Name for the customer gateway device.
  • ipAddress - IP address of the gateway's Internet-routable external interface.
  • tags - Map of key-value pairs assigned to the gateway.
  • type - Type of customer gateway. The only type AWS supports at this time is "ipsec.1".

Timeouts

Configuration options:

  • read - (Default 20M)