hcp.ConsulSnapshot
Explore with Pulumi AI
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ConsulSnapshot resource accepts the following input properties:
- Cluster
Id string - The ID of the HCP Consul cluster.
- Snapshot
Name string - The name of the snapshot.
- Cluster
Id string - The ID of the HCP Consul cluster.
- Snapshot
Name string - The name of the snapshot.
- cluster
Id String - The ID of the HCP Consul cluster.
- snapshot
Name String - The name of the snapshot.
- cluster
Id string - The ID of the HCP Consul cluster.
- snapshot
Name string - The name of the snapshot.
- cluster_
id str - The ID of the HCP Consul cluster.
- snapshot_
name str - The name of the snapshot.
- cluster
Id String - The ID of the HCP Consul cluster.
- snapshot
Name 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:
- Consul
Version string - The version of Consul at the time of snapshot creation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Organization
Id string - The ID of the HCP organization where the project the HCP Consul cluster is located.
- Project
Id string - The ID of the project the HCP Consul cluster is located.
- Restored
At 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.
- Snapshot
Id string - The ID of the Consul snapshot
- State string
- The state of an HCP Consul snapshot.
- Consul
Version string - The version of Consul at the time of snapshot creation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Organization
Id string - The ID of the HCP organization where the project the HCP Consul cluster is located.
- Project
Id string - The ID of the project the HCP Consul cluster is located.
- Restored
At 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.
- Snapshot
Id string - The ID of the Consul snapshot
- State string
- The state of an HCP Consul snapshot.
- consul
Version String - The version of Consul at the time of snapshot creation.
- id String
- The provider-assigned unique ID for this managed resource.
- organization
Id String - The ID of the HCP organization where the project the HCP Consul cluster is located.
- project
Id String - The ID of the project the HCP Consul cluster is located.
- restored
At 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.
- snapshot
Id String - The ID of the Consul snapshot
- state String
- The state of an HCP Consul snapshot.
- consul
Version string - The version of Consul at the time of snapshot creation.
- id string
- The provider-assigned unique ID for this managed resource.
- organization
Id string - The ID of the HCP organization where the project the HCP Consul cluster is located.
- project
Id string - The ID of the project the HCP Consul cluster is located.
- restored
At 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.
- snapshot
Id 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.
- consul
Version String - The version of Consul at the time of snapshot creation.
- id String
- The provider-assigned unique ID for this managed resource.
- organization
Id String - The ID of the HCP organization where the project the HCP Consul cluster is located.
- project
Id String - The ID of the project the HCP Consul cluster is located.
- restored
At 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.
- snapshot
Id 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.
- Cluster
Id string - The ID of the HCP Consul cluster.
- Consul
Version string - The version of Consul at the time of snapshot creation.
- Organization
Id string - The ID of the HCP organization where the project the HCP Consul cluster is located.
- Project
Id string - The ID of the project the HCP Consul cluster is located.
- Restored
At 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.
- Snapshot
Id string - The ID of the Consul snapshot
- Snapshot
Name string - The name of the snapshot.
- State string
- The state of an HCP Consul snapshot.
- Cluster
Id string - The ID of the HCP Consul cluster.
- Consul
Version string - The version of Consul at the time of snapshot creation.
- Organization
Id string - The ID of the HCP organization where the project the HCP Consul cluster is located.
- Project
Id string - The ID of the project the HCP Consul cluster is located.
- Restored
At 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.
- Snapshot
Id string - The ID of the Consul snapshot
- Snapshot
Name string - The name of the snapshot.
- State string
- The state of an HCP Consul snapshot.
- cluster
Id String - The ID of the HCP Consul cluster.
- consul
Version String - The version of Consul at the time of snapshot creation.
- organization
Id String - The ID of the HCP organization where the project the HCP Consul cluster is located.
- project
Id String - The ID of the project the HCP Consul cluster is located.
- restored
At 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.
- snapshot
Id String - The ID of the Consul snapshot
- snapshot
Name String - The name of the snapshot.
- state String
- The state of an HCP Consul snapshot.
- cluster
Id string - The ID of the HCP Consul cluster.
- consul
Version string - The version of Consul at the time of snapshot creation.
- organization
Id string - The ID of the HCP organization where the project the HCP Consul cluster is located.
- project
Id string - The ID of the project the HCP Consul cluster is located.
- restored
At 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.
- snapshot
Id string - The ID of the Consul snapshot
- snapshot
Name 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.
- cluster
Id String - The ID of the HCP Consul cluster.
- consul
Version String - The version of Consul at the time of snapshot creation.
- organization
Id String - The ID of the HCP organization where the project the HCP Consul cluster is located.
- project
Id String - The ID of the project the HCP Consul cluster is located.
- restored
At 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.
- snapshot
Id String - The ID of the Consul snapshot
- snapshot
Name 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.