HostedPublicVirtualInterfaceAccepter class

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",
    },
});
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",
    })
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" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v7/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().ToIDOutput().ToStringOutput(),
			Tags: pulumi.StringMap{
				"Side": pulumi.String("Accepter"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_getcalleridentity" "accepter" {
}

# Creator's side of the VIF
resource "aws_directconnect_hostedpublicvirtualinterface" "creator" {
  connection_id         = "dxcon-zzzzzzzz"
  owner_account_id      = data.aws_getcalleridentity.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.
resource "aws_directconnect_hostedpublicvirtualinterfaceaccepter" "accepter" {
  virtual_interface_id = aws_directconnect_hostedpublicvirtualinterface.creator.id
  tags = {
    "Side" = "Accepter"
  }
}
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.ArrayList;
import java.util.Arrays;
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());

    }
}
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: {}

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

Constructors

HostedPublicVirtualInterfaceAccepter(String name, {HostedPublicVirtualInterfaceAccepterArgs? args, CustomResourceOptions? options})
Creates a new HostedPublicVirtualInterfaceAccepter. name The Pulumi resource name. args Arguments used to configure this HostedPublicVirtualInterfaceAccepter. The set of arguments for HostedPublicVirtualInterfaceAccepter. options Resource options controlling this resource's behavior.
HostedPublicVirtualInterfaceAccepter.reference(String urn)
Creates a typed reference to an existing HostedPublicVirtualInterfaceAccepter resource.

Properties

arn ↔ Output<String>
The ARN of the virtual interface.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
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.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
virtualInterfaceId ↔ Output<String>
The ID of the Direct Connect virtual interface to accept.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {HostedPublicVirtualInterfaceAccepterState? state, CustomResourceOptions? options}) → HostedPublicVirtualInterfaceAccepter
Gets an existing HostedPublicVirtualInterfaceAccepter resource's state with the given name and id.