aws.directconnect.HostedPrivateVirtualInterfaceAccepter
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const accepter = aws.getCallerIdentity({});
// Accepter's side of the VIF.
const vpnGw = new aws.ec2.VpnGateway("vpn_gw", {});
// Creator's side of the VIF
const creator = new aws.directconnect.HostedPrivateVirtualInterface("creator", {
connectionId: "dxcon-zzzzzzzz",
ownerAccountId: accepter.then(accepter => accepter.accountId),
name: "vif-foo",
vlan: 4094,
addressFamily: "ipv4",
bgpAsn: 65352,
}, {
dependsOn: [vpnGw],
});
const accepterHostedPrivateVirtualInterfaceAccepter = new aws.directconnect.HostedPrivateVirtualInterfaceAccepter("accepter", {
virtualInterfaceId: creator.id,
vpnGatewayId: vpnGw.id,
tags: {
Side: "Accepter",
},
});
import pulumi
import pulumi_aws as aws
accepter = aws.get_caller_identity()
# Accepter's side of the VIF.
vpn_gw = aws.ec2.VpnGateway("vpn_gw")
# Creator's side of the VIF
creator = aws.directconnect.HostedPrivateVirtualInterface("creator",
connection_id="dxcon-zzzzzzzz",
owner_account_id=accepter.account_id,
name="vif-foo",
vlan=4094,
address_family="ipv4",
bgp_asn=65352,
opts = pulumi.ResourceOptions(depends_on=[vpn_gw]))
accepter_hosted_private_virtual_interface_accepter = aws.directconnect.HostedPrivateVirtualInterfaceAccepter("accepter",
virtual_interface_id=creator.id,
vpn_gateway_id=vpn_gw.id,
tags={
"Side": "Accepter",
})
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-aws/sdk/v6/go/aws/ec2"
"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
}
// Accepter's side of the VIF.
vpnGw, err := ec2.NewVpnGateway(ctx, "vpn_gw", nil)
if err != nil {
return err
}
// Creator's side of the VIF
creator, err := directconnect.NewHostedPrivateVirtualInterface(ctx, "creator", &directconnect.HostedPrivateVirtualInterfaceArgs{
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),
}, pulumi.DependsOn([]pulumi.Resource{
vpnGw,
}))
if err != nil {
return err
}
_, err = directconnect.NewHostedPrivateVirtualInterfaceAccepter(ctx, "accepter", &directconnect.HostedPrivateVirtualInterfaceAccepterArgs{
VirtualInterfaceId: creator.ID(),
VpnGatewayId: vpnGw.ID(),
Tags: pulumi.StringMap{
"Side": pulumi.String("Accepter"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var accepter = Aws.GetCallerIdentity.Invoke();
// Accepter's side of the VIF.
var vpnGw = new Aws.Ec2.VpnGateway("vpn_gw");
// Creator's side of the VIF
var creator = new Aws.DirectConnect.HostedPrivateVirtualInterface("creator", new()
{
ConnectionId = "dxcon-zzzzzzzz",
OwnerAccountId = accepter.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
Name = "vif-foo",
Vlan = 4094,
AddressFamily = "ipv4",
BgpAsn = 65352,
}, new CustomResourceOptions
{
DependsOn =
{
vpnGw,
},
});
var accepterHostedPrivateVirtualInterfaceAccepter = new Aws.DirectConnect.HostedPrivateVirtualInterfaceAccepter("accepter", new()
{
VirtualInterfaceId = creator.Id,
VpnGatewayId = vpnGw.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.ec2.VpnGateway;
import com.pulumi.aws.directconnect.HostedPrivateVirtualInterface;
import com.pulumi.aws.directconnect.HostedPrivateVirtualInterfaceArgs;
import com.pulumi.aws.directconnect.HostedPrivateVirtualInterfaceAccepter;
import com.pulumi.aws.directconnect.HostedPrivateVirtualInterfaceAccepterArgs;
import com.pulumi.resources.CustomResourceOptions;
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();
// Accepter's side of the VIF.
var vpnGw = new VpnGateway("vpnGw");
// Creator's side of the VIF
var creator = new HostedPrivateVirtualInterface("creator", HostedPrivateVirtualInterfaceArgs.builder()
.connectionId("dxcon-zzzzzzzz")
.ownerAccountId(accepter.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
.name("vif-foo")
.vlan(4094)
.addressFamily("ipv4")
.bgpAsn(65352)
.build(), CustomResourceOptions.builder()
.dependsOn(vpnGw)
.build());
var accepterHostedPrivateVirtualInterfaceAccepter = new HostedPrivateVirtualInterfaceAccepter("accepterHostedPrivateVirtualInterfaceAccepter", HostedPrivateVirtualInterfaceAccepterArgs.builder()
.virtualInterfaceId(creator.id())
.vpnGatewayId(vpnGw.id())
.tags(Map.of("Side", "Accepter"))
.build());
}
}
resources:
# Creator's side of the VIF
creator:
type: aws:directconnect:HostedPrivateVirtualInterface
properties:
connectionId: dxcon-zzzzzzzz
ownerAccountId: ${accepter.accountId}
name: vif-foo
vlan: 4094
addressFamily: ipv4
bgpAsn: 65352 # The aws_dx_hosted_private_virtual_interface
# # must be destroyed before the aws_vpn_gateway.
options:
dependson:
- ${vpnGw}
# Accepter's side of the VIF.
vpnGw:
type: aws:ec2:VpnGateway
name: vpn_gw
accepterHostedPrivateVirtualInterfaceAccepter:
type: aws:directconnect:HostedPrivateVirtualInterfaceAccepter
name: accepter
properties:
virtualInterfaceId: ${creator.id}
vpnGatewayId: ${vpnGw.id}
tags:
Side: Accepter
variables:
accepter:
fn::invoke:
Function: aws:getCallerIdentity
Arguments: {}
Create HostedPrivateVirtualInterfaceAccepter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HostedPrivateVirtualInterfaceAccepter(name: string, args: HostedPrivateVirtualInterfaceAccepterArgs, opts?: CustomResourceOptions);
@overload
def HostedPrivateVirtualInterfaceAccepter(resource_name: str,
args: HostedPrivateVirtualInterfaceAccepterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HostedPrivateVirtualInterfaceAccepter(resource_name: str,
opts: Optional[ResourceOptions] = None,
virtual_interface_id: Optional[str] = None,
dx_gateway_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
vpn_gateway_id: Optional[str] = None)
func NewHostedPrivateVirtualInterfaceAccepter(ctx *Context, name string, args HostedPrivateVirtualInterfaceAccepterArgs, opts ...ResourceOption) (*HostedPrivateVirtualInterfaceAccepter, error)
public HostedPrivateVirtualInterfaceAccepter(string name, HostedPrivateVirtualInterfaceAccepterArgs args, CustomResourceOptions? opts = null)
public HostedPrivateVirtualInterfaceAccepter(String name, HostedPrivateVirtualInterfaceAccepterArgs args)
public HostedPrivateVirtualInterfaceAccepter(String name, HostedPrivateVirtualInterfaceAccepterArgs args, CustomResourceOptions options)
type: aws:directconnect:HostedPrivateVirtualInterfaceAccepter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args HostedPrivateVirtualInterfaceAccepterArgs
- 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 HostedPrivateVirtualInterfaceAccepterArgs
- 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 HostedPrivateVirtualInterfaceAccepterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostedPrivateVirtualInterfaceAccepterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostedPrivateVirtualInterfaceAccepterArgs
- 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 hostedPrivateVirtualInterfaceAccepterResource = new Aws.DirectConnect.HostedPrivateVirtualInterfaceAccepter("hostedPrivateVirtualInterfaceAccepterResource", new()
{
VirtualInterfaceId = "string",
DxGatewayId = "string",
Tags =
{
{ "string", "string" },
},
VpnGatewayId = "string",
});
example, err := directconnect.NewHostedPrivateVirtualInterfaceAccepter(ctx, "hostedPrivateVirtualInterfaceAccepterResource", &directconnect.HostedPrivateVirtualInterfaceAccepterArgs{
VirtualInterfaceId: pulumi.String("string"),
DxGatewayId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
VpnGatewayId: pulumi.String("string"),
})
var hostedPrivateVirtualInterfaceAccepterResource = new HostedPrivateVirtualInterfaceAccepter("hostedPrivateVirtualInterfaceAccepterResource", HostedPrivateVirtualInterfaceAccepterArgs.builder()
.virtualInterfaceId("string")
.dxGatewayId("string")
.tags(Map.of("string", "string"))
.vpnGatewayId("string")
.build());
hosted_private_virtual_interface_accepter_resource = aws.directconnect.HostedPrivateVirtualInterfaceAccepter("hostedPrivateVirtualInterfaceAccepterResource",
virtual_interface_id="string",
dx_gateway_id="string",
tags={
"string": "string",
},
vpn_gateway_id="string")
const hostedPrivateVirtualInterfaceAccepterResource = new aws.directconnect.HostedPrivateVirtualInterfaceAccepter("hostedPrivateVirtualInterfaceAccepterResource", {
virtualInterfaceId: "string",
dxGatewayId: "string",
tags: {
string: "string",
},
vpnGatewayId: "string",
});
type: aws:directconnect:HostedPrivateVirtualInterfaceAccepter
properties:
dxGatewayId: string
tags:
string: string
virtualInterfaceId: string
vpnGatewayId: string
HostedPrivateVirtualInterfaceAccepter 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 HostedPrivateVirtualInterfaceAccepter resource accepts the following input properties:
- Virtual
Interface stringId - The ID of the Direct Connect virtual interface to accept.
- Dx
Gateway stringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - Vpn
Gateway stringId - The ID of the virtual private gateway to which to connect the virtual interface.
- Virtual
Interface stringId - The ID of the Direct Connect virtual interface to accept.
- Dx
Gateway stringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - Vpn
Gateway stringId - The ID of the virtual private gateway to which to connect the virtual interface.
- virtual
Interface StringId - The ID of the Direct Connect virtual interface to accept.
- dx
Gateway StringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - vpn
Gateway StringId - The ID of the virtual private gateway to which to connect the virtual interface.
- virtual
Interface stringId - The ID of the Direct Connect virtual interface to accept.
- dx
Gateway stringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- {[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. - vpn
Gateway stringId - The ID of the virtual private gateway to which to connect the virtual interface.
- virtual_
interface_ strid - The ID of the Direct Connect virtual interface to accept.
- dx_
gateway_ strid - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - vpn_
gateway_ strid - The ID of the virtual private gateway to which to connect the virtual interface.
- virtual
Interface StringId - The ID of the Direct Connect virtual interface to accept.
- dx
Gateway StringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - vpn
Gateway StringId - The ID of the virtual private gateway to which to connect the virtual interface.
Outputs
All input properties are implicitly available as output properties. Additionally, the HostedPrivateVirtualInterfaceAccepter resource produces the following output properties:
Look up Existing HostedPrivateVirtualInterfaceAccepter Resource
Get an existing HostedPrivateVirtualInterfaceAccepter 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?: HostedPrivateVirtualInterfaceAccepterState, opts?: CustomResourceOptions): HostedPrivateVirtualInterfaceAccepter
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
dx_gateway_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
virtual_interface_id: Optional[str] = None,
vpn_gateway_id: Optional[str] = None) -> HostedPrivateVirtualInterfaceAccepter
func GetHostedPrivateVirtualInterfaceAccepter(ctx *Context, name string, id IDInput, state *HostedPrivateVirtualInterfaceAccepterState, opts ...ResourceOption) (*HostedPrivateVirtualInterfaceAccepter, error)
public static HostedPrivateVirtualInterfaceAccepter Get(string name, Input<string> id, HostedPrivateVirtualInterfaceAccepterState? state, CustomResourceOptions? opts = null)
public static HostedPrivateVirtualInterfaceAccepter get(String name, Output<String> id, HostedPrivateVirtualInterfaceAccepterState 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.
- Arn string
- The ARN of the virtual interface.
- Dx
Gateway stringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Virtual
Interface stringId - The ID of the Direct Connect virtual interface to accept.
- Vpn
Gateway stringId - The ID of the virtual private gateway to which to connect the virtual interface.
- Arn string
- The ARN of the virtual interface.
- Dx
Gateway stringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Virtual
Interface stringId - The ID of the Direct Connect virtual interface to accept.
- Vpn
Gateway stringId - The ID of the virtual private gateway to which to connect the virtual interface.
- arn String
- The ARN of the virtual interface.
- dx
Gateway StringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - virtual
Interface StringId - The ID of the Direct Connect virtual interface to accept.
- vpn
Gateway StringId - The ID of the virtual private gateway to which to connect the virtual interface.
- arn string
- The ARN of the virtual interface.
- dx
Gateway stringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- {[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. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - virtual
Interface stringId - The ID of the Direct Connect virtual interface to accept.
- vpn
Gateway stringId - The ID of the virtual private gateway to which to connect the virtual interface.
- arn str
- The ARN of the virtual interface.
- dx_
gateway_ strid - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - virtual_
interface_ strid - The ID of the Direct Connect virtual interface to accept.
- vpn_
gateway_ strid - The ID of the virtual private gateway to which to connect the virtual interface.
- arn String
- The ARN of the virtual interface.
- dx
Gateway StringId - The ID of the Direct Connect gateway to which to connect the virtual interface.
- 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - virtual
Interface StringId - The ID of the Direct Connect virtual interface to accept.
- vpn
Gateway StringId - The ID of the virtual private gateway to which to connect the virtual interface.
Import
Using pulumi import
, import Direct Connect hosted private virtual interfaces using the VIF id
. For example:
$ pulumi import aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter test dxvif-33cc44dd
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.