1. Packages
  2. AWS
  3. API Docs
  4. directconnect
  5. HostedPublicVirtualInterfaceAccepter
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.directconnect.HostedPublicVirtualInterfaceAccepter

Explore with Pulumi AI

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const accepter = aws.getCallerIdentity({});
// Creator's side of the VIF
const creator = new aws.directconnect.HostedPublicVirtualInterface("creator", {
    connectionId: "dxcon-zzzzzzzz",
    ownerAccountId: accepter.then(accepter => accepter.accountId),
    name: "vif-foo",
    vlan: 4094,
    addressFamily: "ipv4",
    bgpAsn: 65352,
    customerAddress: "175.45.176.1/30",
    amazonAddress: "175.45.176.2/30",
    routeFilterPrefixes: [
        "210.52.109.0/24",
        "175.45.176.0/22",
    ],
});
// Accepter's side of the VIF.
const accepterHostedPublicVirtualInterfaceAccepter = new aws.directconnect.HostedPublicVirtualInterfaceAccepter("accepter", {
    virtualInterfaceId: creator.id,
    tags: {
        Side: "Accepter",
    },
});
Copy
import pulumi
import pulumi_aws as aws

accepter = aws.get_caller_identity()
# Creator's side of the VIF
creator = aws.directconnect.HostedPublicVirtualInterface("creator",
    connection_id="dxcon-zzzzzzzz",
    owner_account_id=accepter.account_id,
    name="vif-foo",
    vlan=4094,
    address_family="ipv4",
    bgp_asn=65352,
    customer_address="175.45.176.1/30",
    amazon_address="175.45.176.2/30",
    route_filter_prefixes=[
        "210.52.109.0/24",
        "175.45.176.0/22",
    ])
# Accepter's side of the VIF.
accepter_hosted_public_virtual_interface_accepter = aws.directconnect.HostedPublicVirtualInterfaceAccepter("accepter",
    virtual_interface_id=creator.id,
    tags={
        "Side": "Accepter",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		accepter, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
		if err != nil {
			return err
		}
		// Creator's side of the VIF
		creator, err := directconnect.NewHostedPublicVirtualInterface(ctx, "creator", &directconnect.HostedPublicVirtualInterfaceArgs{
			ConnectionId:    pulumi.String("dxcon-zzzzzzzz"),
			OwnerAccountId:  pulumi.String(accepter.AccountId),
			Name:            pulumi.String("vif-foo"),
			Vlan:            pulumi.Int(4094),
			AddressFamily:   pulumi.String("ipv4"),
			BgpAsn:          pulumi.Int(65352),
			CustomerAddress: pulumi.String("175.45.176.1/30"),
			AmazonAddress:   pulumi.String("175.45.176.2/30"),
			RouteFilterPrefixes: pulumi.StringArray{
				pulumi.String("210.52.109.0/24"),
				pulumi.String("175.45.176.0/22"),
			},
		})
		if err != nil {
			return err
		}
		// Accepter's side of the VIF.
		_, err = directconnect.NewHostedPublicVirtualInterfaceAccepter(ctx, "accepter", &directconnect.HostedPublicVirtualInterfaceAccepterArgs{
			VirtualInterfaceId: creator.ID(),
			Tags: pulumi.StringMap{
				"Side": pulumi.String("Accepter"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var accepter = Aws.GetCallerIdentity.Invoke();

    // Creator's side of the VIF
    var creator = new Aws.DirectConnect.HostedPublicVirtualInterface("creator", new()
    {
        ConnectionId = "dxcon-zzzzzzzz",
        OwnerAccountId = accepter.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
        Name = "vif-foo",
        Vlan = 4094,
        AddressFamily = "ipv4",
        BgpAsn = 65352,
        CustomerAddress = "175.45.176.1/30",
        AmazonAddress = "175.45.176.2/30",
        RouteFilterPrefixes = new[]
        {
            "210.52.109.0/24",
            "175.45.176.0/22",
        },
    });

    // Accepter's side of the VIF.
    var accepterHostedPublicVirtualInterfaceAccepter = new Aws.DirectConnect.HostedPublicVirtualInterfaceAccepter("accepter", new()
    {
        VirtualInterfaceId = creator.Id,
        Tags = 
        {
            { "Side", "Accepter" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.directconnect.HostedPublicVirtualInterface;
import com.pulumi.aws.directconnect.HostedPublicVirtualInterfaceArgs;
import com.pulumi.aws.directconnect.HostedPublicVirtualInterfaceAccepter;
import com.pulumi.aws.directconnect.HostedPublicVirtualInterfaceAccepterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var accepter = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
            .build());

        // Creator's side of the VIF
        var creator = new HostedPublicVirtualInterface("creator", HostedPublicVirtualInterfaceArgs.builder()
            .connectionId("dxcon-zzzzzzzz")
            .ownerAccountId(accepter.accountId())
            .name("vif-foo")
            .vlan(4094)
            .addressFamily("ipv4")
            .bgpAsn(65352)
            .customerAddress("175.45.176.1/30")
            .amazonAddress("175.45.176.2/30")
            .routeFilterPrefixes(            
                "210.52.109.0/24",
                "175.45.176.0/22")
            .build());

        // Accepter's side of the VIF.
        var accepterHostedPublicVirtualInterfaceAccepter = new HostedPublicVirtualInterfaceAccepter("accepterHostedPublicVirtualInterfaceAccepter", HostedPublicVirtualInterfaceAccepterArgs.builder()
            .virtualInterfaceId(creator.id())
            .tags(Map.of("Side", "Accepter"))
            .build());

    }
}
Copy
resources:
  # Creator's side of the VIF
  creator:
    type: aws:directconnect:HostedPublicVirtualInterface
    properties:
      connectionId: dxcon-zzzzzzzz
      ownerAccountId: ${accepter.accountId}
      name: vif-foo
      vlan: 4094
      addressFamily: ipv4
      bgpAsn: 65352
      customerAddress: 175.45.176.1/30
      amazonAddress: 175.45.176.2/30
      routeFilterPrefixes:
        - 210.52.109.0/24
        - 175.45.176.0/22
  # Accepter's side of the VIF.
  accepterHostedPublicVirtualInterfaceAccepter:
    type: aws:directconnect:HostedPublicVirtualInterfaceAccepter
    name: accepter
    properties:
      virtualInterfaceId: ${creator.id}
      tags:
        Side: Accepter
variables:
  accepter:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}
Copy

Create HostedPublicVirtualInterfaceAccepter Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new HostedPublicVirtualInterfaceAccepter(name: string, args: HostedPublicVirtualInterfaceAccepterArgs, opts?: CustomResourceOptions);
@overload
def HostedPublicVirtualInterfaceAccepter(resource_name: str,
                                         args: HostedPublicVirtualInterfaceAccepterArgs,
                                         opts: Optional[ResourceOptions] = None)

@overload
def HostedPublicVirtualInterfaceAccepter(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         virtual_interface_id: Optional[str] = None,
                                         tags: Optional[Mapping[str, str]] = None)
func NewHostedPublicVirtualInterfaceAccepter(ctx *Context, name string, args HostedPublicVirtualInterfaceAccepterArgs, opts ...ResourceOption) (*HostedPublicVirtualInterfaceAccepter, error)
public HostedPublicVirtualInterfaceAccepter(string name, HostedPublicVirtualInterfaceAccepterArgs args, CustomResourceOptions? opts = null)
public HostedPublicVirtualInterfaceAccepter(String name, HostedPublicVirtualInterfaceAccepterArgs args)
public HostedPublicVirtualInterfaceAccepter(String name, HostedPublicVirtualInterfaceAccepterArgs args, CustomResourceOptions options)
type: aws:directconnect:HostedPublicVirtualInterfaceAccepter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var hostedPublicVirtualInterfaceAccepterResource = new Aws.DirectConnect.HostedPublicVirtualInterfaceAccepter("hostedPublicVirtualInterfaceAccepterResource", new()
{
    VirtualInterfaceId = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := directconnect.NewHostedPublicVirtualInterfaceAccepter(ctx, "hostedPublicVirtualInterfaceAccepterResource", &directconnect.HostedPublicVirtualInterfaceAccepterArgs{
	VirtualInterfaceId: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var hostedPublicVirtualInterfaceAccepterResource = new HostedPublicVirtualInterfaceAccepter("hostedPublicVirtualInterfaceAccepterResource", HostedPublicVirtualInterfaceAccepterArgs.builder()
    .virtualInterfaceId("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
hosted_public_virtual_interface_accepter_resource = aws.directconnect.HostedPublicVirtualInterfaceAccepter("hostedPublicVirtualInterfaceAccepterResource",
    virtual_interface_id="string",
    tags={
        "string": "string",
    })
Copy
const hostedPublicVirtualInterfaceAccepterResource = new aws.directconnect.HostedPublicVirtualInterfaceAccepter("hostedPublicVirtualInterfaceAccepterResource", {
    virtualInterfaceId: "string",
    tags: {
        string: "string",
    },
});
Copy
type: aws:directconnect:HostedPublicVirtualInterfaceAccepter
properties:
    tags:
        string: string
    virtualInterfaceId: string
Copy

HostedPublicVirtualInterfaceAccepter Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The HostedPublicVirtualInterfaceAccepter resource accepts the following input properties:

VirtualInterfaceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Direct Connect virtual interface to accept.
Tags Dictionary<string, string>
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
VirtualInterfaceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Direct Connect virtual interface to accept.
Tags map[string]string
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtualInterfaceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Direct Connect virtual interface to accept.
tags Map<String,String>
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtualInterfaceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Direct Connect virtual interface to accept.
tags {[key: string]: string}
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtual_interface_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Direct Connect virtual interface to accept.
tags Mapping[str, str]
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtualInterfaceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Direct Connect virtual interface to accept.
tags Map<String>
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the HostedPublicVirtualInterfaceAccepter resource produces the following output properties:

Arn string
The ARN of the virtual interface.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
The ARN of the virtual interface.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The ARN of the virtual interface.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
The ARN of the virtual interface.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
The ARN of the virtual interface.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The ARN of the virtual interface.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing HostedPublicVirtualInterfaceAccepter Resource

Get an existing HostedPublicVirtualInterfaceAccepter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: HostedPublicVirtualInterfaceAccepterState, opts?: CustomResourceOptions): HostedPublicVirtualInterfaceAccepter
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        virtual_interface_id: Optional[str] = None) -> HostedPublicVirtualInterfaceAccepter
func GetHostedPublicVirtualInterfaceAccepter(ctx *Context, name string, id IDInput, state *HostedPublicVirtualInterfaceAccepterState, opts ...ResourceOption) (*HostedPublicVirtualInterfaceAccepter, error)
public static HostedPublicVirtualInterfaceAccepter Get(string name, Input<string> id, HostedPublicVirtualInterfaceAccepterState? state, CustomResourceOptions? opts = null)
public static HostedPublicVirtualInterfaceAccepter get(String name, Output<String> id, HostedPublicVirtualInterfaceAccepterState state, CustomResourceOptions options)
resources:  _:    type: aws:directconnect:HostedPublicVirtualInterfaceAccepter    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string
The ARN of the virtual interface.
Tags Dictionary<string, string>
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

VirtualInterfaceId Changes to this property will trigger replacement. string
The ID of the Direct Connect virtual interface to accept.
Arn string
The ARN of the virtual interface.
Tags map[string]string
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

VirtualInterfaceId Changes to this property will trigger replacement. string
The ID of the Direct Connect virtual interface to accept.
arn String
The ARN of the virtual interface.
tags Map<String,String>
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

virtualInterfaceId Changes to this property will trigger replacement. String
The ID of the Direct Connect virtual interface to accept.
arn string
The ARN of the virtual interface.
tags {[key: string]: string}
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

virtualInterfaceId Changes to this property will trigger replacement. string
The ID of the Direct Connect virtual interface to accept.
arn str
The ARN of the virtual interface.
tags Mapping[str, str]
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

virtual_interface_id Changes to this property will trigger replacement. str
The ID of the Direct Connect virtual interface to accept.
arn String
The ARN of the virtual interface.
tags Map<String>
A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

virtualInterfaceId Changes to this property will trigger replacement. String
The ID of the Direct Connect virtual interface to accept.

Import

Using pulumi import, import Direct Connect hosted public virtual interfaces using the VIF id. For example:

$ pulumi import aws:directconnect/hostedPublicVirtualInterfaceAccepter:HostedPublicVirtualInterfaceAccepter test dxvif-33cc44dd
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.