@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
298 lines • 13.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A Cloud Spanner instance partition is a unit of Cloud Spanner database capacity
* that can be used to partition data and processing capacity within an instance.
*
* To get more information about InstancePartition, see:
*
* * [API documentation](https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances.instancePartitions)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/spanner/docs/geo-partitioning)
*
* ## Example Usage
*
* ### Spanner Instance Partition Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const main = new gcp.spanner.Instance("main", {
* name: "test-instance",
* config: "nam6",
* displayName: "main-instance",
* numNodes: 1,
* edition: "ENTERPRISE_PLUS",
* });
* const partition = new gcp.spanner.InstancePartition("partition", {
* name: "test-partition",
* instance: main.name,
* config: "nam8",
* displayName: "test-spanner-partition",
* nodeCount: 1,
* });
* ```
* ### Spanner Instance Partition Autoscaling
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const main = new gcp.spanner.Instance("main", {
* name: "test-instance",
* config: "nam6",
* displayName: "main-instance",
* numNodes: 1,
* edition: "ENTERPRISE_PLUS",
* });
* const partition = new gcp.spanner.InstancePartition("partition", {
* name: "test-partition",
* instance: main.name,
* config: "nam8",
* displayName: "test-spanner-partition",
* autoscalingConfig: {
* autoscalingLimits: {
* minProcessingUnits: 1000,
* maxProcessingUnits: 2000,
* },
* autoscalingTargets: {
* highPriorityCpuUtilizationPercent: 65,
* storageUtilizationPercent: 95,
* },
* },
* });
* ```
*
* ## Import
*
* InstancePartition can be imported using any of these accepted formats:
*
* * `projects/{{project}}/instances/{{instance}}/instancePartitions/{{name}}`
* * `{{project}}/{{instance}}/{{name}}`
* * `{{instance}}/{{name}}`
*
* When using the `pulumi import` command, InstancePartition can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:spanner/instancePartition:InstancePartition default projects/{{project}}/instances/{{instance}}/instancePartitions/{{name}}
* $ pulumi import gcp:spanner/instancePartition:InstancePartition default {{project}}/{{instance}}/{{name}}
* $ pulumi import gcp:spanner/instancePartition:InstancePartition default {{instance}}/{{name}}
* ```
*/
export declare class InstancePartition extends pulumi.CustomResource {
/**
* Get an existing InstancePartition resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstancePartitionState, opts?: pulumi.CustomResourceOptions): InstancePartition;
/**
* Returns true if the given object is an instance of InstancePartition. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is InstancePartition;
/**
* The autoscaling configuration. Autoscaling is enabled if this field is set.
* Exactly one of either node_count, processing_units, or autoscalingConfig must be
* present. When autoscaling is enabled, nodeCount and processingUnits are treated as
* OUTPUT_ONLY fields and reflect the current compute capacity allocated to the
* instance partition.
* Structure is documented below.
*/
readonly autoscalingConfig: pulumi.Output<outputs.spanner.InstancePartitionAutoscalingConfig | undefined>;
/**
* The name of the instance partition's configuration (similar to a region) which
* defines the geographic placement and replication of data in this instance partition.
*/
readonly config: pulumi.Output<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* The descriptive name for this instance partition as it appears in UIs.
* Must be unique per project and between 4 and 30 characters in length.
*/
readonly displayName: pulumi.Output<string>;
/**
* The instance to create the instance partition in.
*/
readonly instance: pulumi.Output<string>;
/**
* A unique identifier for the instance partition, which cannot be changed after
* the instance partition is created. The name must be between 2 and 64 characters
* and match the regular expression [a-z][a-z0-9\\-]{0,61}[a-z0-9].
*/
readonly name: pulumi.Output<string>;
/**
* The number of nodes allocated to this instance partition. One node equals
* 1000 processing units. Exactly one of either node_count, processing_units,
* or autoscalingConfig must be present.
*/
readonly nodeCount: pulumi.Output<number>;
/**
* The number of processing units allocated to this instance partition.
* Exactly one of either node_count, processing_units, or autoscalingConfig
* must be present.
*/
readonly processingUnits: pulumi.Output<number>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The current instance partition state. Possible values are:
* CREATING: The instance partition is being created. Resources are being
* allocated for the instance partition.
* READY: The instance partition has been allocated resources and is ready for use.
*/
readonly state: pulumi.Output<string>;
/**
* Create a InstancePartition resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: InstancePartitionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering InstancePartition resources.
*/
export interface InstancePartitionState {
/**
* The autoscaling configuration. Autoscaling is enabled if this field is set.
* Exactly one of either node_count, processing_units, or autoscalingConfig must be
* present. When autoscaling is enabled, nodeCount and processingUnits are treated as
* OUTPUT_ONLY fields and reflect the current compute capacity allocated to the
* instance partition.
* Structure is documented below.
*/
autoscalingConfig?: pulumi.Input<inputs.spanner.InstancePartitionAutoscalingConfig | undefined>;
/**
* The name of the instance partition's configuration (similar to a region) which
* defines the geographic placement and replication of data in this instance partition.
*/
config?: pulumi.Input<string | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* The descriptive name for this instance partition as it appears in UIs.
* Must be unique per project and between 4 and 30 characters in length.
*/
displayName?: pulumi.Input<string | undefined>;
/**
* The instance to create the instance partition in.
*/
instance?: pulumi.Input<string | undefined>;
/**
* A unique identifier for the instance partition, which cannot be changed after
* the instance partition is created. The name must be between 2 and 64 characters
* and match the regular expression [a-z][a-z0-9\\-]{0,61}[a-z0-9].
*/
name?: pulumi.Input<string | undefined>;
/**
* The number of nodes allocated to this instance partition. One node equals
* 1000 processing units. Exactly one of either node_count, processing_units,
* or autoscalingConfig must be present.
*/
nodeCount?: pulumi.Input<number | undefined>;
/**
* The number of processing units allocated to this instance partition.
* Exactly one of either node_count, processing_units, or autoscalingConfig
* must be present.
*/
processingUnits?: pulumi.Input<number | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* The current instance partition state. Possible values are:
* CREATING: The instance partition is being created. Resources are being
* allocated for the instance partition.
* READY: The instance partition has been allocated resources and is ready for use.
*/
state?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a InstancePartition resource.
*/
export interface InstancePartitionArgs {
/**
* The autoscaling configuration. Autoscaling is enabled if this field is set.
* Exactly one of either node_count, processing_units, or autoscalingConfig must be
* present. When autoscaling is enabled, nodeCount and processingUnits are treated as
* OUTPUT_ONLY fields and reflect the current compute capacity allocated to the
* instance partition.
* Structure is documented below.
*/
autoscalingConfig?: pulumi.Input<inputs.spanner.InstancePartitionAutoscalingConfig | undefined>;
/**
* The name of the instance partition's configuration (similar to a region) which
* defines the geographic placement and replication of data in this instance partition.
*/
config: pulumi.Input<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* The descriptive name for this instance partition as it appears in UIs.
* Must be unique per project and between 4 and 30 characters in length.
*/
displayName: pulumi.Input<string>;
/**
* The instance to create the instance partition in.
*/
instance: pulumi.Input<string>;
/**
* A unique identifier for the instance partition, which cannot be changed after
* the instance partition is created. The name must be between 2 and 64 characters
* and match the regular expression [a-z][a-z0-9\\-]{0,61}[a-z0-9].
*/
name?: pulumi.Input<string | undefined>;
/**
* The number of nodes allocated to this instance partition. One node equals
* 1000 processing units. Exactly one of either node_count, processing_units,
* or autoscalingConfig must be present.
*/
nodeCount?: pulumi.Input<number | undefined>;
/**
* The number of processing units allocated to this instance partition.
* Exactly one of either node_count, processing_units, or autoscalingConfig
* must be present.
*/
processingUnits?: pulumi.Input<number | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=instancePartition.d.ts.map