StoragePool class

A Hyperdisk Storage Pool is a pre-purchased collection of capacity, throughput, and IOPS which you can then provision to your applications as needed. You can use Hyperdisk Storage Pools to create and manage disks in pools and use the disks across multiple workloads.

To get more information about StoragePool, see:

Example Usage

Compute Storage Pool Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const test_storage_pool_basic = new gcp.compute.StoragePool("test-storage-pool-basic", {
    name: "storage-pool-basic",
    poolProvisionedCapacityGb: "10240",
    poolProvisionedThroughput: "100",
    storagePoolType: "hyperdisk-throughput",
    zone: "us-central1-a",
    labels: {
        environment: "test",
        purpose: "storage-pool-testing",
        team: "infrastructure",
        cost_center: "engineering",
    },
    deletionProtection: false,
});
const project = gcp.organizations.getProject({});
import pulumi
import pulumi_gcp as gcp

test_storage_pool_basic = gcp.compute.StoragePool("test-storage-pool-basic",
    name="storage-pool-basic",
    pool_provisioned_capacity_gb="10240",
    pool_provisioned_throughput="100",
    storage_pool_type="hyperdisk-throughput",
    zone="us-central1-a",
    labels={
        "environment": "test",
        "purpose": "storage-pool-testing",
        "team": "infrastructure",
        "cost_center": "engineering",
    },
    deletion_protection=False)
project = gcp.organizations.get_project()
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var test_storage_pool_basic = new Gcp.Compute.StoragePool("test-storage-pool-basic", new()
    {
        Name = "storage-pool-basic",
        PoolProvisionedCapacityGb = "10240",
        PoolProvisionedThroughput = "100",
        StoragePoolType = "hyperdisk-throughput",
        Zone = "us-central1-a",
        Labels =
        {
            { "environment", "test" },
            { "purpose", "storage-pool-testing" },
            { "team", "infrastructure" },
            { "cost_center", "engineering" },
        },
        DeletionProtection = false,
    });

    var project = Gcp.Organizations.GetProject.Invoke();

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewStoragePool(ctx, "test-storage-pool-basic", &compute.StoragePoolArgs{
			Name:                      pulumi.String("storage-pool-basic"),
			PoolProvisionedCapacityGb: pulumi.String("10240"),
			PoolProvisionedThroughput: pulumi.String("100"),
			StoragePoolType:           pulumi.String("hyperdisk-throughput"),
			Zone:                      pulumi.String("us-central1-a"),
			Labels: pulumi.StringMap{
				"environment": pulumi.String("test"),
				"purpose":     pulumi.String("storage-pool-testing"),
				"team":        pulumi.String("infrastructure"),
				"cost_center": pulumi.String("engineering"),
			},
			DeletionProtection: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_organizations_getproject" "project" {
}

resource "gcp_compute_storagepool" "test-storage-pool-basic" {
  name                         = "storage-pool-basic"
  pool_provisioned_capacity_gb = "10240"
  pool_provisioned_throughput  = 100
  storage_pool_type            = "hyperdisk-throughput"
  zone                         = "us-central1-a"
  labels = {
    "environment" = "test"
    "purpose"     = "storage-pool-testing"
    "team"        = "infrastructure"
    "cost_center" = "engineering"
  }
  deletion_protection = false
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.StoragePool;
import com.pulumi.gcp.compute.StoragePoolArgs;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 test_storage_pool_basic = new StoragePool("test-storage-pool-basic", StoragePoolArgs.builder()
            .name("storage-pool-basic")
            .poolProvisionedCapacityGb("10240")
            .poolProvisionedThroughput("100")
            .storagePoolType("hyperdisk-throughput")
            .zone("us-central1-a")
            .labels(Map.ofEntries(
                Map.entry("environment", "test"),
                Map.entry("purpose", "storage-pool-testing"),
                Map.entry("team", "infrastructure"),
                Map.entry("cost_center", "engineering")
            ))
            .deletionProtection(false)
            .build());

        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

    }
}
resources:
  test-storage-pool-basic:
    type: gcp:compute:StoragePool
    properties:
      name: storage-pool-basic
      poolProvisionedCapacityGb: '10240'
      poolProvisionedThroughput: 100
      storagePoolType: hyperdisk-throughput
      zone: us-central1-a
      labels:
        environment: test
        purpose: storage-pool-testing
        team: infrastructure
        cost_center: engineering
      deletionProtection: false
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}

Compute Storage Pool Full

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const balanced = gcp.compute.getStoragePoolTypes({
    zone: "us-central1-a",
    storagePoolType: "hyperdisk-balanced",
});
const test_storage_pool_full = new gcp.compute.StoragePool("test-storage-pool-full", {
    name: "storage-pool-full",
    description: "Hyperdisk Balanced storage pool",
    capacityProvisioningType: "STANDARD",
    poolProvisionedCapacityGb: "10240",
    performanceProvisioningType: "STANDARD",
    poolProvisionedIops: "10000",
    poolProvisionedThroughput: "1024",
    storagePoolType: balanced.then(balanced => balanced.selfLink),
    labels: {
        environment: "test",
        purpose: "storage-pool-testing",
        team: "infrastructure",
        cost_center: "engineering",
    },
    deletionProtection: false,
    zone: "us-central1-a",
});
const project = gcp.organizations.getProject({});
import pulumi
import pulumi_gcp as gcp

balanced = gcp.compute.get_storage_pool_types(zone="us-central1-a",
    storage_pool_type="hyperdisk-balanced")
test_storage_pool_full = gcp.compute.StoragePool("test-storage-pool-full",
    name="storage-pool-full",
    description="Hyperdisk Balanced storage pool",
    capacity_provisioning_type="STANDARD",
    pool_provisioned_capacity_gb="10240",
    performance_provisioning_type="STANDARD",
    pool_provisioned_iops="10000",
    pool_provisioned_throughput="1024",
    storage_pool_type=balanced.self_link,
    labels={
        "environment": "test",
        "purpose": "storage-pool-testing",
        "team": "infrastructure",
        "cost_center": "engineering",
    },
    deletion_protection=False,
    zone="us-central1-a")
project = gcp.organizations.get_project()
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var balanced = Gcp.Compute.GetStoragePoolTypes.Invoke(new()
    {
        Zone = "us-central1-a",
        StoragePoolType = "hyperdisk-balanced",
    });

    var test_storage_pool_full = new Gcp.Compute.StoragePool("test-storage-pool-full", new()
    {
        Name = "storage-pool-full",
        Description = "Hyperdisk Balanced storage pool",
        CapacityProvisioningType = "STANDARD",
        PoolProvisionedCapacityGb = "10240",
        PerformanceProvisioningType = "STANDARD",
        PoolProvisionedIops = "10000",
        PoolProvisionedThroughput = "1024",
        StoragePoolType = balanced.Apply(getStoragePoolTypesResult => getStoragePoolTypesResult.SelfLink),
        Labels =
        {
            { "environment", "test" },
            { "purpose", "storage-pool-testing" },
            { "team", "infrastructure" },
            { "cost_center", "engineering" },
        },
        DeletionProtection = false,
        Zone = "us-central1-a",
    });

    var project = Gcp.Organizations.GetProject.Invoke();

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		balanced, err := compute.GetStoragePoolTypes(ctx, &compute.GetStoragePoolTypesArgs{
			Zone:            "us-central1-a",
			StoragePoolType: "hyperdisk-balanced",
		}, nil)
		if err != nil {
			return err
		}
		_, err = compute.NewStoragePool(ctx, "test-storage-pool-full", &compute.StoragePoolArgs{
			Name:                        pulumi.String("storage-pool-full"),
			Description:                 pulumi.String("Hyperdisk Balanced storage pool"),
			CapacityProvisioningType:    pulumi.String("STANDARD"),
			PoolProvisionedCapacityGb:   pulumi.String("10240"),
			PerformanceProvisioningType: pulumi.String("STANDARD"),
			PoolProvisionedIops:         pulumi.String("10000"),
			PoolProvisionedThroughput:   pulumi.String("1024"),
			StoragePoolType:             pulumi.String(balanced.SelfLink),
			Labels: pulumi.StringMap{
				"environment": pulumi.String("test"),
				"purpose":     pulumi.String("storage-pool-testing"),
				"team":        pulumi.String("infrastructure"),
				"cost_center": pulumi.String("engineering"),
			},
			DeletionProtection: pulumi.Bool(false),
			Zone:               pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		_, err = organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_organizations_getproject" "project" {
}
data "gcp_compute_getstoragepooltypes" "balanced" {
  zone              = "us-central1-a"
  storage_pool_type = "hyperdisk-balanced"
}

resource "gcp_compute_storagepool" "test-storage-pool-full" {
  name                          = "storage-pool-full"
  description                   = "Hyperdisk Balanced storage pool"
  capacity_provisioning_type    = "STANDARD"
  pool_provisioned_capacity_gb  = "10240"
  performance_provisioning_type = "STANDARD"
  pool_provisioned_iops         = "10000"
  pool_provisioned_throughput   = "1024"
  storage_pool_type             = data.gcp_compute_getstoragepooltypes.balanced.self_link
  labels = {
    "environment" = "test"
    "purpose"     = "storage-pool-testing"
    "team"        = "infrastructure"
    "cost_center" = "engineering"
  }
  deletion_protection = false
  zone                = "us-central1-a"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetStoragePoolTypesArgs;
import com.pulumi.gcp.compute.StoragePool;
import com.pulumi.gcp.compute.StoragePoolArgs;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        final var balanced = ComputeFunctions.getStoragePoolTypes(GetStoragePoolTypesArgs.builder()
            .zone("us-central1-a")
            .storagePoolType("hyperdisk-balanced")
            .build());

        var test_storage_pool_full = new StoragePool("test-storage-pool-full", StoragePoolArgs.builder()
            .name("storage-pool-full")
            .description("Hyperdisk Balanced storage pool")
            .capacityProvisioningType("STANDARD")
            .poolProvisionedCapacityGb("10240")
            .performanceProvisioningType("STANDARD")
            .poolProvisionedIops("10000")
            .poolProvisionedThroughput("1024")
            .storagePoolType(balanced.selfLink())
            .labels(Map.ofEntries(
                Map.entry("environment", "test"),
                Map.entry("purpose", "storage-pool-testing"),
                Map.entry("team", "infrastructure"),
                Map.entry("cost_center", "engineering")
            ))
            .deletionProtection(false)
            .zone("us-central1-a")
            .build());

        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

    }
}
resources:
  test-storage-pool-full:
    type: gcp:compute:StoragePool
    properties:
      name: storage-pool-full
      description: Hyperdisk Balanced storage pool
      capacityProvisioningType: STANDARD
      poolProvisionedCapacityGb: '10240'
      performanceProvisioningType: STANDARD
      poolProvisionedIops: '10000'
      poolProvisionedThroughput: '1024'
      storagePoolType: ${balanced.selfLink}
      labels:
        environment: test
        purpose: storage-pool-testing
        team: infrastructure
        cost_center: engineering
      deletionProtection: false
      zone: us-central1-a
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}
  balanced:
    fn::invoke:
      function: gcp:compute:getStoragePoolTypes
      arguments:
        zone: us-central1-a
        storagePoolType: hyperdisk-balanced

Import

StoragePool can be imported using any of these accepted formats:

  • projects/{{project}}/zones/{{zone}}/storagePools/{{name}}
  • {{project}}/{{zone}}/{{name}}
  • {{zone}}/{{name}}
  • {{name}}

When using the pulumi import command, StoragePool can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/storagePool:StoragePool default projects/{{project}}/zones/{{zone}}/storagePools/{{name}}
$ pulumi import gcp:compute/storagePool:StoragePool default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:compute/storagePool:StoragePool default {{zone}}/{{name}}
$ pulumi import gcp:compute/storagePool:StoragePool default {{name}}

Constructors

StoragePool(String name, {StoragePoolArgs? args, CustomResourceOptions? options})
Creates a new StoragePool. name The Pulumi resource name. args Arguments used to configure this StoragePool. The set of arguments for StoragePool. options Resource options controlling this resource's behavior.
StoragePool.reference(String urn)
Creates a typed reference to an existing StoragePool resource.

Properties

capacityProvisioningType ↔ Output<String>
Provisioning type of the byte capacity of the pool. Possible values are: STANDARD, ADVANCED.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
creationTimestamp ↔ Output<String>
Creation timestamp in RFC3339 text format.
latefinal
deletionPolicy ↔ 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.
latefinal
deletionProtection ↔ Output<bool?>
Whether Terraform will be prevented from destroying the StoragePool. When the field is set to true or unset in Terraform state, a pulumi up or terraform destroy that would delete the StoragePool will fail. When the field is set to false, deleting the StoragePool is allowed.
latefinal
description ↔ Output<String?>
A description of this resource. Provide this property when you create the resource.
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
kind ↔ Output<String>
Type of the resource.
latefinal
labelFingerprint ↔ Output<String>
The fingerprint used for optimistic locking of this resource. Used internally during updates.
latefinal
labels ↔ Output<Map<String, String>?>
Labels to apply to this storage pool. These can be later modified by the setLabels method.
latefinal
name ↔ Output<String>
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
latefinal
params ↔ Output<StoragePoolParams?>
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
latefinal
performanceProvisioningType ↔ Output<String>
Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS. Possible values are: STANDARD, ADVANCED.
latefinal
poolProvisionedCapacityGb ↔ Output<String>
Size, in GiB, of the storage pool. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools.
latefinal
poolProvisionedIops ↔ Output<String?>
Provisioned IOPS of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced.
latefinal
poolProvisionedThroughput ↔ Output<String>
Provisioned throughput, in MB/s, of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
resourceStatuses ↔ Output<List<StoragePoolResourceStatus>>
Status information for the storage pool resource. Structure is documented below.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statuses ↔ Output<List<StoragePoolStatus>>
Status information for the storage pool resource. Structure is documented below.
latefinal
storagePoolType ↔ Output<String>
Type of the storage pool. For example, the following are valid values:
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
zone ↔ Output<String>
A reference to the zone where the storage pool resides.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {StoragePoolState? state, CustomResourceOptions? options}) → StoragePool
Gets an existing StoragePool resource's state with the given name and id.