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

hcp.ConsulSnapshot

Explore with Pulumi AI

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

    The Consul snapshot resource allows users to manage Consul snapshots of an HCP Consul cluster. Snapshots currently have a retention policy of 30 days.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Hcp = Pulumi.Hcp;
    
    return await Deployment.RunAsync(() => 
    {
        // Note: Snapshots currently have a retention policy of 30 days. After that time, any Terraform
        // state refresh will note that a new snapshot resource will be created.
        var example = new Hcp.ConsulSnapshot("example", new()
        {
            ClusterId = "consul-cluster",
            SnapshotName = "my-snapshot",
        });
    
    });
    
    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.NewConsulSnapshot(ctx, "example", &hcp.ConsulSnapshotArgs{
    			ClusterId:    pulumi.String("consul-cluster"),
    			SnapshotName: pulumi.String("my-snapshot"),
    		})
    		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.ConsulSnapshot;
    import com.pulumi.hcp.ConsulSnapshotArgs;
    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 ConsulSnapshot("example", ConsulSnapshotArgs.builder()        
                .clusterId("consul-cluster")
                .snapshotName("my-snapshot")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_hcp as hcp
    
    # Note: Snapshots currently have a retention policy of 30 days. After that time, any Terraform
    # state refresh will note that a new snapshot resource will be created.
    example = hcp.ConsulSnapshot("example",
        cluster_id="consul-cluster",
        snapshot_name="my-snapshot")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as hcp from "@pulumi/hcp";
    
    // Note: Snapshots currently have a retention policy of 30 days. After that time, any Terraform
    // state refresh will note that a new snapshot resource will be created.
    const example = new hcp.ConsulSnapshot("example", {
        clusterId: "consul-cluster",
        snapshotName: "my-snapshot",
    });
    
    resources:
      # Note: Snapshots currently have a retention policy of 30 days. After that time, any Terraform
      # // state refresh will note that a new snapshot resource will be created.
      example:
        type: hcp:ConsulSnapshot
        properties:
          clusterId: consul-cluster
          snapshotName: my-snapshot
    

    Create ConsulSnapshot Resource

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

    Constructor syntax

    new ConsulSnapshot(name: string, args: ConsulSnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def ConsulSnapshot(resource_name: str,
                       args: ConsulSnapshotArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConsulSnapshot(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       cluster_id: Optional[str] = None,
                       snapshot_name: Optional[str] = None)
    func NewConsulSnapshot(ctx *Context, name string, args ConsulSnapshotArgs, opts ...ResourceOption) (*ConsulSnapshot, error)
    public ConsulSnapshot(string name, ConsulSnapshotArgs args, CustomResourceOptions? opts = null)
    public ConsulSnapshot(String name, ConsulSnapshotArgs args)
    public ConsulSnapshot(String name, ConsulSnapshotArgs args, CustomResourceOptions options)
    
    type: hcp:ConsulSnapshot
    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 ConsulSnapshotArgs
    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 ConsulSnapshotArgs
    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 ConsulSnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConsulSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConsulSnapshotArgs
    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 consulSnapshotResource = new Hcp.ConsulSnapshot("consulSnapshotResource", new()
    {
        ClusterId = "string",
        SnapshotName = "string",
    });
    
    example, err := hcp.NewConsulSnapshot(ctx, "consulSnapshotResource", &hcp.ConsulSnapshotArgs{
    	ClusterId:    pulumi.String("string"),
    	SnapshotName: pulumi.String("string"),
    })
    
    var consulSnapshotResource = new ConsulSnapshot("consulSnapshotResource", ConsulSnapshotArgs.builder()
        .clusterId("string")
        .snapshotName("string")
        .build());
    
    consul_snapshot_resource = hcp.ConsulSnapshot("consulSnapshotResource",
        cluster_id="string",
        snapshot_name="string")
    
    const consulSnapshotResource = new hcp.ConsulSnapshot("consulSnapshotResource", {
        clusterId: "string",
        snapshotName: "string",
    });
    
    type: hcp:ConsulSnapshot
    properties:
        clusterId: string
        snapshotName: string
    

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

    ClusterId string
    The ID of the HCP Consul cluster.
    SnapshotName string
    The name of the snapshot.
    ClusterId string
    The ID of the HCP Consul cluster.
    SnapshotName string
    The name of the snapshot.
    clusterId String
    The ID of the HCP Consul cluster.
    snapshotName String
    The name of the snapshot.
    clusterId string
    The ID of the HCP Consul cluster.
    snapshotName string
    The name of the snapshot.
    cluster_id str
    The ID of the HCP Consul cluster.
    snapshot_name str
    The name of the snapshot.
    clusterId String
    The ID of the HCP Consul cluster.
    snapshotName String
    The name of the snapshot.

    Outputs

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

    ConsulVersion string
    The version of Consul at the time of snapshot creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    ProjectId string
    The ID of the project the HCP Consul cluster is located.
    RestoredAt string
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    Size int
    The size of the snapshot in bytes.
    SnapshotId string
    The ID of the Consul snapshot
    State string
    The state of an HCP Consul snapshot.
    ConsulVersion string
    The version of Consul at the time of snapshot creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    ProjectId string
    The ID of the project the HCP Consul cluster is located.
    RestoredAt string
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    Size int
    The size of the snapshot in bytes.
    SnapshotId string
    The ID of the Consul snapshot
    State string
    The state of an HCP Consul snapshot.
    consulVersion String
    The version of Consul at the time of snapshot creation.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    projectId String
    The ID of the project the HCP Consul cluster is located.
    restoredAt String
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size Integer
    The size of the snapshot in bytes.
    snapshotId String
    The ID of the Consul snapshot
    state String
    The state of an HCP Consul snapshot.
    consulVersion string
    The version of Consul at the time of snapshot creation.
    id string
    The provider-assigned unique ID for this managed resource.
    organizationId string
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    projectId string
    The ID of the project the HCP Consul cluster is located.
    restoredAt string
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size number
    The size of the snapshot in bytes.
    snapshotId string
    The ID of the Consul snapshot
    state string
    The state of an HCP Consul snapshot.
    consul_version str
    The version of Consul at the time of snapshot creation.
    id str
    The provider-assigned unique ID for this managed resource.
    organization_id str
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    project_id str
    The ID of the project the HCP Consul cluster is located.
    restored_at str
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size int
    The size of the snapshot in bytes.
    snapshot_id str
    The ID of the Consul snapshot
    state str
    The state of an HCP Consul snapshot.
    consulVersion String
    The version of Consul at the time of snapshot creation.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    projectId String
    The ID of the project the HCP Consul cluster is located.
    restoredAt String
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size Number
    The size of the snapshot in bytes.
    snapshotId String
    The ID of the Consul snapshot
    state String
    The state of an HCP Consul snapshot.

    Look up Existing ConsulSnapshot Resource

    Get an existing ConsulSnapshot 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?: ConsulSnapshotState, opts?: CustomResourceOptions): ConsulSnapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            consul_version: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            restored_at: Optional[str] = None,
            size: Optional[int] = None,
            snapshot_id: Optional[str] = None,
            snapshot_name: Optional[str] = None,
            state: Optional[str] = None) -> ConsulSnapshot
    func GetConsulSnapshot(ctx *Context, name string, id IDInput, state *ConsulSnapshotState, opts ...ResourceOption) (*ConsulSnapshot, error)
    public static ConsulSnapshot Get(string name, Input<string> id, ConsulSnapshotState? state, CustomResourceOptions? opts = null)
    public static ConsulSnapshot get(String name, Output<String> id, ConsulSnapshotState 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:
    ClusterId string
    The ID of the HCP Consul cluster.
    ConsulVersion string
    The version of Consul at the time of snapshot creation.
    OrganizationId string
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    ProjectId string
    The ID of the project the HCP Consul cluster is located.
    RestoredAt string
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    Size int
    The size of the snapshot in bytes.
    SnapshotId string
    The ID of the Consul snapshot
    SnapshotName string
    The name of the snapshot.
    State string
    The state of an HCP Consul snapshot.
    ClusterId string
    The ID of the HCP Consul cluster.
    ConsulVersion string
    The version of Consul at the time of snapshot creation.
    OrganizationId string
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    ProjectId string
    The ID of the project the HCP Consul cluster is located.
    RestoredAt string
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    Size int
    The size of the snapshot in bytes.
    SnapshotId string
    The ID of the Consul snapshot
    SnapshotName string
    The name of the snapshot.
    State string
    The state of an HCP Consul snapshot.
    clusterId String
    The ID of the HCP Consul cluster.
    consulVersion String
    The version of Consul at the time of snapshot creation.
    organizationId String
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    projectId String
    The ID of the project the HCP Consul cluster is located.
    restoredAt String
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size Integer
    The size of the snapshot in bytes.
    snapshotId String
    The ID of the Consul snapshot
    snapshotName String
    The name of the snapshot.
    state String
    The state of an HCP Consul snapshot.
    clusterId string
    The ID of the HCP Consul cluster.
    consulVersion string
    The version of Consul at the time of snapshot creation.
    organizationId string
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    projectId string
    The ID of the project the HCP Consul cluster is located.
    restoredAt string
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size number
    The size of the snapshot in bytes.
    snapshotId string
    The ID of the Consul snapshot
    snapshotName string
    The name of the snapshot.
    state string
    The state of an HCP Consul snapshot.
    cluster_id str
    The ID of the HCP Consul cluster.
    consul_version str
    The version of Consul at the time of snapshot creation.
    organization_id str
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    project_id str
    The ID of the project the HCP Consul cluster is located.
    restored_at str
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size int
    The size of the snapshot in bytes.
    snapshot_id str
    The ID of the Consul snapshot
    snapshot_name str
    The name of the snapshot.
    state str
    The state of an HCP Consul snapshot.
    clusterId String
    The ID of the HCP Consul cluster.
    consulVersion String
    The version of Consul at the time of snapshot creation.
    organizationId String
    The ID of the HCP organization where the project the HCP Consul cluster is located.
    projectId String
    The ID of the project the HCP Consul cluster is located.
    restoredAt String
    Timestamp of when the snapshot was restored. If the snapshot has not been restored, this field will be blank.
    size Number
    The size of the snapshot in bytes.
    snapshotId String
    The ID of the Consul snapshot
    snapshotName String
    The name of the snapshot.
    state String
    The state of an HCP Consul snapshot.

    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