getStoragePool function

Future<GetStoragePoolResult> getStoragePool(
  1. GetStoragePoolArgs args, {
  2. InvokeOptions? options,
})

Provides access to available Google Compute Storage Pool resources for a given project and zone. See more about Hyperdisk Storage Pools in the upstream docs.

Example Usage

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

const myPool = gcp.compute.getStoragePool({
    name: "my-storage-pool",
    zone: "us-central1-a",
});
export const poolCapacity = myPool.then(myPool => myPool.poolProvisionedCapacityGb);
export const poolType = myPool.then(myPool => myPool.storagePoolType);
import pulumi
import pulumi_gcp as gcp

my_pool = gcp.compute.get_storage_pool(name="my-storage-pool",
    zone="us-central1-a")
pulumi.export("poolCapacity", my_pool.pool_provisioned_capacity_gb)
pulumi.export("poolType", my_pool.storage_pool_type)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var myPool = Gcp.Compute.GetStoragePool.Invoke(new()
    {
        Name = "my-storage-pool",
        Zone = "us-central1-a",
    });

    return new Dictionary<string, object?>
    {
        ["poolCapacity"] = myPool.Apply(getStoragePoolResult => getStoragePoolResult.PoolProvisionedCapacityGb),
        ["poolType"] = myPool.Apply(getStoragePoolResult => getStoragePoolResult.StoragePoolType),
    };
});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myPool, err := compute.LookupStoragePool(ctx, &compute.LookupStoragePoolArgs{
			Name: "my-storage-pool",
			Zone: "us-central1-a",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("poolCapacity", myPool.PoolProvisionedCapacityGb)
		ctx.Export("poolType", myPool.StoragePoolType)
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_compute_getstoragepool" "myPool" {
  name = "my-storage-pool"
  zone = "us-central1-a"
}

output "poolCapacity" {
  value = data.gcp_compute_getstoragepool.myPool.pool_provisioned_capacity_gb
}
output "poolType" {
  value = data.gcp_compute_getstoragepool.myPool.storage_pool_type
}
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.GetStoragePoolArgs;
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 myPool = ComputeFunctions.getStoragePool(GetStoragePoolArgs.builder()
            .name("my-storage-pool")
            .zone("us-central1-a")
            .build());

        ctx.export("poolCapacity", myPool.poolProvisionedCapacityGb());
        ctx.export("poolType", myPool.storagePoolType());
    }
}
variables:
  myPool:
    fn::invoke:
      function: gcp:compute:getStoragePool
      arguments:
        name: my-storage-pool
        zone: us-central1-a
outputs:
  poolCapacity: ${myPool.poolProvisionedCapacityGb}
  poolType: ${myPool.storagePoolType}

Note

  • deletionProtection is always set to false on the data source and will not be represetative of the actual value on gcp.compute.StoragePool reaosure being read args Arguments passed to this invoke. Arguments for getStoragePool. options Invoke options controlling this call.

Implementation

Future<GetStoragePoolResult> getStoragePool(
  GetStoragePoolArgs args, {
  pulumi.InvokeOptions? options,
}) async {
  final deployment = pulumi.Deployment.instance;
  final result = await deployment.invoke<Map<String, dynamic>>(
    'gcp:compute/getStoragePool:getStoragePool',
    args.toMap(),
    options: pulumi.toDeploymentInvokeOptions(options),
  );
  return GetStoragePoolResult.fromMap(result);
}