Skip to content

Resource: awsDxHostedPublicVirtualInterfaceAccepter

Provides a resource to manage the accepter's side of a Direct Connect hosted public virtual interface. This resource accepts ownership of a public 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 dataAwsCallerIdentityAccepter =
  new aws.dataAwsCallerIdentity.DataAwsCallerIdentity(this, "accepter", {
    provider: `\${${awsAccepter.fqn}}`,
  });
const awsDxHostedPublicVirtualInterfaceCreator =
  new aws.dxHostedPublicVirtualInterface.DxHostedPublicVirtualInterface(
    this,
    "creator",
    {
      addressFamily: "ipv4",
      amazonAddress: "175.45.176.2/30",
      bgpAsn: 65352,
      connectionId: "dxcon-zzzzzzzz",
      customerAddress: "175.45.176.1/30",
      name: "vif-foo",
      ownerAccountId: dataAwsCallerIdentityAccepter.accountId,
      routeFilterPrefixes: ["210.52.109.0/24", "175.45.176.0/22"],
      vlan: 4094,
    }
  );
const awsDxHostedPublicVirtualInterfaceAccepterAccepter =
  new aws.dxHostedPublicVirtualInterfaceAccepter.DxHostedPublicVirtualInterfaceAccepter(
    this,
    "accepter_4",
    {
      provider: `\${${awsAccepter.fqn}}`,
      tags: {
        Side: "Accepter",
      },
      virtualInterfaceId: awsDxHostedPublicVirtualInterfaceCreator.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.*/
awsDxHostedPublicVirtualInterfaceAccepterAccepter.overrideLogicalId("accepter");

Argument Reference

The following arguments are supported:

  • virtualInterfaceId - (Required) The ID of the Direct Connect virtual interface to accept.
  • 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.

Removing awsDxHostedPublicVirtualInterfaceAccepter from your configuration

AWS allows a Direct Connect hosted public virtual interface to be deleted from either the allocator's or accepter's side. However, Terraform only allows the Direct Connect hosted public virtual interface to be deleted from the allocator's side by removing the corresponding awsDxHostedPublicVirtualInterface resource from your configuration. Removing a awsDxHostedPublicVirtualInterfaceAccepter 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 public virtual interfaces can be imported using the vifId, e.g.,

$ terraform import aws_dx_hosted_public_virtual_interface_accepter.test dxvif-33cc44dd