Skip to content

Data Source: awsVpnGateway

The VPN Gateway data source provides details about a specific VPN gateway.

Example Usage

import * as cdktf from "cdktf";
/*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 dataAwsVpnGatewaySelected = new aws.dataAwsVpnGateway.DataAwsVpnGateway(
  this,
  "selected",
  {
    filter: [
      {
        name: "tag:Name",
        values: ["vpn-gw"],
      },
    ],
  }
);
new cdktf.TerraformOutput(this, "vpn_gateway_id", {
  value: dataAwsVpnGatewaySelected.id,
});

Argument Reference

The arguments of this data source act as filters for querying the available VPN gateways. The given filters must match exactly one VPN gateway whose data will be exported as attributes.

  • id - (Optional) ID of the specific VPN Gateway to retrieve.

  • state - (Optional) State of the specific VPN Gateway to retrieve.

  • availabilityZone - (Optional) Availability Zone of the specific VPN Gateway to retrieve.

  • attachedVpcId - (Optional) ID of a VPC attached to the specific VPN Gateway to retrieve.

  • filter - (Optional) Custom filter block as described below.

  • tags - (Optional) Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.

  • amazonSideAsn - (Optional) Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

  • name - (Required) Name of the field to filter by, as defined by the underlying AWS API.

  • values - (Required) Set of values that are accepted for the given field. A VPN Gateway will be selected if any one of the given values matches.

Attributes Reference

All of the argument attributes are also exported as result attributes.

Timeouts

Configuration options:

  • read - (Default 20M)