Instance Args
A Managed Lustre instance
Example Usage
Lustre Instance Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
// This example assumes this network already exists.
// The API creates a tenant network per network authorized for a
// Lustre instance and that network is not deleted when the user-created
// network (authorized_network) is deleted, so this prevents issues
// with tenant network quota.
// If this network hasn't been created and you are using this example in your
// config, add an additional network resource or change
// this from "data"to "resource"
const lustre_network = gcp.compute.getNetwork({
name: "my-network",
});
const instance = new gcp.lustre.Instance("instance", {
instanceId: "my-instance",
location: "us-central1-a",
description: "test lustre instance",
filesystem: "testfs",
capacityGib: "18000",
network: lustre_network.then(lustre_network => lustre_network.id),
labels: {
test: "value",
},
});
import pulumi
import pulumi_gcp as gcp
# This example assumes this network already exists.
# The API creates a tenant network per network authorized for a
# Lustre instance and that network is not deleted when the user-created
# network (authorized_network) is deleted, so this prevents issues
# with tenant network quota.
# If this network hasn't been created and you are using this example in your
# config, add an additional network resource or change
# this from "data"to "resource"
lustre_network = gcp.compute.get_network(name="my-network")
instance = gcp.lustre.Instance("instance",
instance_id="my-instance",
location="us-central1-a",
description="test lustre instance",
filesystem="testfs",
capacity_gib="18000",
network=lustre_network.id,
labels={
"test": "value",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
// This example assumes this network already exists.
// The API creates a tenant network per network authorized for a
// Lustre instance and that network is not deleted when the user-created
// network (authorized_network) is deleted, so this prevents issues
// with tenant network quota.
// If this network hasn't been created and you are using this example in your
// config, add an additional network resource or change
// this from "data"to "resource"
var lustre_network = Gcp.Compute.GetNetwork.Invoke(new()
{
Name = "my-network",
});
var instance = new Gcp.Lustre.Instance("instance", new()
{
InstanceId = "my-instance",
Location = "us-central1-a",
Description = "test lustre instance",
Filesystem = "testfs",
CapacityGib = "18000",
Network = lustre_network.Apply(lustre_network => lustre_network.Apply(getNetworkResult => getNetworkResult.Id)),
Labels =
{
{ "test", "value" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/lustre"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// This example assumes this network already exists.
// The API creates a tenant network per network authorized for a
// Lustre instance and that network is not deleted when the user-created
// network (authorized_network) is deleted, so this prevents issues
// with tenant network quota.
// If this network hasn't been created and you are using this example in your
// config, add an additional network resource or change
// this from "data"to "resource"
lustre_network, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
Name: "my-network",
}, nil)
if err != nil {
return err
}
_, err = lustre.NewInstance(ctx, "instance", &lustre.InstanceArgs{
InstanceId: pulumi.String("my-instance"),
Location: pulumi.String("us-central1-a"),
Description: pulumi.String("test lustre instance"),
Filesystem: pulumi.String("testfs"),
CapacityGib: pulumi.String("18000"),
Network: pulumi.String(lustre_network.Id),
Labels: pulumi.StringMap{
"test": pulumi.String("value"),
},
})
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.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.lustre.Instance;
import com.pulumi.gcp.lustre.InstanceArgs;
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) {
// This example assumes this network already exists.
// The API creates a tenant network per network authorized for a
// Lustre instance and that network is not deleted when the user-created
// network (authorized_network) is deleted, so this prevents issues
// with tenant network quota.
// If this network hasn't been created and you are using this example in your
// config, add an additional network resource or change
// this from "data"to "resource"
final var lustre-network = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("my-network")
.build());
var instance = new Instance("instance", InstanceArgs.builder()
.instanceId("my-instance")
.location("us-central1-a")
.description("test lustre instance")
.filesystem("testfs")
.capacityGib("18000")
.network(lustre_network.id())
.labels(Map.of("test", "value"))
.build());
}
}
resources:
instance:
type: gcp:lustre:Instance
properties:
instanceId: my-instance
location: us-central1-a
description: test lustre instance
filesystem: testfs
capacityGib: 18000
network: ${["lustre-network"].id}
labels:
test: value
variables:
# This example assumes this network already exists.
# // The API creates a tenant network per network authorized for a
# // Lustre instance and that network is not deleted when the user-created
# // network (authorized_network) is deleted, so this prevents issues
# // with tenant network quota.
# // If this network hasn't been created and you are using this example in your
# // config, add an additional network resource or change
# // this from "data"to "resource"
lustre-network:
fn::invoke:
function: gcp:compute:getNetwork
arguments:
name: my-network
Import
Instance can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/instances/{{instance_id}}
{{project}}/{{location}}/{{instance_id}}
{{location}}/{{instance_id}}
When using thepulumi import
command, Instance can be imported using one of the formats above. For example:
$ pulumi import gcp:lustre/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{instance_id}}
$ pulumi import gcp:lustre/instance:Instance default {{project}}/{{location}}/{{instance_id}}
$ pulumi import gcp:lustre/instance:Instance default {{location}}/{{instance_id}}
Constructors
Properties
Required. The storage capacity of the instance in gibibytes (GiB). Allowed values are from 18000 to 954000, in increments of 9000.
Optional. A user-readable description of the instance.
Required. Immutable. The filesystem name for this instance. This name is used by client-side tools, including when mounting the instance. Must be 8 characters or less and may only contain letters and numbers.
Optional. Indicates whether you want to enable support for GKE clients. By default, GKE clients are not supported.
Required. The name of the Managed Lustre instance.