Skip to content

Resource: awsDxHostedPrivateVirtualInterfaceAccepter

Provides a resource to manage the accepter's side of a Direct Connect hosted private virtual interface. This resource accepts ownership of a private virtual interface created by another AWS account.

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";
new aws.provider.AwsProvider(this, "aws", {});
const awsAccepter = new aws.provider.AwsProvider(this, "aws_1", {
  alias: "accepter",
});
const awsVpnGatewayVpnGw = new aws.vpnGateway.VpnGateway(this, "vpn_gw", {
  provider: `\${${awsAccepter.fqn}}`,
});
const dataAwsCallerIdentityAccepter =
  new aws.dataAwsCallerIdentity.DataAwsCallerIdentity(this, "accepter", {
    provider: `\${${awsAccepter.fqn}}`,
  });
const awsDxHostedPrivateVirtualInterfaceCreator =
  new aws.dxHostedPrivateVirtualInterface.DxHostedPrivateVirtualInterface(
    this,
    "creator",
    {
      addressFamily: "ipv4",
      bgpAsn: 65352,
      connectionId: "dxcon-zzzzzzzz",
      depends_on: [`\${${awsVpnGatewayVpnGw.fqn}}`],
      name: "vif-foo",
      ownerAccountId: dataAwsCallerIdentityAccepter.accountId,
      vlan: 4094,
    }
  );
const awsDxHostedPrivateVirtualInterfaceAccepterAccepter =
  new aws.dxHostedPrivateVirtualInterfaceAccepter.DxHostedPrivateVirtualInterfaceAccepter(
    this,
    "accepter_5",
    {
      provider: `\${${awsAccepter.fqn}}`,
      tags: {
        Side: "Accepter",
      },
      virtualInterfaceId: awsDxHostedPrivateVirtualInterfaceCreator.id,
      vpnGatewayId: awsVpnGatewayVpnGw.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.*/
awsDxHostedPrivateVirtualInterfaceAccepterAccepter.overrideLogicalId(
  "accepter"
);

Argument Reference

The following arguments are supported:

  • virtualInterfaceId - (Required) The ID of the Direct Connect virtual interface to accept.
  • dxGatewayId - (Optional) The ID of the Direct Connect gateway to which to connect the virtual interface.
  • 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.
  • vpnGatewayId - (Optional) The ID of the virtual private gateway to which to connect the virtual interface.

Removing awsDxHostedPrivateVirtualInterfaceAccepter from your configuration

AWS allows a Direct Connect hosted private virtual interface to be deleted from either the allocator's or accepter's side. However, Terraform only allows the Direct Connect hosted private virtual interface to be deleted from the allocator's side by removing the corresponding awsDxHostedPrivateVirtualInterface resource from your configuration. Removing a awsDxHostedPrivateVirtualInterfaceAccepter resource from your configuration will remove it from your statefile and management, but will not delete the Direct Connect virtual interface.

Attributes Reference

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

  • id - The ID of the virtual interface.
  • arn - The ARN of the virtual interface.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Timeouts

Configuration options:

  • create - (Default 10M)
  • delete - (Default 10M)

Import

Direct Connect hosted private virtual interfaces can be imported using the vifId, e.g.,

$ terraform import aws_dx_hosted_private_virtual_interface_accepter.test dxvif-33cc44dd