hcp.HvnPeeringConnection
Explore with Pulumi AI
The HVN peering connection resource allows you to manage a peering connection between HVNs.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Hcp = Pulumi.Hcp;
return await Deployment.RunAsync(() =>
{
var hvn1 = new Hcp.Hvn("hvn1", new()
{
HvnId = "hvn-1",
CloudProvider = "aws",
Region = "us-west-2",
CidrBlock = "172.25.16.0/20",
});
var hvn2 = new Hcp.Hvn("hvn2", new()
{
HvnId = "hvn-2",
CloudProvider = "aws",
Region = "us-west-2",
CidrBlock = "172.18.16.0/20",
});
var peer1 = new Hcp.HvnPeeringConnection("peer1", new()
{
Hvn1 = hvn1.SelfLink,
Hvn2 = hvn2.SelfLink,
});
});
package main
import (
"github.com/grapl-security/pulumi-hcp/sdk/go/hcp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
hvn1, err := hcp.NewHvn(ctx, "hvn1", &hcp.HvnArgs{
HvnId: pulumi.String("hvn-1"),
CloudProvider: pulumi.String("aws"),
Region: pulumi.String("us-west-2"),
CidrBlock: pulumi.String("172.25.16.0/20"),
})
if err != nil {
return err
}
hvn2, err := hcp.NewHvn(ctx, "hvn2", &hcp.HvnArgs{
HvnId: pulumi.String("hvn-2"),
CloudProvider: pulumi.String("aws"),
Region: pulumi.String("us-west-2"),
CidrBlock: pulumi.String("172.18.16.0/20"),
})
if err != nil {
return err
}
_, err = hcp.NewHvnPeeringConnection(ctx, "peer1", &hcp.HvnPeeringConnectionArgs{
Hvn1: hvn1.SelfLink,
Hvn2: hvn2.SelfLink,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcp.Hvn;
import com.pulumi.hcp.HvnArgs;
import com.pulumi.hcp.HvnPeeringConnection;
import com.pulumi.hcp.HvnPeeringConnectionArgs;
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) {
var hvn1 = new Hvn("hvn1", HvnArgs.builder()
.hvnId("hvn-1")
.cloudProvider("aws")
.region("us-west-2")
.cidrBlock("172.25.16.0/20")
.build());
var hvn2 = new Hvn("hvn2", HvnArgs.builder()
.hvnId("hvn-2")
.cloudProvider("aws")
.region("us-west-2")
.cidrBlock("172.18.16.0/20")
.build());
var peer1 = new HvnPeeringConnection("peer1", HvnPeeringConnectionArgs.builder()
.hvn1(hvn1.selfLink())
.hvn2(hvn2.selfLink())
.build());
}
}
import pulumi
import pulumi_hcp as hcp
hvn1 = hcp.Hvn("hvn1",
hvn_id="hvn-1",
cloud_provider="aws",
region="us-west-2",
cidr_block="172.25.16.0/20")
hvn2 = hcp.Hvn("hvn2",
hvn_id="hvn-2",
cloud_provider="aws",
region="us-west-2",
cidr_block="172.18.16.0/20")
peer1 = hcp.HvnPeeringConnection("peer1",
hvn1=hvn1.self_link,
hvn2=hvn2.self_link)
import * as pulumi from "@pulumi/pulumi";
import * as hcp from "@grapl/pulumi-hcp";
const hvn1 = new hcp.Hvn("hvn1", {
hvnId: "hvn-1",
cloudProvider: "aws",
region: "us-west-2",
cidrBlock: "172.25.16.0/20",
});
const hvn2 = new hcp.Hvn("hvn2", {
hvnId: "hvn-2",
cloudProvider: "aws",
region: "us-west-2",
cidrBlock: "172.18.16.0/20",
});
const peer1 = new hcp.HvnPeeringConnection("peer1", {
hvn1: hvn1.selfLink,
hvn2: hvn2.selfLink,
});
resources:
hvn1:
type: hcp:Hvn
properties:
hvnId: hvn-1
cloudProvider: aws
region: us-west-2
cidrBlock: 172.25.16.0/20
hvn2:
type: hcp:Hvn
properties:
hvnId: hvn-2
cloudProvider: aws
region: us-west-2
cidrBlock: 172.18.16.0/20
peer1:
type: hcp:HvnPeeringConnection
properties:
hvn1: ${hvn1.selfLink}
hvn2: ${hvn2.selfLink}
Create HvnPeeringConnection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HvnPeeringConnection(name: string, args: HvnPeeringConnectionArgs, opts?: CustomResourceOptions);
@overload
def HvnPeeringConnection(resource_name: str,
args: HvnPeeringConnectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HvnPeeringConnection(resource_name: str,
opts: Optional[ResourceOptions] = None,
hvn1: Optional[str] = None,
hvn2: Optional[str] = None)
func NewHvnPeeringConnection(ctx *Context, name string, args HvnPeeringConnectionArgs, opts ...ResourceOption) (*HvnPeeringConnection, error)
public HvnPeeringConnection(string name, HvnPeeringConnectionArgs args, CustomResourceOptions? opts = null)
public HvnPeeringConnection(String name, HvnPeeringConnectionArgs args)
public HvnPeeringConnection(String name, HvnPeeringConnectionArgs args, CustomResourceOptions options)
type: hcp:HvnPeeringConnection
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 HvnPeeringConnectionArgs
- 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 HvnPeeringConnectionArgs
- 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 HvnPeeringConnectionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HvnPeeringConnectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HvnPeeringConnectionArgs
- 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 hvnPeeringConnectionResource = new Hcp.HvnPeeringConnection("hvnPeeringConnectionResource", new()
{
Hvn1 = "string",
Hvn2 = "string",
});
example, err := hcp.NewHvnPeeringConnection(ctx, "hvnPeeringConnectionResource", &hcp.HvnPeeringConnectionArgs{
Hvn1: pulumi.String("string"),
Hvn2: pulumi.String("string"),
})
var hvnPeeringConnectionResource = new HvnPeeringConnection("hvnPeeringConnectionResource", HvnPeeringConnectionArgs.builder()
.hvn1("string")
.hvn2("string")
.build());
hvn_peering_connection_resource = hcp.HvnPeeringConnection("hvnPeeringConnectionResource",
hvn1="string",
hvn2="string")
const hvnPeeringConnectionResource = new hcp.HvnPeeringConnection("hvnPeeringConnectionResource", {
hvn1: "string",
hvn2: "string",
});
type: hcp:HvnPeeringConnection
properties:
hvn1: string
hvn2: string
HvnPeeringConnection 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 HvnPeeringConnection resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the HvnPeeringConnection resource produces the following output properties:
- Created
At string - The time that the peering connection was created.
- Expires
At string - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - Id string
- The provider-assigned unique ID for this managed resource.
- Organization
Id string - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- Peering
Id string - The ID of the peering connection.
- Project
Id string - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- Self
Link string - A unique URL identifying the peering connection
- State string
- The state of the HVN peering connection.
- Created
At string - The time that the peering connection was created.
- Expires
At string - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - Id string
- The provider-assigned unique ID for this managed resource.
- Organization
Id string - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- Peering
Id string - The ID of the peering connection.
- Project
Id string - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- Self
Link string - A unique URL identifying the peering connection
- State string
- The state of the HVN peering connection.
- created
At String - The time that the peering connection was created.
- expires
At String - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - id String
- The provider-assigned unique ID for this managed resource.
- organization
Id String - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering
Id String - The ID of the peering connection.
- project
Id String - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self
Link String - A unique URL identifying the peering connection
- state String
- The state of the HVN peering connection.
- created
At string - The time that the peering connection was created.
- expires
At string - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - id string
- The provider-assigned unique ID for this managed resource.
- organization
Id string - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering
Id string - The ID of the peering connection.
- project
Id string - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self
Link string - A unique URL identifying the peering connection
- state string
- The state of the HVN peering connection.
- created_
at str - The time that the peering connection was created.
- expires_
at str - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - id str
- The provider-assigned unique ID for this managed resource.
- organization_
id str - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering_
id str - The ID of the peering connection.
- project_
id str - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self_
link str - A unique URL identifying the peering connection
- state str
- The state of the HVN peering connection.
- created
At String - The time that the peering connection was created.
- expires
At String - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - id String
- The provider-assigned unique ID for this managed resource.
- organization
Id String - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering
Id String - The ID of the peering connection.
- project
Id String - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self
Link String - A unique URL identifying the peering connection
- state String
- The state of the HVN peering connection.
Look up Existing HvnPeeringConnection Resource
Get an existing HvnPeeringConnection 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?: HvnPeeringConnectionState, opts?: CustomResourceOptions): HvnPeeringConnection
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
expires_at: Optional[str] = None,
hvn1: Optional[str] = None,
hvn2: Optional[str] = None,
organization_id: Optional[str] = None,
peering_id: Optional[str] = None,
project_id: Optional[str] = None,
self_link: Optional[str] = None,
state: Optional[str] = None) -> HvnPeeringConnection
func GetHvnPeeringConnection(ctx *Context, name string, id IDInput, state *HvnPeeringConnectionState, opts ...ResourceOption) (*HvnPeeringConnection, error)
public static HvnPeeringConnection Get(string name, Input<string> id, HvnPeeringConnectionState? state, CustomResourceOptions? opts = null)
public static HvnPeeringConnection get(String name, Output<String> id, HvnPeeringConnectionState 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.
- Created
At string - The time that the peering connection was created.
- Expires
At string - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - Hvn1 string
- The unique URL of one of the HVNs being peered.
- Hvn2 string
- The unique URL of one of the HVNs being peered.
- Organization
Id string - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- Peering
Id string - The ID of the peering connection.
- Project
Id string - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- Self
Link string - A unique URL identifying the peering connection
- State string
- The state of the HVN peering connection.
- Created
At string - The time that the peering connection was created.
- Expires
At string - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - Hvn1 string
- The unique URL of one of the HVNs being peered.
- Hvn2 string
- The unique URL of one of the HVNs being peered.
- Organization
Id string - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- Peering
Id string - The ID of the peering connection.
- Project
Id string - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- Self
Link string - A unique URL identifying the peering connection
- State string
- The state of the HVN peering connection.
- created
At String - The time that the peering connection was created.
- expires
At String - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - hvn1 String
- The unique URL of one of the HVNs being peered.
- hvn2 String
- The unique URL of one of the HVNs being peered.
- organization
Id String - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering
Id String - The ID of the peering connection.
- project
Id String - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self
Link String - A unique URL identifying the peering connection
- state String
- The state of the HVN peering connection.
- created
At string - The time that the peering connection was created.
- expires
At string - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - hvn1 string
- The unique URL of one of the HVNs being peered.
- hvn2 string
- The unique URL of one of the HVNs being peered.
- organization
Id string - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering
Id string - The ID of the peering connection.
- project
Id string - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self
Link string - A unique URL identifying the peering connection
- state string
- The state of the HVN peering connection.
- created_
at str - The time that the peering connection was created.
- expires_
at str - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - hvn1 str
- The unique URL of one of the HVNs being peered.
- hvn2 str
- The unique URL of one of the HVNs being peered.
- organization_
id str - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering_
id str - The ID of the peering connection.
- project_
id str - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self_
link str - A unique URL identifying the peering connection
- state str
- The state of the HVN peering connection.
- created
At String - The time that the peering connection was created.
- expires
At String - The time after which the peering connection will be considered expired if it hasn't transitioned into
ACCEPTED
orACTIVE
state. - hvn1 String
- The unique URL of one of the HVNs being peered.
- hvn2 String
- The unique URL of one of the HVNs being peered.
- organization
Id String - The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
- peering
Id String - The ID of the peering connection.
- project
Id String - The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
- self
Link String - A unique URL identifying the peering connection
- state String
- The state of the HVN peering connection.
Import
The import ID requires the first HVN ID in the format {hvn_1_id}:{peering_id}
$ pulumi import hcp:index/hvnPeeringConnection:HvnPeeringConnection peer_1 hvn-1:peer-1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- hcp grapl-security/pulumi-hcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcp
Terraform Provider.