AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.1 published on Tuesday, Jun 21, 2022 by Pulumi

HostedPublicVirtualInterfaceAccepter

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var accepter = new Aws.Provider("accepter", new Aws.ProviderArgs
        {
        });
        // Accepter's credentials.
        var accepterCallerIdentity = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
        // Creator's side of the VIF
        var creator = new Aws.DirectConnect.HostedPublicVirtualInterface("creator", new Aws.DirectConnect.HostedPublicVirtualInterfaceArgs
        {
            ConnectionId = "dxcon-zzzzzzzz",
            OwnerAccountId = accepterCallerIdentity.Apply(accepterCallerIdentity => accepterCallerIdentity.AccountId),
            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.
        var accepterHostedPublicVirtualInterfaceAccepter = new Aws.DirectConnect.HostedPublicVirtualInterfaceAccepter("accepterHostedPublicVirtualInterfaceAccepter", new Aws.DirectConnect.HostedPublicVirtualInterfaceAccepterArgs
        {
            VirtualInterfaceId = creator.Id,
            Tags = 
            {
                { "Side", "Accepter" },
            },
        }, new CustomResourceOptions
        {
            Provider = aws.Accepter,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := providers.Newaws(ctx, "accepter", nil)
		if err != nil {
			return err
		}
		accepterCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)
		if err != nil {
			return err
		}
		creator, err := directconnect.NewHostedPublicVirtualInterface(ctx, "creator", &directconnect.HostedPublicVirtualInterfaceArgs{
			ConnectionId:    pulumi.String("dxcon-zzzzzzzz"),
			OwnerAccountId:  pulumi.String(accepterCallerIdentity.AccountId),
			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
		}
		_, err = directconnect.NewHostedPublicVirtualInterfaceAccepter(ctx, "accepterHostedPublicVirtualInterfaceAccepter", &directconnect.HostedPublicVirtualInterfaceAccepterArgs{
			VirtualInterfaceId: creator.ID(),
			Tags: pulumi.StringMap{
				"Side": pulumi.String("Accepter"),
			},
		}, pulumi.Provider(aws.Accepter))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import com.pulumi.resources.CustomResourceOptions;

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

    public static void stack(Context ctx) {
        var accepter = new Provider("accepter");

        final var accepterCallerIdentity = Output.of(AwsFunctions.getCallerIdentity());

        var creator = new HostedPublicVirtualInterface("creator", HostedPublicVirtualInterfaceArgs.builder()        
            .connectionId("dxcon-zzzzzzzz")
            .ownerAccountId(accepterCallerIdentity.apply(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
            .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());

        var accepterHostedPublicVirtualInterfaceAccepter = new HostedPublicVirtualInterfaceAccepter("accepterHostedPublicVirtualInterfaceAccepter", HostedPublicVirtualInterfaceAccepterArgs.builder()        
            .virtualInterfaceId(creator.id())
            .tags(Map.of("Side", "Accepter"))
            .build(), CustomResourceOptions.builder()
                .provider(aws.accepter())
                .build());

    }
}
import pulumi
import pulumi_aws as aws
import pulumi_pulumi as pulumi

accepter = pulumi.providers.Aws("accepter")
# Accepter's credentials.
accepter_caller_identity = aws.get_caller_identity()
# Creator's side of the VIF
creator = aws.directconnect.HostedPublicVirtualInterface("creator",
    connection_id="dxcon-zzzzzzzz",
    owner_account_id=accepter_caller_identity.account_id,
    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("accepterHostedPublicVirtualInterfaceAccepter",
    virtual_interface_id=creator.id,
    tags={
        "Side": "Accepter",
    },
    opts=pulumi.ResourceOptions(provider=aws["accepter"]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const accepter = new aws.Provider("accepter", {});
// Accepter's credentials.
const accepterCallerIdentity = aws.getCallerIdentity({});
// Creator's side of the VIF
const creator = new aws.directconnect.HostedPublicVirtualInterface("creator", {
    connectionId: "dxcon-zzzzzzzz",
    ownerAccountId: accepterCallerIdentity.then(accepterCallerIdentity => accepterCallerIdentity.accountId),
    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("accepterHostedPublicVirtualInterfaceAccepter", {
    virtualInterfaceId: creator.id,
    tags: {
        Side: "Accepter",
    },
}, {
    provider: aws.accepter,
});
resources:
  accepter:
    type: pulumi:providers:aws
  creator:
    type: aws:directconnect:HostedPublicVirtualInterface
    properties:
      connectionId: dxcon-zzzzzzzz
      ownerAccountId: ${accepterCallerIdentity.accountId}
      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
  accepterHostedPublicVirtualInterfaceAccepter:
    type: aws:directconnect:HostedPublicVirtualInterfaceAccepter
    properties:
      virtualInterfaceId: ${creator.id}
      tags:
        Side: Accepter
    options:
      provider: ${aws.accepter}
variables:
  accepterCallerIdentity:
    Fn::Invoke:
      Function: aws:getCallerIdentity
      Arguments: {}

Create a HostedPublicVirtualInterfaceAccepter Resource

new HostedPublicVirtualInterfaceAccepter(name: string, args: HostedPublicVirtualInterfaceAccepterArgs, opts?: CustomResourceOptions);
@overload
def HostedPublicVirtualInterfaceAccepter(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         tags: Optional[Mapping[str, str]] = None,
                                         virtual_interface_id: Optional[str] = None)
@overload
def HostedPublicVirtualInterfaceAccepter(resource_name: str,
                                         args: HostedPublicVirtualInterfaceAccepterArgs,
                                         opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args 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 string
The unique name of the resource.
args HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args HostedPublicVirtualInterfaceAccepterArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The HostedPublicVirtualInterfaceAccepter resource accepts the following input properties:

VirtualInterfaceId 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 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 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 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 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 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 .

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 .

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 .

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 .

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 .

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 .

Look up an 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)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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 .

VirtualInterfaceId 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 .

VirtualInterfaceId 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 .

virtualInterfaceId 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 .

virtualInterfaceId 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 .

virtual_interface_id 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 .

virtualInterfaceId String

The ID of the Direct Connect virtual interface to accept.

Import

Direct Connect hosted public virtual interfaces can be imported using the vif id, e.g.,

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

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.