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

hcp.Hvn

Explore with Pulumi AI

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

    The HVN resource allows you to manage a HashiCorp Virtual Network in HCP.

    We recommend the following when selecting the CIDR block of an HVN:

    • The CIDR block value must be a private IPv4 CIDR block within the RFC1918 address space (10..., 192.168.., 172.[16-31]..*).

    • The CIDR block value must be the first IP address of the desired CIDR block. The helper cidrsubnet("172.16.1.1/24", 0, 0) will specify the first address of the CIDR block in the first argument.

    • The CIDR block value must end between /16 and /25.

    • If the CIDR block values for your HCP HVN and your cloud provider’s virtual network overlap you will not be able to establish a connection. The following are default CIDR block values to be aware of: HCP HVN (172.25.16.0/20), AWS VPC (172.31.0.0/16), and Azure VNet (172.29.0.0/24). Avoid creating overlapping networks.

    • If you’re creating a HVN for use in production it’s recommended that you specify a CIDR block value that does not overlap with the other HVNs already created in your organization. You will not be able to connect two HVNs with overlapping CIDR block values.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Hcp = Pulumi.Hcp;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Hcp.Hvn("example", new()
        {
            CidrBlock = "172.25.16.0/20",
            CloudProvider = "aws",
            HvnId = "main-hvn",
            Region = "us-west-2",
        });
    
    });
    
    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 {
    		_, err := hcp.NewHvn(ctx, "example", &hcp.HvnArgs{
    			CidrBlock:     pulumi.String("172.25.16.0/20"),
    			CloudProvider: pulumi.String("aws"),
    			HvnId:         pulumi.String("main-hvn"),
    			Region:        pulumi.String("us-west-2"),
    		})
    		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 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 example = new Hvn("example", HvnArgs.builder()        
                .cidrBlock("172.25.16.0/20")
                .cloudProvider("aws")
                .hvnId("main-hvn")
                .region("us-west-2")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_hcp as hcp
    
    example = hcp.Hvn("example",
        cidr_block="172.25.16.0/20",
        cloud_provider="aws",
        hvn_id="main-hvn",
        region="us-west-2")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as hcp from "@pulumi/hcp";
    
    const example = new hcp.Hvn("example", {
        cidrBlock: "172.25.16.0/20",
        cloudProvider: "aws",
        hvnId: "main-hvn",
        region: "us-west-2",
    });
    
    resources:
      example:
        type: hcp:Hvn
        properties:
          cidrBlock: 172.25.16.0/20
          cloudProvider: aws
          hvnId: main-hvn
          region: us-west-2
    

    Create Hvn Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Hvn(name: string, args: HvnArgs, opts?: CustomResourceOptions);
    @overload
    def Hvn(resource_name: str,
            args: HvnArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Hvn(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            cloud_provider: Optional[str] = None,
            hvn_id: Optional[str] = None,
            region: Optional[str] = None,
            cidr_block: Optional[str] = None)
    func NewHvn(ctx *Context, name string, args HvnArgs, opts ...ResourceOption) (*Hvn, error)
    public Hvn(string name, HvnArgs args, CustomResourceOptions? opts = null)
    public Hvn(String name, HvnArgs args)
    public Hvn(String name, HvnArgs args, CustomResourceOptions options)
    
    type: hcp:Hvn
    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 HvnArgs
    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 HvnArgs
    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 HvnArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HvnArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HvnArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var hvnResource = new Hcp.Hvn("hvnResource", new()
    {
        CloudProvider = "string",
        HvnId = "string",
        Region = "string",
        CidrBlock = "string",
    });
    
    example, err := hcp.NewHvn(ctx, "hvnResource", &hcp.HvnArgs{
    	CloudProvider: pulumi.String("string"),
    	HvnId:         pulumi.String("string"),
    	Region:        pulumi.String("string"),
    	CidrBlock:     pulumi.String("string"),
    })
    
    var hvnResource = new Hvn("hvnResource", HvnArgs.builder()        
        .cloudProvider("string")
        .hvnId("string")
        .region("string")
        .cidrBlock("string")
        .build());
    
    hvn_resource = hcp.Hvn("hvnResource",
        cloud_provider="string",
        hvn_id="string",
        region="string",
        cidr_block="string")
    
    const hvnResource = new hcp.Hvn("hvnResource", {
        cloudProvider: "string",
        hvnId: "string",
        region: "string",
        cidrBlock: "string",
    });
    
    type: hcp:Hvn
    properties:
        cidrBlock: string
        cloudProvider: string
        hvnId: string
        region: string
    

    Hvn 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 Hvn resource accepts the following input properties:

    CloudProvider string
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    HvnId string
    The ID of the HashiCorp Virtual Network (HVN).
    Region string
    The region where the HVN is located.
    CidrBlock string
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    CloudProvider string
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    HvnId string
    The ID of the HashiCorp Virtual Network (HVN).
    Region string
    The region where the HVN is located.
    CidrBlock string
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloudProvider String
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    hvnId String
    The ID of the HashiCorp Virtual Network (HVN).
    region String
    The region where the HVN is located.
    cidrBlock String
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloudProvider string
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    hvnId string
    The ID of the HashiCorp Virtual Network (HVN).
    region string
    The region where the HVN is located.
    cidrBlock string
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloud_provider str
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    hvn_id str
    The ID of the HashiCorp Virtual Network (HVN).
    region str
    The region where the HVN is located.
    cidr_block str
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloudProvider String
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    hvnId String
    The ID of the HashiCorp Virtual Network (HVN).
    region String
    The region where the HVN is located.
    cidrBlock String
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.

    Outputs

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

    CreatedAt string
    The time that the HVN was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The ID of the HCP organization where the HVN is located.
    ProjectId string
    The ID of the HCP project where the HVN is located.
    ProviderAccountId string
    The provider account ID where the HVN is located.
    SelfLink string
    A unique URL identifying the HVN.
    State string
    The state of the HVN.
    CreatedAt string
    The time that the HVN was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The ID of the HCP organization where the HVN is located.
    ProjectId string
    The ID of the HCP project where the HVN is located.
    ProviderAccountId string
    The provider account ID where the HVN is located.
    SelfLink string
    A unique URL identifying the HVN.
    State string
    The state of the HVN.
    createdAt String
    The time that the HVN was created.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The ID of the HCP organization where the HVN is located.
    projectId String
    The ID of the HCP project where the HVN is located.
    providerAccountId String
    The provider account ID where the HVN is located.
    selfLink String
    A unique URL identifying the HVN.
    state String
    The state of the HVN.
    createdAt string
    The time that the HVN was created.
    id string
    The provider-assigned unique ID for this managed resource.
    organizationId string
    The ID of the HCP organization where the HVN is located.
    projectId string
    The ID of the HCP project where the HVN is located.
    providerAccountId string
    The provider account ID where the HVN is located.
    selfLink string
    A unique URL identifying the HVN.
    state string
    The state of the HVN.
    created_at str
    The time that the HVN was created.
    id str
    The provider-assigned unique ID for this managed resource.
    organization_id str
    The ID of the HCP organization where the HVN is located.
    project_id str
    The ID of the HCP project where the HVN is located.
    provider_account_id str
    The provider account ID where the HVN is located.
    self_link str
    A unique URL identifying the HVN.
    state str
    The state of the HVN.
    createdAt String
    The time that the HVN was created.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The ID of the HCP organization where the HVN is located.
    projectId String
    The ID of the HCP project where the HVN is located.
    providerAccountId String
    The provider account ID where the HVN is located.
    selfLink String
    A unique URL identifying the HVN.
    state String
    The state of the HVN.

    Look up Existing Hvn Resource

    Get an existing Hvn 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?: HvnState, opts?: CustomResourceOptions): Hvn
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr_block: Optional[str] = None,
            cloud_provider: Optional[str] = None,
            created_at: Optional[str] = None,
            hvn_id: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            provider_account_id: Optional[str] = None,
            region: Optional[str] = None,
            self_link: Optional[str] = None,
            state: Optional[str] = None) -> Hvn
    func GetHvn(ctx *Context, name string, id IDInput, state *HvnState, opts ...ResourceOption) (*Hvn, error)
    public static Hvn Get(string name, Input<string> id, HvnState? state, CustomResourceOptions? opts = null)
    public static Hvn get(String name, Output<String> id, HvnState 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:
    CidrBlock string
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    CloudProvider string
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    CreatedAt string
    The time that the HVN was created.
    HvnId string
    The ID of the HashiCorp Virtual Network (HVN).
    OrganizationId string
    The ID of the HCP organization where the HVN is located.
    ProjectId string
    The ID of the HCP project where the HVN is located.
    ProviderAccountId string
    The provider account ID where the HVN is located.
    Region string
    The region where the HVN is located.
    SelfLink string
    A unique URL identifying the HVN.
    State string
    The state of the HVN.
    CidrBlock string
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    CloudProvider string
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    CreatedAt string
    The time that the HVN was created.
    HvnId string
    The ID of the HashiCorp Virtual Network (HVN).
    OrganizationId string
    The ID of the HCP organization where the HVN is located.
    ProjectId string
    The ID of the HCP project where the HVN is located.
    ProviderAccountId string
    The provider account ID where the HVN is located.
    Region string
    The region where the HVN is located.
    SelfLink string
    A unique URL identifying the HVN.
    State string
    The state of the HVN.
    cidrBlock String
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloudProvider String
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    createdAt String
    The time that the HVN was created.
    hvnId String
    The ID of the HashiCorp Virtual Network (HVN).
    organizationId String
    The ID of the HCP organization where the HVN is located.
    projectId String
    The ID of the HCP project where the HVN is located.
    providerAccountId String
    The provider account ID where the HVN is located.
    region String
    The region where the HVN is located.
    selfLink String
    A unique URL identifying the HVN.
    state String
    The state of the HVN.
    cidrBlock string
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloudProvider string
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    createdAt string
    The time that the HVN was created.
    hvnId string
    The ID of the HashiCorp Virtual Network (HVN).
    organizationId string
    The ID of the HCP organization where the HVN is located.
    projectId string
    The ID of the HCP project where the HVN is located.
    providerAccountId string
    The provider account ID where the HVN is located.
    region string
    The region where the HVN is located.
    selfLink string
    A unique URL identifying the HVN.
    state string
    The state of the HVN.
    cidr_block str
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloud_provider str
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    created_at str
    The time that the HVN was created.
    hvn_id str
    The ID of the HashiCorp Virtual Network (HVN).
    organization_id str
    The ID of the HCP organization where the HVN is located.
    project_id str
    The ID of the HCP project where the HVN is located.
    provider_account_id str
    The provider account ID where the HVN is located.
    region str
    The region where the HVN is located.
    self_link str
    A unique URL identifying the HVN.
    state str
    The state of the HVN.
    cidrBlock String
    The CIDR range of the HVN. If this is not provided, the service will provide a default value.
    cloudProvider String
    The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.
    createdAt String
    The time that the HVN was created.
    hvnId String
    The ID of the HashiCorp Virtual Network (HVN).
    organizationId String
    The ID of the HCP organization where the HVN is located.
    projectId String
    The ID of the HCP project where the HVN is located.
    providerAccountId String
    The provider account ID where the HVN is located.
    region String
    The region where the HVN is located.
    selfLink String
    A unique URL identifying the HVN.
    state String
    The state of the HVN.

    Import

    The import ID is {hvn_id}

     $ pulumi import hcp:index/hvn:Hvn example main-hvn
    

    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