1. Packages
  2. HCP
  3. API Docs
  4. HvnPeeringConnection
HashiCorp Cloud Platform (HCP) v0.1.14 published on Friday, Dec 2, 2022 by Grapl Security

hcp.HvnPeeringConnection

Explore with Pulumi AI

hcp logo
HashiCorp Cloud Platform (HCP) v0.1.14 published on Friday, Dec 2, 2022 by Grapl Security

    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:

    Hvn1 string
    The unique URL of one of the HVNs being peered.
    Hvn2 string
    The unique URL of one of the HVNs being peered.
    Hvn1 string
    The unique URL of one of the HVNs being peered.
    Hvn2 string
    The unique URL of one of the HVNs being peered.
    hvn1 String
    The unique URL of one of the HVNs being peered.
    hvn2 String
    The unique URL of one of the HVNs being peered.
    hvn1 string
    The unique URL of one of the HVNs being peered.
    hvn2 string
    The unique URL of one of the HVNs being peered.
    hvn1 str
    The unique URL of one of the HVNs being peered.
    hvn2 str
    The unique URL of one of the HVNs being peered.
    hvn1 String
    The unique URL of one of the HVNs being peered.
    hvn2 String
    The unique URL of one of the HVNs being peered.

    Outputs

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

    CreatedAt string
    The time that the peering connection was created.
    ExpiresAt string
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE state.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    PeeringId string
    The ID of the peering connection.
    ProjectId string
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    SelfLink string
    A unique URL identifying the peering connection
    State string
    The state of the HVN peering connection.
    CreatedAt string
    The time that the peering connection was created.
    ExpiresAt string
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE state.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    PeeringId string
    The ID of the peering connection.
    ProjectId string
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    SelfLink string
    A unique URL identifying the peering connection
    State string
    The state of the HVN peering connection.
    createdAt String
    The time that the peering connection was created.
    expiresAt String
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE state.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    peeringId String
    The ID of the peering connection.
    projectId String
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    selfLink String
    A unique URL identifying the peering connection
    state String
    The state of the HVN peering connection.
    createdAt string
    The time that the peering connection was created.
    expiresAt string
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE state.
    id string
    The provider-assigned unique ID for this managed resource.
    organizationId string
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    peeringId string
    The ID of the peering connection.
    projectId string
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    selfLink 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 or ACTIVE 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.
    createdAt String
    The time that the peering connection was created.
    expiresAt String
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE state.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    peeringId String
    The ID of the peering connection.
    projectId String
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    selfLink 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.
    The following state arguments are supported:
    CreatedAt string
    The time that the peering connection was created.
    ExpiresAt string
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE 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.
    OrganizationId string
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    PeeringId string
    The ID of the peering connection.
    ProjectId string
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    SelfLink string
    A unique URL identifying the peering connection
    State string
    The state of the HVN peering connection.
    CreatedAt string
    The time that the peering connection was created.
    ExpiresAt string
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE 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.
    OrganizationId string
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    PeeringId string
    The ID of the peering connection.
    ProjectId string
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    SelfLink string
    A unique URL identifying the peering connection
    State string
    The state of the HVN peering connection.
    createdAt String
    The time that the peering connection was created.
    expiresAt String
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE 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.
    organizationId String
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    peeringId String
    The ID of the peering connection.
    projectId String
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    selfLink String
    A unique URL identifying the peering connection
    state String
    The state of the HVN peering connection.
    createdAt string
    The time that the peering connection was created.
    expiresAt string
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE 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.
    organizationId string
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    peeringId string
    The ID of the peering connection.
    projectId string
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    selfLink 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 or ACTIVE 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.
    createdAt String
    The time that the peering connection was created.
    expiresAt String
    The time after which the peering connection will be considered expired if it hasn't transitioned into ACCEPTED or ACTIVE 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.
    organizationId String
    The ID of the HCP organization where the peering connection is located. Always matches the HVNs' organization.
    peeringId String
    The ID of the peering connection.
    projectId String
    The ID of the HCP project where the peering connection is located. Always matches the HVNs' project.
    selfLink 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.
    hcp logo
    HashiCorp Cloud Platform (HCP) v0.1.14 published on Friday, Dec 2, 2022 by Grapl Security