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

com.pulumi.gcp.memorystore.kotlin.Instance.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.20.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.memorystore.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceDesiredPscAutoConnection
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceDiscoveryEndpoint
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceNodeConfig
import com.pulumi.gcp.memorystore.kotlin.outputs.InstancePersistenceConfig
import com.pulumi.gcp.memorystore.kotlin.outputs.InstancePscAutoConnection
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceStateInfo
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceZoneDistributionConfig
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceDesiredPscAutoConnection.Companion.toKotlin as instanceDesiredPscAutoConnectionToKotlin
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceDiscoveryEndpoint.Companion.toKotlin as instanceDiscoveryEndpointToKotlin
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceNodeConfig.Companion.toKotlin as instanceNodeConfigToKotlin
import com.pulumi.gcp.memorystore.kotlin.outputs.InstancePersistenceConfig.Companion.toKotlin as instancePersistenceConfigToKotlin
import com.pulumi.gcp.memorystore.kotlin.outputs.InstancePscAutoConnection.Companion.toKotlin as instancePscAutoConnectionToKotlin
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceStateInfo.Companion.toKotlin as instanceStateInfoToKotlin
import com.pulumi.gcp.memorystore.kotlin.outputs.InstanceZoneDistributionConfig.Companion.toKotlin as instanceZoneDistributionConfigToKotlin

/**
 * Builder for [Instance].
 */
@PulumiTagMarker
public class InstanceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: InstanceArgs = InstanceArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend InstanceArgsBuilder.() -> Unit) {
        val builder = InstanceArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Instance {
        val builtJavaResource = com.pulumi.gcp.memorystore.Instance(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Instance(builtJavaResource)
    }
}

/**
 * A Google Cloud Memorystore instance.
 * ## Example Usage
 * ### Memorystore Instance Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "my-subnet",
 *     ipCidrRange: "10.0.0.248/29",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
 *     name: "my-policy",
 *     location: "us-central1",
 *     serviceClass: "gcp-memorystore",
 *     description: "my basic service connection policy",
 *     network: producerNet.id,
 *     pscConfig: {
 *         subnetworks: [producerSubnet.id],
 *     },
 * });
 * const project = gcp.organizations.getProject({});
 * const instance_basic = new gcp.memorystore.Instance("instance-basic", {
 *     instanceId: "basic-instance",
 *     shardCount: 3,
 *     desiredPscAutoConnections: [{
 *         network: producerNet.id,
 *         projectId: project.then(project => project.projectId),
 *     }],
 *     location: "us-central1",
 *     deletionProtectionEnabled: false,
 * }, {
 *     dependsOn: [_default],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * producer_net = gcp.compute.Network("producer_net",
 *     name="my-network",
 *     auto_create_subnetworks=False)
 * producer_subnet = gcp.compute.Subnetwork("producer_subnet",
 *     name="my-subnet",
 *     ip_cidr_range="10.0.0.248/29",
 *     region="us-central1",
 *     network=producer_net.id)
 * default = gcp.networkconnectivity.ServiceConnectionPolicy("default",
 *     name="my-policy",
 *     location="us-central1",
 *     service_class="gcp-memorystore",
 *     description="my basic service connection policy",
 *     network=producer_net.id,
 *     psc_config={
 *         "subnetworks": [producer_subnet.id],
 *     })
 * project = gcp.organizations.get_project()
 * instance_basic = gcp.memorystore.Instance("instance-basic",
 *     instance_id="basic-instance",
 *     shard_count=3,
 *     desired_psc_auto_connections=[{
 *         "network": producer_net.id,
 *         "project_id": project.project_id,
 *     }],
 *     location="us-central1",
 *     deletion_protection_enabled=False,
 *     opts = pulumi.ResourceOptions(depends_on=[default]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var producerNet = new Gcp.Compute.Network("producer_net", new()
 *     {
 *         Name = "my-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var producerSubnet = new Gcp.Compute.Subnetwork("producer_subnet", new()
 *     {
 *         Name = "my-subnet",
 *         IpCidrRange = "10.0.0.248/29",
 *         Region = "us-central1",
 *         Network = producerNet.Id,
 *     });
 *     var @default = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("default", new()
 *     {
 *         Name = "my-policy",
 *         Location = "us-central1",
 *         ServiceClass = "gcp-memorystore",
 *         Description = "my basic service connection policy",
 *         Network = producerNet.Id,
 *         PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
 *         {
 *             Subnetworks = new[]
 *             {
 *                 producerSubnet.Id,
 *             },
 *         },
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var instance_basic = new Gcp.MemoryStore.Instance("instance-basic", new()
 *     {
 *         InstanceId = "basic-instance",
 *         ShardCount = 3,
 *         DesiredPscAutoConnections = new[]
 *         {
 *             new Gcp.MemoryStore.Inputs.InstanceDesiredPscAutoConnectionArgs
 *             {
 *                 Network = producerNet.Id,
 *                 ProjectId = project.Apply(getProjectResult => getProjectResult.ProjectId),
 *             },
 *         },
 *         Location = "us-central1",
 *         DeletionProtectionEnabled = false,
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             @default,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/memorystore"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		producerNet, err := compute.NewNetwork(ctx, "producer_net", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		producerSubnet, err := compute.NewSubnetwork(ctx, "producer_subnet", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("my-subnet"),
 * 			IpCidrRange: pulumi.String("10.0.0.248/29"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Network:     producerNet.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewServiceConnectionPolicy(ctx, "default", &networkconnectivity.ServiceConnectionPolicyArgs{
 * 			Name:         pulumi.String("my-policy"),
 * 			Location:     pulumi.String("us-central1"),
 * 			ServiceClass: pulumi.String("gcp-memorystore"),
 * 			Description:  pulumi.String("my basic service connection policy"),
 * 			Network:      producerNet.ID(),
 * 			PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
 * 				Subnetworks: pulumi.StringArray{
 * 					producerSubnet.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = memorystore.NewInstance(ctx, "instance-basic", &memorystore.InstanceArgs{
 * 			InstanceId: pulumi.String("basic-instance"),
 * 			ShardCount: pulumi.Int(3),
 * 			DesiredPscAutoConnections: memorystore.InstanceDesiredPscAutoConnectionArray{
 * 				&memorystore.InstanceDesiredPscAutoConnectionArgs{
 * 					Network:   producerNet.ID(),
 * 					ProjectId: pulumi.String(project.ProjectId),
 * 				},
 * 			},
 * 			Location:                  pulumi.String("us-central1"),
 * 			DeletionProtectionEnabled: pulumi.Bool(false),
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			_default,
 * 		}))
 * 		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.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.memorystore.Instance;
 * import com.pulumi.gcp.memorystore.InstanceArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstanceDesiredPscAutoConnectionArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 producerNet = new Network("producerNet", NetworkArgs.builder()
 *             .name("my-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder()
 *             .name("my-subnet")
 *             .ipCidrRange("10.0.0.248/29")
 *             .region("us-central1")
 *             .network(producerNet.id())
 *             .build());
 *         var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder()
 *             .name("my-policy")
 *             .location("us-central1")
 *             .serviceClass("gcp-memorystore")
 *             .description("my basic service connection policy")
 *             .network(producerNet.id())
 *             .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
 *                 .subnetworks(producerSubnet.id())
 *                 .build())
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var instance_basic = new Instance("instance-basic", InstanceArgs.builder()
 *             .instanceId("basic-instance")
 *             .shardCount(3)
 *             .desiredPscAutoConnections(InstanceDesiredPscAutoConnectionArgs.builder()
 *                 .network(producerNet.id())
 *                 .projectId(project.applyValue(getProjectResult -> getProjectResult.projectId()))
 *                 .build())
 *             .location("us-central1")
 *             .deletionProtectionEnabled(false)
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(default_)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance-basic:
 *     type: gcp:memorystore:Instance
 *     properties:
 *       instanceId: basic-instance
 *       shardCount: 3
 *       desiredPscAutoConnections:
 *         - network: ${producerNet.id}
 *           projectId: ${project.projectId}
 *       location: us-central1
 *       deletionProtectionEnabled: false
 *     options:
 *       dependsOn:
 *         - ${default}
 *   default:
 *     type: gcp:networkconnectivity:ServiceConnectionPolicy
 *     properties:
 *       name: my-policy
 *       location: us-central1
 *       serviceClass: gcp-memorystore
 *       description: my basic service connection policy
 *       network: ${producerNet.id}
 *       pscConfig:
 *         subnetworks:
 *           - ${producerSubnet.id}
 *   producerSubnet:
 *     type: gcp:compute:Subnetwork
 *     name: producer_subnet
 *     properties:
 *       name: my-subnet
 *       ipCidrRange: 10.0.0.248/29
 *       region: us-central1
 *       network: ${producerNet.id}
 *   producerNet:
 *     type: gcp:compute:Network
 *     name: producer_net
 *     properties:
 *       name: my-network
 *       autoCreateSubnetworks: false
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Memorystore Instance Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "my-subnet",
 *     ipCidrRange: "10.0.0.248/29",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
 *     name: "my-policy",
 *     location: "us-central1",
 *     serviceClass: "gcp-memorystore",
 *     description: "my basic service connection policy",
 *     network: producerNet.id,
 *     pscConfig: {
 *         subnetworks: [producerSubnet.id],
 *     },
 * });
 * const project = gcp.organizations.getProject({});
 * const instance_full = new gcp.memorystore.Instance("instance-full", {
 *     instanceId: "full-instance",
 *     shardCount: 3,
 *     desiredPscAutoConnections: [{
 *         network: producerNet.id,
 *         projectId: project.then(project => project.projectId),
 *     }],
 *     location: "us-central1",
 *     replicaCount: 2,
 *     nodeType: "SHARED_CORE_NANO",
 *     transitEncryptionMode: "TRANSIT_ENCRYPTION_DISABLED",
 *     authorizationMode: "AUTH_DISABLED",
 *     engineConfigs: {
 *         "maxmemory-policy": "volatile-ttl",
 *     },
 *     zoneDistributionConfig: {
 *         mode: "SINGLE_ZONE",
 *         zone: "us-central1-b",
 *     },
 *     engineVersion: "VALKEY_7_2",
 *     deletionProtectionEnabled: false,
 *     mode: "CLUSTER",
 *     persistenceConfig: {
 *         mode: "RDB",
 *         rdbConfig: {
 *             rdbSnapshotPeriod: "ONE_HOUR",
 *             rdbSnapshotStartTime: "2024-10-02T15:01:23Z",
 *         },
 *     },
 *     labels: {
 *         abc: "xyz",
 *     },
 * }, {
 *     dependsOn: [_default],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * producer_net = gcp.compute.Network("producer_net",
 *     name="my-network",
 *     auto_create_subnetworks=False)
 * producer_subnet = gcp.compute.Subnetwork("producer_subnet",
 *     name="my-subnet",
 *     ip_cidr_range="10.0.0.248/29",
 *     region="us-central1",
 *     network=producer_net.id)
 * default = gcp.networkconnectivity.ServiceConnectionPolicy("default",
 *     name="my-policy",
 *     location="us-central1",
 *     service_class="gcp-memorystore",
 *     description="my basic service connection policy",
 *     network=producer_net.id,
 *     psc_config={
 *         "subnetworks": [producer_subnet.id],
 *     })
 * project = gcp.organizations.get_project()
 * instance_full = gcp.memorystore.Instance("instance-full",
 *     instance_id="full-instance",
 *     shard_count=3,
 *     desired_psc_auto_connections=[{
 *         "network": producer_net.id,
 *         "project_id": project.project_id,
 *     }],
 *     location="us-central1",
 *     replica_count=2,
 *     node_type="SHARED_CORE_NANO",
 *     transit_encryption_mode="TRANSIT_ENCRYPTION_DISABLED",
 *     authorization_mode="AUTH_DISABLED",
 *     engine_configs={
 *         "maxmemory-policy": "volatile-ttl",
 *     },
 *     zone_distribution_config={
 *         "mode": "SINGLE_ZONE",
 *         "zone": "us-central1-b",
 *     },
 *     engine_version="VALKEY_7_2",
 *     deletion_protection_enabled=False,
 *     mode="CLUSTER",
 *     persistence_config={
 *         "mode": "RDB",
 *         "rdb_config": {
 *             "rdb_snapshot_period": "ONE_HOUR",
 *             "rdb_snapshot_start_time": "2024-10-02T15:01:23Z",
 *         },
 *     },
 *     labels={
 *         "abc": "xyz",
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[default]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var producerNet = new Gcp.Compute.Network("producer_net", new()
 *     {
 *         Name = "my-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var producerSubnet = new Gcp.Compute.Subnetwork("producer_subnet", new()
 *     {
 *         Name = "my-subnet",
 *         IpCidrRange = "10.0.0.248/29",
 *         Region = "us-central1",
 *         Network = producerNet.Id,
 *     });
 *     var @default = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("default", new()
 *     {
 *         Name = "my-policy",
 *         Location = "us-central1",
 *         ServiceClass = "gcp-memorystore",
 *         Description = "my basic service connection policy",
 *         Network = producerNet.Id,
 *         PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
 *         {
 *             Subnetworks = new[]
 *             {
 *                 producerSubnet.Id,
 *             },
 *         },
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var instance_full = new Gcp.MemoryStore.Instance("instance-full", new()
 *     {
 *         InstanceId = "full-instance",
 *         ShardCount = 3,
 *         DesiredPscAutoConnections = new[]
 *         {
 *             new Gcp.MemoryStore.Inputs.InstanceDesiredPscAutoConnectionArgs
 *             {
 *                 Network = producerNet.Id,
 *                 ProjectId = project.Apply(getProjectResult => getProjectResult.ProjectId),
 *             },
 *         },
 *         Location = "us-central1",
 *         ReplicaCount = 2,
 *         NodeType = "SHARED_CORE_NANO",
 *         TransitEncryptionMode = "TRANSIT_ENCRYPTION_DISABLED",
 *         AuthorizationMode = "AUTH_DISABLED",
 *         EngineConfigs =
 *         {
 *             { "maxmemory-policy", "volatile-ttl" },
 *         },
 *         ZoneDistributionConfig = new Gcp.MemoryStore.Inputs.InstanceZoneDistributionConfigArgs
 *         {
 *             Mode = "SINGLE_ZONE",
 *             Zone = "us-central1-b",
 *         },
 *         EngineVersion = "VALKEY_7_2",
 *         DeletionProtectionEnabled = false,
 *         Mode = "CLUSTER",
 *         PersistenceConfig = new Gcp.MemoryStore.Inputs.InstancePersistenceConfigArgs
 *         {
 *             Mode = "RDB",
 *             RdbConfig = new Gcp.MemoryStore.Inputs.InstancePersistenceConfigRdbConfigArgs
 *             {
 *                 RdbSnapshotPeriod = "ONE_HOUR",
 *                 RdbSnapshotStartTime = "2024-10-02T15:01:23Z",
 *             },
 *         },
 *         Labels =
 *         {
 *             { "abc", "xyz" },
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             @default,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/memorystore"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		producerNet, err := compute.NewNetwork(ctx, "producer_net", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		producerSubnet, err := compute.NewSubnetwork(ctx, "producer_subnet", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("my-subnet"),
 * 			IpCidrRange: pulumi.String("10.0.0.248/29"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Network:     producerNet.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewServiceConnectionPolicy(ctx, "default", &networkconnectivity.ServiceConnectionPolicyArgs{
 * 			Name:         pulumi.String("my-policy"),
 * 			Location:     pulumi.String("us-central1"),
 * 			ServiceClass: pulumi.String("gcp-memorystore"),
 * 			Description:  pulumi.String("my basic service connection policy"),
 * 			Network:      producerNet.ID(),
 * 			PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
 * 				Subnetworks: pulumi.StringArray{
 * 					producerSubnet.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = memorystore.NewInstance(ctx, "instance-full", &memorystore.InstanceArgs{
 * 			InstanceId: pulumi.String("full-instance"),
 * 			ShardCount: pulumi.Int(3),
 * 			DesiredPscAutoConnections: memorystore.InstanceDesiredPscAutoConnectionArray{
 * 				&memorystore.InstanceDesiredPscAutoConnectionArgs{
 * 					Network:   producerNet.ID(),
 * 					ProjectId: pulumi.String(project.ProjectId),
 * 				},
 * 			},
 * 			Location:              pulumi.String("us-central1"),
 * 			ReplicaCount:          pulumi.Int(2),
 * 			NodeType:              pulumi.String("SHARED_CORE_NANO"),
 * 			TransitEncryptionMode: pulumi.String("TRANSIT_ENCRYPTION_DISABLED"),
 * 			AuthorizationMode:     pulumi.String("AUTH_DISABLED"),
 * 			EngineConfigs: pulumi.StringMap{
 * 				"maxmemory-policy": pulumi.String("volatile-ttl"),
 * 			},
 * 			ZoneDistributionConfig: &memorystore.InstanceZoneDistributionConfigArgs{
 * 				Mode: pulumi.String("SINGLE_ZONE"),
 * 				Zone: pulumi.String("us-central1-b"),
 * 			},
 * 			EngineVersion:             pulumi.String("VALKEY_7_2"),
 * 			DeletionProtectionEnabled: pulumi.Bool(false),
 * 			Mode:                      pulumi.String("CLUSTER"),
 * 			PersistenceConfig: &memorystore.InstancePersistenceConfigArgs{
 * 				Mode: pulumi.String("RDB"),
 * 				RdbConfig: &memorystore.InstancePersistenceConfigRdbConfigArgs{
 * 					RdbSnapshotPeriod:    pulumi.String("ONE_HOUR"),
 * 					RdbSnapshotStartTime: pulumi.String("2024-10-02T15:01:23Z"),
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"abc": pulumi.String("xyz"),
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			_default,
 * 		}))
 * 		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.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.memorystore.Instance;
 * import com.pulumi.gcp.memorystore.InstanceArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstanceDesiredPscAutoConnectionArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstanceZoneDistributionConfigArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstancePersistenceConfigArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstancePersistenceConfigRdbConfigArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 producerNet = new Network("producerNet", NetworkArgs.builder()
 *             .name("my-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder()
 *             .name("my-subnet")
 *             .ipCidrRange("10.0.0.248/29")
 *             .region("us-central1")
 *             .network(producerNet.id())
 *             .build());
 *         var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder()
 *             .name("my-policy")
 *             .location("us-central1")
 *             .serviceClass("gcp-memorystore")
 *             .description("my basic service connection policy")
 *             .network(producerNet.id())
 *             .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
 *                 .subnetworks(producerSubnet.id())
 *                 .build())
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var instance_full = new Instance("instance-full", InstanceArgs.builder()
 *             .instanceId("full-instance")
 *             .shardCount(3)
 *             .desiredPscAutoConnections(InstanceDesiredPscAutoConnectionArgs.builder()
 *                 .network(producerNet.id())
 *                 .projectId(project.applyValue(getProjectResult -> getProjectResult.projectId()))
 *                 .build())
 *             .location("us-central1")
 *             .replicaCount(2)
 *             .nodeType("SHARED_CORE_NANO")
 *             .transitEncryptionMode("TRANSIT_ENCRYPTION_DISABLED")
 *             .authorizationMode("AUTH_DISABLED")
 *             .engineConfigs(Map.of("maxmemory-policy", "volatile-ttl"))
 *             .zoneDistributionConfig(InstanceZoneDistributionConfigArgs.builder()
 *                 .mode("SINGLE_ZONE")
 *                 .zone("us-central1-b")
 *                 .build())
 *             .engineVersion("VALKEY_7_2")
 *             .deletionProtectionEnabled(false)
 *             .mode("CLUSTER")
 *             .persistenceConfig(InstancePersistenceConfigArgs.builder()
 *                 .mode("RDB")
 *                 .rdbConfig(InstancePersistenceConfigRdbConfigArgs.builder()
 *                     .rdbSnapshotPeriod("ONE_HOUR")
 *                     .rdbSnapshotStartTime("2024-10-02T15:01:23Z")
 *                     .build())
 *                 .build())
 *             .labels(Map.of("abc", "xyz"))
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(default_)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance-full:
 *     type: gcp:memorystore:Instance
 *     properties:
 *       instanceId: full-instance
 *       shardCount: 3
 *       desiredPscAutoConnections:
 *         - network: ${producerNet.id}
 *           projectId: ${project.projectId}
 *       location: us-central1
 *       replicaCount: 2
 *       nodeType: SHARED_CORE_NANO
 *       transitEncryptionMode: TRANSIT_ENCRYPTION_DISABLED
 *       authorizationMode: AUTH_DISABLED
 *       engineConfigs:
 *         maxmemory-policy: volatile-ttl
 *       zoneDistributionConfig:
 *         mode: SINGLE_ZONE
 *         zone: us-central1-b
 *       engineVersion: VALKEY_7_2
 *       deletionProtectionEnabled: false
 *       mode: CLUSTER
 *       persistenceConfig:
 *         mode: RDB
 *         rdbConfig:
 *           rdbSnapshotPeriod: ONE_HOUR
 *           rdbSnapshotStartTime: 2024-10-02T15:01:23Z
 *       labels:
 *         abc: xyz
 *     options:
 *       dependsOn:
 *         - ${default}
 *   default:
 *     type: gcp:networkconnectivity:ServiceConnectionPolicy
 *     properties:
 *       name: my-policy
 *       location: us-central1
 *       serviceClass: gcp-memorystore
 *       description: my basic service connection policy
 *       network: ${producerNet.id}
 *       pscConfig:
 *         subnetworks:
 *           - ${producerSubnet.id}
 *   producerSubnet:
 *     type: gcp:compute:Subnetwork
 *     name: producer_subnet
 *     properties:
 *       name: my-subnet
 *       ipCidrRange: 10.0.0.248/29
 *       region: us-central1
 *       network: ${producerNet.id}
 *   producerNet:
 *     type: gcp:compute:Network
 *     name: producer_net
 *     properties:
 *       name: my-network
 *       autoCreateSubnetworks: false
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Memorystore Instance Persistence Aof
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "my-subnet",
 *     ipCidrRange: "10.0.0.248/29",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
 *     name: "my-policy",
 *     location: "us-central1",
 *     serviceClass: "gcp-memorystore",
 *     description: "my basic service connection policy",
 *     network: producerNet.id,
 *     pscConfig: {
 *         subnetworks: [producerSubnet.id],
 *     },
 * });
 * const project = gcp.organizations.getProject({});
 * const instance_persistence_aof = new gcp.memorystore.Instance("instance-persistence-aof", {
 *     instanceId: "aof-instance",
 *     shardCount: 3,
 *     desiredPscAutoConnections: [{
 *         network: producerNet.id,
 *         projectId: project.then(project => project.projectId),
 *     }],
 *     location: "us-central1",
 *     persistenceConfig: {
 *         mode: "AOF",
 *         aofConfig: {
 *             appendFsync: "EVERY_SEC",
 *         },
 *     },
 *     deletionProtectionEnabled: false,
 * }, {
 *     dependsOn: [_default],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * producer_net = gcp.compute.Network("producer_net",
 *     name="my-network",
 *     auto_create_subnetworks=False)
 * producer_subnet = gcp.compute.Subnetwork("producer_subnet",
 *     name="my-subnet",
 *     ip_cidr_range="10.0.0.248/29",
 *     region="us-central1",
 *     network=producer_net.id)
 * default = gcp.networkconnectivity.ServiceConnectionPolicy("default",
 *     name="my-policy",
 *     location="us-central1",
 *     service_class="gcp-memorystore",
 *     description="my basic service connection policy",
 *     network=producer_net.id,
 *     psc_config={
 *         "subnetworks": [producer_subnet.id],
 *     })
 * project = gcp.organizations.get_project()
 * instance_persistence_aof = gcp.memorystore.Instance("instance-persistence-aof",
 *     instance_id="aof-instance",
 *     shard_count=3,
 *     desired_psc_auto_connections=[{
 *         "network": producer_net.id,
 *         "project_id": project.project_id,
 *     }],
 *     location="us-central1",
 *     persistence_config={
 *         "mode": "AOF",
 *         "aof_config": {
 *             "append_fsync": "EVERY_SEC",
 *         },
 *     },
 *     deletion_protection_enabled=False,
 *     opts = pulumi.ResourceOptions(depends_on=[default]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var producerNet = new Gcp.Compute.Network("producer_net", new()
 *     {
 *         Name = "my-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var producerSubnet = new Gcp.Compute.Subnetwork("producer_subnet", new()
 *     {
 *         Name = "my-subnet",
 *         IpCidrRange = "10.0.0.248/29",
 *         Region = "us-central1",
 *         Network = producerNet.Id,
 *     });
 *     var @default = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("default", new()
 *     {
 *         Name = "my-policy",
 *         Location = "us-central1",
 *         ServiceClass = "gcp-memorystore",
 *         Description = "my basic service connection policy",
 *         Network = producerNet.Id,
 *         PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
 *         {
 *             Subnetworks = new[]
 *             {
 *                 producerSubnet.Id,
 *             },
 *         },
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var instance_persistence_aof = new Gcp.MemoryStore.Instance("instance-persistence-aof", new()
 *     {
 *         InstanceId = "aof-instance",
 *         ShardCount = 3,
 *         DesiredPscAutoConnections = new[]
 *         {
 *             new Gcp.MemoryStore.Inputs.InstanceDesiredPscAutoConnectionArgs
 *             {
 *                 Network = producerNet.Id,
 *                 ProjectId = project.Apply(getProjectResult => getProjectResult.ProjectId),
 *             },
 *         },
 *         Location = "us-central1",
 *         PersistenceConfig = new Gcp.MemoryStore.Inputs.InstancePersistenceConfigArgs
 *         {
 *             Mode = "AOF",
 *             AofConfig = new Gcp.MemoryStore.Inputs.InstancePersistenceConfigAofConfigArgs
 *             {
 *                 AppendFsync = "EVERY_SEC",
 *             },
 *         },
 *         DeletionProtectionEnabled = false,
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             @default,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/memorystore"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		producerNet, err := compute.NewNetwork(ctx, "producer_net", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		producerSubnet, err := compute.NewSubnetwork(ctx, "producer_subnet", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("my-subnet"),
 * 			IpCidrRange: pulumi.String("10.0.0.248/29"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Network:     producerNet.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewServiceConnectionPolicy(ctx, "default", &networkconnectivity.ServiceConnectionPolicyArgs{
 * 			Name:         pulumi.String("my-policy"),
 * 			Location:     pulumi.String("us-central1"),
 * 			ServiceClass: pulumi.String("gcp-memorystore"),
 * 			Description:  pulumi.String("my basic service connection policy"),
 * 			Network:      producerNet.ID(),
 * 			PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
 * 				Subnetworks: pulumi.StringArray{
 * 					producerSubnet.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = memorystore.NewInstance(ctx, "instance-persistence-aof", &memorystore.InstanceArgs{
 * 			InstanceId: pulumi.String("aof-instance"),
 * 			ShardCount: pulumi.Int(3),
 * 			DesiredPscAutoConnections: memorystore.InstanceDesiredPscAutoConnectionArray{
 * 				&memorystore.InstanceDesiredPscAutoConnectionArgs{
 * 					Network:   producerNet.ID(),
 * 					ProjectId: pulumi.String(project.ProjectId),
 * 				},
 * 			},
 * 			Location: pulumi.String("us-central1"),
 * 			PersistenceConfig: &memorystore.InstancePersistenceConfigArgs{
 * 				Mode: pulumi.String("AOF"),
 * 				AofConfig: &memorystore.InstancePersistenceConfigAofConfigArgs{
 * 					AppendFsync: pulumi.String("EVERY_SEC"),
 * 				},
 * 			},
 * 			DeletionProtectionEnabled: pulumi.Bool(false),
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			_default,
 * 		}))
 * 		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.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.memorystore.Instance;
 * import com.pulumi.gcp.memorystore.InstanceArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstanceDesiredPscAutoConnectionArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstancePersistenceConfigArgs;
 * import com.pulumi.gcp.memorystore.inputs.InstancePersistenceConfigAofConfigArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 producerNet = new Network("producerNet", NetworkArgs.builder()
 *             .name("my-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder()
 *             .name("my-subnet")
 *             .ipCidrRange("10.0.0.248/29")
 *             .region("us-central1")
 *             .network(producerNet.id())
 *             .build());
 *         var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder()
 *             .name("my-policy")
 *             .location("us-central1")
 *             .serviceClass("gcp-memorystore")
 *             .description("my basic service connection policy")
 *             .network(producerNet.id())
 *             .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
 *                 .subnetworks(producerSubnet.id())
 *                 .build())
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var instance_persistence_aof = new Instance("instance-persistence-aof", InstanceArgs.builder()
 *             .instanceId("aof-instance")
 *             .shardCount(3)
 *             .desiredPscAutoConnections(InstanceDesiredPscAutoConnectionArgs.builder()
 *                 .network(producerNet.id())
 *                 .projectId(project.applyValue(getProjectResult -> getProjectResult.projectId()))
 *                 .build())
 *             .location("us-central1")
 *             .persistenceConfig(InstancePersistenceConfigArgs.builder()
 *                 .mode("AOF")
 *                 .aofConfig(InstancePersistenceConfigAofConfigArgs.builder()
 *                     .appendFsync("EVERY_SEC")
 *                     .build())
 *                 .build())
 *             .deletionProtectionEnabled(false)
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(default_)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance-persistence-aof:
 *     type: gcp:memorystore:Instance
 *     properties:
 *       instanceId: aof-instance
 *       shardCount: 3
 *       desiredPscAutoConnections:
 *         - network: ${producerNet.id}
 *           projectId: ${project.projectId}
 *       location: us-central1
 *       persistenceConfig:
 *         mode: AOF
 *         aofConfig:
 *           appendFsync: EVERY_SEC
 *       deletionProtectionEnabled: false
 *     options:
 *       dependsOn:
 *         - ${default}
 *   default:
 *     type: gcp:networkconnectivity:ServiceConnectionPolicy
 *     properties:
 *       name: my-policy
 *       location: us-central1
 *       serviceClass: gcp-memorystore
 *       description: my basic service connection policy
 *       network: ${producerNet.id}
 *       pscConfig:
 *         subnetworks:
 *           - ${producerSubnet.id}
 *   producerSubnet:
 *     type: gcp:compute:Subnetwork
 *     name: producer_subnet
 *     properties:
 *       name: my-subnet
 *       ipCidrRange: 10.0.0.248/29
 *       region: us-central1
 *       network: ${producerNet.id}
 *   producerNet:
 *     type: gcp:compute:Network
 *     name: producer_net
 *     properties:
 *       name: my-network
 *       autoCreateSubnetworks: false
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ## 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 the `pulumi import` command, Instance can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:memorystore/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{instance_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:memorystore/instance:Instance default {{project}}/{{location}}/{{instance_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:memorystore/instance:Instance default {{location}}/{{instance_id}}
 * ```
 */
public class Instance internal constructor(
    override val javaResource: com.pulumi.gcp.memorystore.Instance,
) : KotlinCustomResource(javaResource, InstanceMapper) {
    /**
     * Optional. Immutable. Authorization mode of the instance. Possible values:
     * AUTH_DISABLED
     * IAM_AUTH
     */
    public val authorizationMode: Output
        get() = javaResource.authorizationMode().applyValue({ args0 -> args0 })

    /**
     * Output only. Creation timestamp of the instance.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Optional. If set to true deletion of the instance will fail.
     */
    public val deletionProtectionEnabled: Output?
        get() = javaResource.deletionProtectionEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Required. Immutable. User inputs for the auto-created PSC connections.
     */
    public val desiredPscAutoConnections: Output>
        get() = javaResource.desiredPscAutoConnections().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> instanceDesiredPscAutoConnectionToKotlin(args0) })
            })
        })

    /**
     * Output only. Endpoints clients can connect to the instance through. Currently only one
     * discovery endpoint is supported.
     * Structure is documented below.
     */
    public val discoveryEndpoints: Output>
        get() = javaResource.discoveryEndpoints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> instanceDiscoveryEndpointToKotlin(args0) })
            })
        })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Endpoints for the instance.
     */
    public val endpoints: Output>>
        get() = javaResource.endpoints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            })
        })

    /**
     * Optional. User-provided engine configurations for the instance.
     */
    public val engineConfigs: Output>?
        get() = javaResource.engineConfigs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.key.to(args0.value) }).toMap()
            }).orElse(null)
        })

    /**
     * Optional. Immutable. Engine version of the instance.
     */
    public val engineVersion: Output
        get() = javaResource.engineVersion().applyValue({ args0 -> args0 })

    /**
     * Required. The ID to use for the instance, which will become the final component of
     * the instance's resource name.
     * This value is subject to the following restrictions:
     * * Must be 4-63 characters in length
     * * Must begin with a letter or digit
     * * Must contain only lowercase letters, digits, and hyphens
     * * Must not end with a hyphen
     * * Must be unique within a location
     * - - -
     */
    public val instanceId: Output
        get() = javaResource.instanceId().applyValue({ args0 -> args0 })

    /**
     * Optional. 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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Optional. Standalone or cluster.
     * Possible values:
     * CLUSTER
     * STANDALONE
     * Possible values are: `CLUSTER`, `STANDALONE`.
     */
    public val mode: Output
        get() = javaResource.mode().applyValue({ args0 -> args0 })

    /**
     * Identifier. Unique name of the instance.
     * Format: projects/{project}/locations/{location}/instances/{instance}
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Represents configuration for nodes of the instance.
     * Structure is documented below.
     */
    public val nodeConfigs: Output>
        get() = javaResource.nodeConfigs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    instanceNodeConfigToKotlin(args0)
                })
            })
        })

    /**
     * Optional. Immutable. Machine type for individual nodes of the instance.
     * Possible values:
     * SHARED_CORE_NANO
     * HIGHMEM_MEDIUM
     * HIGHMEM_XLARGE
     * STANDARD_SMALL
     */
    public val nodeType: Output
        get() = javaResource.nodeType().applyValue({ args0 -> args0 })

    /**
     * Represents persistence configuration for a instance.
     * Structure is documented below.
     */
    public val persistenceConfig: Output
        get() = javaResource.persistenceConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                instancePersistenceConfigToKotlin(args0)
            })
        })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Output only. User inputs and resource details of the auto-created PSC connections.
     * Structure is documented below.
     */
    public val pscAutoConnections: Output>
        get() = javaResource.pscAutoConnections().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> instancePscAutoConnectionToKotlin(args0) })
            })
        })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Optional. Number of replica nodes per shard. If omitted the default is 0 replicas.
     */
    public val replicaCount: Output
        get() = javaResource.replicaCount().applyValue({ args0 -> args0 })

    /**
     * Required. Number of shards for the instance.
     */
    public val shardCount: Output
        get() = javaResource.shardCount().applyValue({ args0 -> args0 })

    /**
     * Output only. Current state of the instance.
     * Possible values:
     * CREATING
     * ACTIVE
     * UPDATING
     * DELETING
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Additional information about the state of the instance.
     * Structure is documented below.
     */
    public val stateInfos: Output>
        get() = javaResource.stateInfos().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    instanceStateInfoToKotlin(args0)
                })
            })
        })

    /**
     * Optional. Immutable. In-transit encryption mode of the instance.
     * Possible values:
     * TRANSIT_ENCRYPTION_DISABLED
     * SERVER_AUTHENTICATION
     */
    public val transitEncryptionMode: Output
        get() = javaResource.transitEncryptionMode().applyValue({ args0 -> args0 })

    /**
     * Output only. System assigned, unique identifier for the instance.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * Output only. Latest update timestamp of the instance.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

    /**
     * Zone distribution configuration for allocation of instance resources.
     * Structure is documented below.
     */
    public val zoneDistributionConfig: Output
        get() = javaResource.zoneDistributionConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceZoneDistributionConfigToKotlin(args0)
            })
        })
}

public object InstanceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.memorystore.Instance::class == javaResource::class

    override fun map(javaResource: Resource): Instance = Instance(
        javaResource as
            com.pulumi.gcp.memorystore.Instance,
    )
}

/**
 * @see [Instance].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Instance].
 */
public suspend fun instance(name: String, block: suspend InstanceResourceBuilder.() -> Unit): Instance {
    val builder = InstanceResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Instance].
 * @param name The _unique_ name of the resulting resource.
 */
public fun instance(name: String): Instance {
    val builder = InstanceResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy