All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.filestore.kotlin.InstanceArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.filestore.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.filestore.InstanceArgs.builder
import com.pulumi.gcp.filestore.kotlin.inputs.InstanceFileSharesArgs
import com.pulumi.gcp.filestore.kotlin.inputs.InstanceFileSharesArgsBuilder
import com.pulumi.gcp.filestore.kotlin.inputs.InstanceNetworkArgs
import com.pulumi.gcp.filestore.kotlin.inputs.InstanceNetworkArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Deprecated
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A Google Cloud Filestore instance.
 * To get more information about Instance, see:
 * * [API documentation](https://cloud.google.com/filestore/docs/reference/rest/v1beta1/projects.locations.instances/create)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/filestore/docs/creating-instances)
 *     * [Use with Kubernetes](https://cloud.google.com/filestore/docs/accessing-fileshares)
 *     * [Copying Data In/Out](https://cloud.google.com/filestore/docs/copying-data)
 * ## Example Usage
 * ### Filestore Instance Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const instance = new gcp.filestore.Instance("instance", {
 *     name: "test-instance",
 *     location: "us-central1-b",
 *     tier: "BASIC_HDD",
 *     fileShares: {
 *         capacityGb: 1024,
 *         name: "share1",
 *     },
 *     networks: [{
 *         network: "default",
 *         modes: ["MODE_IPV4"],
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * instance = gcp.filestore.Instance("instance",
 *     name="test-instance",
 *     location="us-central1-b",
 *     tier="BASIC_HDD",
 *     file_shares=gcp.filestore.InstanceFileSharesArgs(
 *         capacity_gb=1024,
 *         name="share1",
 *     ),
 *     networks=[gcp.filestore.InstanceNetworkArgs(
 *         network="default",
 *         modes=["MODE_IPV4"],
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.Filestore.Instance("instance", new()
 *     {
 *         Name = "test-instance",
 *         Location = "us-central1-b",
 *         Tier = "BASIC_HDD",
 *         FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
 *         {
 *             CapacityGb = 1024,
 *             Name = "share1",
 *         },
 *         Networks = new[]
 *         {
 *             new Gcp.Filestore.Inputs.InstanceNetworkArgs
 *             {
 *                 Network = "default",
 *                 Modes = new[]
 *                 {
 *                     "MODE_IPV4",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/filestore"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
 * 			Name:     pulumi.String("test-instance"),
 * 			Location: pulumi.String("us-central1-b"),
 * 			Tier:     pulumi.String("BASIC_HDD"),
 * 			FileShares: &filestore.InstanceFileSharesArgs{
 * 				CapacityGb: pulumi.Int(1024),
 * 				Name:       pulumi.String("share1"),
 * 			},
 * 			Networks: filestore.InstanceNetworkArray{
 * 				&filestore.InstanceNetworkArgs{
 * 					Network: pulumi.String("default"),
 * 					Modes: pulumi.StringArray{
 * 						pulumi.String("MODE_IPV4"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.filestore.Instance;
 * import com.pulumi.gcp.filestore.InstanceArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
 * 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 instance = new Instance("instance", InstanceArgs.builder()
 *             .name("test-instance")
 *             .location("us-central1-b")
 *             .tier("BASIC_HDD")
 *             .fileShares(InstanceFileSharesArgs.builder()
 *                 .capacityGb(1024)
 *                 .name("share1")
 *                 .build())
 *             .networks(InstanceNetworkArgs.builder()
 *                 .network("default")
 *                 .modes("MODE_IPV4")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:filestore:Instance
 *     properties:
 *       name: test-instance
 *       location: us-central1-b
 *       tier: BASIC_HDD
 *       fileShares:
 *         capacityGb: 1024
 *         name: share1
 *       networks:
 *         - network: default
 *           modes:
 *             - MODE_IPV4
 * ```
 * 
 * ### Filestore Instance Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const instance = new gcp.filestore.Instance("instance", {
 *     name: "test-instance",
 *     location: "us-central1-b",
 *     tier: "BASIC_SSD",
 *     fileShares: {
 *         capacityGb: 2560,
 *         name: "share1",
 *         nfsExportOptions: [
 *             {
 *                 ipRanges: ["10.0.0.0/24"],
 *                 accessMode: "READ_WRITE",
 *                 squashMode: "NO_ROOT_SQUASH",
 *             },
 *             {
 *                 ipRanges: ["10.10.0.0/24"],
 *                 accessMode: "READ_ONLY",
 *                 squashMode: "ROOT_SQUASH",
 *                 anonUid: 123,
 *                 anonGid: 456,
 *             },
 *         ],
 *     },
 *     networks: [{
 *         network: "default",
 *         modes: ["MODE_IPV4"],
 *         connectMode: "DIRECT_PEERING",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * instance = gcp.filestore.Instance("instance",
 *     name="test-instance",
 *     location="us-central1-b",
 *     tier="BASIC_SSD",
 *     file_shares=gcp.filestore.InstanceFileSharesArgs(
 *         capacity_gb=2560,
 *         name="share1",
 *         nfs_export_options=[
 *             gcp.filestore.InstanceFileSharesNfsExportOptionArgs(
 *                 ip_ranges=["10.0.0.0/24"],
 *                 access_mode="READ_WRITE",
 *                 squash_mode="NO_ROOT_SQUASH",
 *             ),
 *             gcp.filestore.InstanceFileSharesNfsExportOptionArgs(
 *                 ip_ranges=["10.10.0.0/24"],
 *                 access_mode="READ_ONLY",
 *                 squash_mode="ROOT_SQUASH",
 *                 anon_uid=123,
 *                 anon_gid=456,
 *             ),
 *         ],
 *     ),
 *     networks=[gcp.filestore.InstanceNetworkArgs(
 *         network="default",
 *         modes=["MODE_IPV4"],
 *         connect_mode="DIRECT_PEERING",
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.Filestore.Instance("instance", new()
 *     {
 *         Name = "test-instance",
 *         Location = "us-central1-b",
 *         Tier = "BASIC_SSD",
 *         FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
 *         {
 *             CapacityGb = 2560,
 *             Name = "share1",
 *             NfsExportOptions = new[]
 *             {
 *                 new Gcp.Filestore.Inputs.InstanceFileSharesNfsExportOptionArgs
 *                 {
 *                     IpRanges = new[]
 *                     {
 *                         "10.0.0.0/24",
 *                     },
 *                     AccessMode = "READ_WRITE",
 *                     SquashMode = "NO_ROOT_SQUASH",
 *                 },
 *                 new Gcp.Filestore.Inputs.InstanceFileSharesNfsExportOptionArgs
 *                 {
 *                     IpRanges = new[]
 *                     {
 *                         "10.10.0.0/24",
 *                     },
 *                     AccessMode = "READ_ONLY",
 *                     SquashMode = "ROOT_SQUASH",
 *                     AnonUid = 123,
 *                     AnonGid = 456,
 *                 },
 *             },
 *         },
 *         Networks = new[]
 *         {
 *             new Gcp.Filestore.Inputs.InstanceNetworkArgs
 *             {
 *                 Network = "default",
 *                 Modes = new[]
 *                 {
 *                     "MODE_IPV4",
 *                 },
 *                 ConnectMode = "DIRECT_PEERING",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/filestore"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
 * 			Name:     pulumi.String("test-instance"),
 * 			Location: pulumi.String("us-central1-b"),
 * 			Tier:     pulumi.String("BASIC_SSD"),
 * 			FileShares: &filestore.InstanceFileSharesArgs{
 * 				CapacityGb: pulumi.Int(2560),
 * 				Name:       pulumi.String("share1"),
 * 				NfsExportOptions: filestore.InstanceFileSharesNfsExportOptionArray{
 * 					&filestore.InstanceFileSharesNfsExportOptionArgs{
 * 						IpRanges: pulumi.StringArray{
 * 							pulumi.String("10.0.0.0/24"),
 * 						},
 * 						AccessMode: pulumi.String("READ_WRITE"),
 * 						SquashMode: pulumi.String("NO_ROOT_SQUASH"),
 * 					},
 * 					&filestore.InstanceFileSharesNfsExportOptionArgs{
 * 						IpRanges: pulumi.StringArray{
 * 							pulumi.String("10.10.0.0/24"),
 * 						},
 * 						AccessMode: pulumi.String("READ_ONLY"),
 * 						SquashMode: pulumi.String("ROOT_SQUASH"),
 * 						AnonUid:    pulumi.Int(123),
 * 						AnonGid:    pulumi.Int(456),
 * 					},
 * 				},
 * 			},
 * 			Networks: filestore.InstanceNetworkArray{
 * 				&filestore.InstanceNetworkArgs{
 * 					Network: pulumi.String("default"),
 * 					Modes: pulumi.StringArray{
 * 						pulumi.String("MODE_IPV4"),
 * 					},
 * 					ConnectMode: pulumi.String("DIRECT_PEERING"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.filestore.Instance;
 * import com.pulumi.gcp.filestore.InstanceArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
 * 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 instance = new Instance("instance", InstanceArgs.builder()
 *             .name("test-instance")
 *             .location("us-central1-b")
 *             .tier("BASIC_SSD")
 *             .fileShares(InstanceFileSharesArgs.builder()
 *                 .capacityGb(2560)
 *                 .name("share1")
 *                 .nfsExportOptions(
 *                     InstanceFileSharesNfsExportOptionArgs.builder()
 *                         .ipRanges("10.0.0.0/24")
 *                         .accessMode("READ_WRITE")
 *                         .squashMode("NO_ROOT_SQUASH")
 *                         .build(),
 *                     InstanceFileSharesNfsExportOptionArgs.builder()
 *                         .ipRanges("10.10.0.0/24")
 *                         .accessMode("READ_ONLY")
 *                         .squashMode("ROOT_SQUASH")
 *                         .anonUid(123)
 *                         .anonGid(456)
 *                         .build())
 *                 .build())
 *             .networks(InstanceNetworkArgs.builder()
 *                 .network("default")
 *                 .modes("MODE_IPV4")
 *                 .connectMode("DIRECT_PEERING")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:filestore:Instance
 *     properties:
 *       name: test-instance
 *       location: us-central1-b
 *       tier: BASIC_SSD
 *       fileShares:
 *         capacityGb: 2560
 *         name: share1
 *         nfsExportOptions:
 *           - ipRanges:
 *               - 10.0.0.0/24
 *             accessMode: READ_WRITE
 *             squashMode: NO_ROOT_SQUASH
 *           - ipRanges:
 *               - 10.10.0.0/24
 *             accessMode: READ_ONLY
 *             squashMode: ROOT_SQUASH
 *             anonUid: 123
 *             anonGid: 456
 *       networks:
 *         - network: default
 *           modes:
 *             - MODE_IPV4
 *           connectMode: DIRECT_PEERING
 * ```
 * 
 * ### Filestore Instance Protocol
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const instance = new gcp.filestore.Instance("instance", {
 *     name: "test-instance",
 *     location: "us-central1",
 *     tier: "ENTERPRISE",
 *     protocol: "NFS_V4_1",
 *     fileShares: {
 *         capacityGb: 1024,
 *         name: "share1",
 *     },
 *     networks: [{
 *         network: "default",
 *         modes: ["MODE_IPV4"],
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * instance = gcp.filestore.Instance("instance",
 *     name="test-instance",
 *     location="us-central1",
 *     tier="ENTERPRISE",
 *     protocol="NFS_V4_1",
 *     file_shares=gcp.filestore.InstanceFileSharesArgs(
 *         capacity_gb=1024,
 *         name="share1",
 *     ),
 *     networks=[gcp.filestore.InstanceNetworkArgs(
 *         network="default",
 *         modes=["MODE_IPV4"],
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.Filestore.Instance("instance", new()
 *     {
 *         Name = "test-instance",
 *         Location = "us-central1",
 *         Tier = "ENTERPRISE",
 *         Protocol = "NFS_V4_1",
 *         FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
 *         {
 *             CapacityGb = 1024,
 *             Name = "share1",
 *         },
 *         Networks = new[]
 *         {
 *             new Gcp.Filestore.Inputs.InstanceNetworkArgs
 *             {
 *                 Network = "default",
 *                 Modes = new[]
 *                 {
 *                     "MODE_IPV4",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/filestore"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
 * 			Name:     pulumi.String("test-instance"),
 * 			Location: pulumi.String("us-central1"),
 * 			Tier:     pulumi.String("ENTERPRISE"),
 * 			Protocol: pulumi.String("NFS_V4_1"),
 * 			FileShares: &filestore.InstanceFileSharesArgs{
 * 				CapacityGb: pulumi.Int(1024),
 * 				Name:       pulumi.String("share1"),
 * 			},
 * 			Networks: filestore.InstanceNetworkArray{
 * 				&filestore.InstanceNetworkArgs{
 * 					Network: pulumi.String("default"),
 * 					Modes: pulumi.StringArray{
 * 						pulumi.String("MODE_IPV4"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.filestore.Instance;
 * import com.pulumi.gcp.filestore.InstanceArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
 * 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 instance = new Instance("instance", InstanceArgs.builder()
 *             .name("test-instance")
 *             .location("us-central1")
 *             .tier("ENTERPRISE")
 *             .protocol("NFS_V4_1")
 *             .fileShares(InstanceFileSharesArgs.builder()
 *                 .capacityGb(1024)
 *                 .name("share1")
 *                 .build())
 *             .networks(InstanceNetworkArgs.builder()
 *                 .network("default")
 *                 .modes("MODE_IPV4")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:filestore:Instance
 *     properties:
 *       name: test-instance
 *       location: us-central1
 *       tier: ENTERPRISE
 *       protocol: NFS_V4_1
 *       fileShares:
 *         capacityGb: 1024
 *         name: share1
 *       networks:
 *         - network: default
 *           modes:
 *             - MODE_IPV4
 * ```
 * 
 * ### Filestore Instance Enterprise
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const filestoreKeyring = new gcp.kms.KeyRing("filestore_keyring", {
 *     name: "filestore-keyring",
 *     location: "us-central1",
 * });
 * const filestoreKey = new gcp.kms.CryptoKey("filestore_key", {
 *     name: "filestore-key",
 *     keyRing: filestoreKeyring.id,
 * });
 * const instance = new gcp.filestore.Instance("instance", {
 *     name: "test-instance",
 *     location: "us-central1",
 *     tier: "ENTERPRISE",
 *     fileShares: {
 *         capacityGb: 1024,
 *         name: "share1",
 *     },
 *     networks: [{
 *         network: "default",
 *         modes: ["MODE_IPV4"],
 *     }],
 *     kmsKeyName: filestoreKey.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * filestore_keyring = gcp.kms.KeyRing("filestore_keyring",
 *     name="filestore-keyring",
 *     location="us-central1")
 * filestore_key = gcp.kms.CryptoKey("filestore_key",
 *     name="filestore-key",
 *     key_ring=filestore_keyring.id)
 * instance = gcp.filestore.Instance("instance",
 *     name="test-instance",
 *     location="us-central1",
 *     tier="ENTERPRISE",
 *     file_shares=gcp.filestore.InstanceFileSharesArgs(
 *         capacity_gb=1024,
 *         name="share1",
 *     ),
 *     networks=[gcp.filestore.InstanceNetworkArgs(
 *         network="default",
 *         modes=["MODE_IPV4"],
 *     )],
 *     kms_key_name=filestore_key.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var filestoreKeyring = new Gcp.Kms.KeyRing("filestore_keyring", new()
 *     {
 *         Name = "filestore-keyring",
 *         Location = "us-central1",
 *     });
 *     var filestoreKey = new Gcp.Kms.CryptoKey("filestore_key", new()
 *     {
 *         Name = "filestore-key",
 *         KeyRing = filestoreKeyring.Id,
 *     });
 *     var instance = new Gcp.Filestore.Instance("instance", new()
 *     {
 *         Name = "test-instance",
 *         Location = "us-central1",
 *         Tier = "ENTERPRISE",
 *         FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
 *         {
 *             CapacityGb = 1024,
 *             Name = "share1",
 *         },
 *         Networks = new[]
 *         {
 *             new Gcp.Filestore.Inputs.InstanceNetworkArgs
 *             {
 *                 Network = "default",
 *                 Modes = new[]
 *                 {
 *                     "MODE_IPV4",
 *                 },
 *             },
 *         },
 *         KmsKeyName = filestoreKey.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/filestore"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		filestoreKeyring, err := kms.NewKeyRing(ctx, "filestore_keyring", &kms.KeyRingArgs{
 * 			Name:     pulumi.String("filestore-keyring"),
 * 			Location: pulumi.String("us-central1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		filestoreKey, err := kms.NewCryptoKey(ctx, "filestore_key", &kms.CryptoKeyArgs{
 * 			Name:    pulumi.String("filestore-key"),
 * 			KeyRing: filestoreKeyring.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
 * 			Name:     pulumi.String("test-instance"),
 * 			Location: pulumi.String("us-central1"),
 * 			Tier:     pulumi.String("ENTERPRISE"),
 * 			FileShares: &filestore.InstanceFileSharesArgs{
 * 				CapacityGb: pulumi.Int(1024),
 * 				Name:       pulumi.String("share1"),
 * 			},
 * 			Networks: filestore.InstanceNetworkArray{
 * 				&filestore.InstanceNetworkArgs{
 * 					Network: pulumi.String("default"),
 * 					Modes: pulumi.StringArray{
 * 						pulumi.String("MODE_IPV4"),
 * 					},
 * 				},
 * 			},
 * 			KmsKeyName: filestoreKey.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.kms.KeyRing;
 * import com.pulumi.gcp.kms.KeyRingArgs;
 * import com.pulumi.gcp.kms.CryptoKey;
 * import com.pulumi.gcp.kms.CryptoKeyArgs;
 * import com.pulumi.gcp.filestore.Instance;
 * import com.pulumi.gcp.filestore.InstanceArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
 * import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
 * 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 filestoreKeyring = new KeyRing("filestoreKeyring", KeyRingArgs.builder()
 *             .name("filestore-keyring")
 *             .location("us-central1")
 *             .build());
 *         var filestoreKey = new CryptoKey("filestoreKey", CryptoKeyArgs.builder()
 *             .name("filestore-key")
 *             .keyRing(filestoreKeyring.id())
 *             .build());
 *         var instance = new Instance("instance", InstanceArgs.builder()
 *             .name("test-instance")
 *             .location("us-central1")
 *             .tier("ENTERPRISE")
 *             .fileShares(InstanceFileSharesArgs.builder()
 *                 .capacityGb(1024)
 *                 .name("share1")
 *                 .build())
 *             .networks(InstanceNetworkArgs.builder()
 *                 .network("default")
 *                 .modes("MODE_IPV4")
 *                 .build())
 *             .kmsKeyName(filestoreKey.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:filestore:Instance
 *     properties:
 *       name: test-instance
 *       location: us-central1
 *       tier: ENTERPRISE
 *       fileShares:
 *         capacityGb: 1024
 *         name: share1
 *       networks:
 *         - network: default
 *           modes:
 *             - MODE_IPV4
 *       kmsKeyName: ${filestoreKey.id}
 *   filestoreKeyring:
 *     type: gcp:kms:KeyRing
 *     name: filestore_keyring
 *     properties:
 *       name: filestore-keyring
 *       location: us-central1
 *   filestoreKey:
 *     type: gcp:kms:CryptoKey
 *     name: filestore_key
 *     properties:
 *       name: filestore-key
 *       keyRing: ${filestoreKeyring.id}
 * ```
 * 
 * ## Import
 * Instance can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/instances/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:filestore/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:filestore/instance:Instance default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:filestore/instance:Instance default {{location}}/{{name}}
 * ```
 * @property description A description of the instance.
 * @property fileShares File system shares on the instance. For this version, only a
 * single file share is supported.
 * Structure is documented below.
 * @property kmsKeyName KMS key name used for data encryption.
 * @property labels Resource labels to represent user-provided metadata. **Note**: This field is non-authoritative, and will only manage the
 * labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the
 * resource.
 * @property location The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
 * @property name The resource name of the instance.
 * @property networks VPC networks to which the instance is connected. For this version,
 * only a single network is supported.
 * Structure is documented below.
 * @property project
 * @property protocol Either NFSv3, for using NFS version 3 as file sharing protocol, or NFSv4.1, for using NFS version 4.1 as file sharing
 * protocol. NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE. The default is NFSv3. Default value:
 * "NFS_V3" Possible values: ["NFS_V3", "NFS_V4_1"]
 * @property tier The service tier of the instance.
 * Possible values include: STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE
 * @property zone The name of the Filestore zone of the instance.
 */
public data class InstanceArgs(
    public val description: Output? = null,
    public val fileShares: Output? = null,
    public val kmsKeyName: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val networks: Output>? = null,
    public val project: Output? = null,
    public val protocol: Output? = null,
    public val tier: Output? = null,
    @Deprecated(
        message = """
  `zone` is deprecated and will be removed in a future major release. Use `location` instead.
  """,
    )
    public val zone: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.filestore.InstanceArgs =
        com.pulumi.gcp.filestore.InstanceArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .fileShares(fileShares?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .kmsKeyName(kmsKeyName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .networks(
                networks?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .project(project?.applyValue({ args0 -> args0 }))
            .protocol(protocol?.applyValue({ args0 -> args0 }))
            .tier(tier?.applyValue({ args0 -> args0 }))
            .zone(zone?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceArgs].
 */
@PulumiTagMarker
public class InstanceArgsBuilder internal constructor() {
    private var description: Output? = null

    private var fileShares: Output? = null

    private var kmsKeyName: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var networks: Output>? = null

    private var project: Output? = null

    private var protocol: Output? = null

    private var tier: Output? = null

    private var zone: Output? = null

    /**
     * @param value A description of the instance.
     */
    @JvmName("pjwfobwbduikljrs")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value File system shares on the instance. For this version, only a
     * single file share is supported.
     * Structure is documented below.
     */
    @JvmName("pnudrwuvydhpfiaq")
    public suspend fun fileShares(`value`: Output) {
        this.fileShares = value
    }

    /**
     * @param value KMS key name used for data encryption.
     */
    @JvmName("gomijdhfvdlouhxs")
    public suspend fun kmsKeyName(`value`: Output) {
        this.kmsKeyName = value
    }

    /**
     * @param value Resource labels to represent user-provided metadata. **Note**: This field is non-authoritative, and will only manage the
     * labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the
     * resource.
     */
    @JvmName("quggnblusaxtssnx")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
     */
    @JvmName("vvvgeiuubglbwdet")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The resource name of the instance.
     */
    @JvmName("tucgtigueebidvai")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("thyuemmuyrrovxxb")
    public suspend fun networks(`value`: Output>) {
        this.networks = value
    }

    @JvmName("jkvovevkliyelety")
    public suspend fun networks(vararg values: Output) {
        this.networks = Output.all(values.asList())
    }

    /**
     * @param values VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("bjjwqkweffwguujm")
    public suspend fun networks(values: List>) {
        this.networks = Output.all(values)
    }

    /**
     * @param value
     */
    @JvmName("dvysnhupgxhlmbka")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Either NFSv3, for using NFS version 3 as file sharing protocol, or NFSv4.1, for using NFS version 4.1 as file sharing
     * protocol. NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE. The default is NFSv3. Default value:
     * "NFS_V3" Possible values: ["NFS_V3", "NFS_V4_1"]
     */
    @JvmName("abgbyilchfrdtujo")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value The service tier of the instance.
     * Possible values include: STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE
     */
    @JvmName("pnebnbgrccsurcty")
    public suspend fun tier(`value`: Output) {
        this.tier = value
    }

    /**
     * @param value The name of the Filestore zone of the instance.
     */
    @Deprecated(
        message = """
  `zone` is deprecated and will be removed in a future major release. Use `location` instead.
  """,
    )
    @JvmName("fauauyfaagidkjai")
    public suspend fun zone(`value`: Output) {
        this.zone = value
    }

    /**
     * @param value A description of the instance.
     */
    @JvmName("opfsenhujtypkpyg")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value File system shares on the instance. For this version, only a
     * single file share is supported.
     * Structure is documented below.
     */
    @JvmName("nukagjpdkquwwfjh")
    public suspend fun fileShares(`value`: InstanceFileSharesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fileShares = mapped
    }

    /**
     * @param argument File system shares on the instance. For this version, only a
     * single file share is supported.
     * Structure is documented below.
     */
    @JvmName("kjcsurxathcoahgd")
    public suspend fun fileShares(argument: suspend InstanceFileSharesArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFileSharesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.fileShares = mapped
    }

    /**
     * @param value KMS key name used for data encryption.
     */
    @JvmName("scthqkoegfjmjjng")
    public suspend fun kmsKeyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kmsKeyName = mapped
    }

    /**
     * @param value Resource labels to represent user-provided metadata. **Note**: This field is non-authoritative, and will only manage the
     * labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the
     * resource.
     */
    @JvmName("rugjvtpewbcdtfly")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Resource labels to represent user-provided metadata. **Note**: This field is non-authoritative, and will only manage the
     * labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the
     * resource.
     */
    @JvmName("rkyqkaqabwgocfnt")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
     */
    @JvmName("kmoquetevslikxkc")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The resource name of the instance.
     */
    @JvmName("aljwmqtheqjgieik")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("puluvpmsiuameoxw")
    public suspend fun networks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networks = mapped
    }

    /**
     * @param argument VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("jsyivdmncswhgjas")
    public suspend fun networks(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceNetworkArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.networks = mapped
    }

    /**
     * @param argument VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("sydyqcbdbhffnvge")
    public suspend fun networks(vararg argument: suspend InstanceNetworkArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceNetworkArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.networks = mapped
    }

    /**
     * @param argument VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("lgfimffhcaoiaydv")
    public suspend fun networks(argument: suspend InstanceNetworkArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InstanceNetworkArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.networks = mapped
    }

    /**
     * @param values VPC networks to which the instance is connected. For this version,
     * only a single network is supported.
     * Structure is documented below.
     */
    @JvmName("dtgqwsukwdpbnyvk")
    public suspend fun networks(vararg values: InstanceNetworkArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.networks = mapped
    }

    /**
     * @param value
     */
    @JvmName("pvucdepereolmpbk")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Either NFSv3, for using NFS version 3 as file sharing protocol, or NFSv4.1, for using NFS version 4.1 as file sharing
     * protocol. NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE. The default is NFSv3. Default value:
     * "NFS_V3" Possible values: ["NFS_V3", "NFS_V4_1"]
     */
    @JvmName("mcvcxxugxjngnkyu")
    public suspend fun protocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The service tier of the instance.
     * Possible values include: STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE
     */
    @JvmName("iylhwlvhiynpngyg")
    public suspend fun tier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tier = mapped
    }

    /**
     * @param value The name of the Filestore zone of the instance.
     */
    @Deprecated(
        message = """
  `zone` is deprecated and will be removed in a future major release. Use `location` instead.
  """,
    )
    @JvmName("skaqoxqaidgxcyns")
    public suspend fun zone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zone = mapped
    }

    internal fun build(): InstanceArgs = InstanceArgs(
        description = description,
        fileShares = fileShares,
        kmsKeyName = kmsKeyName,
        labels = labels,
        location = location,
        name = name,
        networks = networks,
        project = project,
        protocol = protocol,
        tier = tier,
        zone = zone,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy