com.pulumi.gcp.memorystore.kotlin.InstanceArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.memorystore.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.memorystore.InstanceArgs.builder
import com.pulumi.gcp.memorystore.kotlin.inputs.InstanceDesiredPscAutoConnectionArgs
import com.pulumi.gcp.memorystore.kotlin.inputs.InstanceDesiredPscAutoConnectionArgsBuilder
import com.pulumi.gcp.memorystore.kotlin.inputs.InstancePersistenceConfigArgs
import com.pulumi.gcp.memorystore.kotlin.inputs.InstancePersistenceConfigArgsBuilder
import com.pulumi.gcp.memorystore.kotlin.inputs.InstanceZoneDistributionConfigArgs
import com.pulumi.gcp.memorystore.kotlin.inputs.InstanceZoneDistributionConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
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 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}}
* ```
* @property authorizationMode Optional. Immutable. Authorization mode of the instance. Possible values:
* AUTH_DISABLED
* IAM_AUTH
* @property deletionProtectionEnabled Optional. If set to true deletion of the instance will fail.
* @property desiredPscAutoConnections Required. Immutable. User inputs for the auto-created PSC connections.
* @property engineConfigs Optional. User-provided engine configurations for the instance.
* @property engineVersion Optional. Immutable. Engine version of the instance.
* @property instanceId 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
* - - -
* @property labels 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.
* @property location 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`.
* @property mode Optional. Standalone or cluster.
* Possible values:
* CLUSTER
* STANDALONE
* Possible values are: `CLUSTER`, `STANDALONE`.
* @property nodeType Optional. Immutable. Machine type for individual nodes of the instance.
* Possible values:
* SHARED_CORE_NANO
* HIGHMEM_MEDIUM
* HIGHMEM_XLARGE
* STANDARD_SMALL
* @property persistenceConfig Represents persistence configuration for a instance.
* Structure is documented below.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property replicaCount Optional. Number of replica nodes per shard. If omitted the default is 0 replicas.
* @property shardCount Required. Number of shards for the instance.
* @property transitEncryptionMode Optional. Immutable. In-transit encryption mode of the instance.
* Possible values:
* TRANSIT_ENCRYPTION_DISABLED
* SERVER_AUTHENTICATION
* @property zoneDistributionConfig Zone distribution configuration for allocation of instance resources.
* Structure is documented below.
*/
public data class InstanceArgs(
public val authorizationMode: Output? = null,
public val deletionProtectionEnabled: Output? = null,
public val desiredPscAutoConnections: Output>? = null,
public val engineConfigs: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy