UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

817 lines • 33.9 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Cluster = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A Google Cloud Redis Cluster instance. * * To get more information about Cluster, see: * * * [API documentation](https://cloud.google.com/memorystore/docs/cluster/reference/rest/v1/projects.locations.clusters) * * How-to Guides * * [Official Documentation](https://cloud.google.com/memorystore/docs/cluster/) * * > **Note:** For [Multiple VPC Networking](https://cloud.google.com/memorystore/docs/cluster/about-multiple-vpc-networking) if you want to use * [User-registered PSC Connections](https://cloud.google.com/memorystore/docs/cluster/about-multiple-vpc-networking#psc_connection_types), * then please use `gcp.redis.ClusterUserCreatedConnections` resource. * * For [Cross Region Replication](https://cloud.google.com/memorystore/docs/cluster/about-cross-region-replication), please follow the instructions below for performing certain update and failover (switchover and detach) operations * * **Cross Region Replication** * * **Settings updated on primary and propagated to secondaries** * * The settings listed [here](https://cloud.google.com/memorystore/docs/cluster/about-cross-region-replication#set_on_primary) * are only allowed to be updated on the primary cluster and the changes are automatically propagated to the secondary clusters. * To keep the Terraform configuration and state in sync for such settings, please follow the below steps to update them: * 1. Update the setting on the primary cluster: * * Update the setting to its new desired value in the Terraform configuration file. * * Execute `pulumi up` to apply the change and wait for it to complete. * 2. Detect configuration drift on the secondary cluster(s): * * Execute `pulumi preview`. This should reveal a diff for the modified setting. The proposed value in the pulumi preview should align with the updated value applied to the primary cluster in the preceding step. * 3. Reconcile secondary cluster(s) configuration: * * Manually edit the Terraform configuration file(s) for the secondary cluster(s) to update the setting with the latest value from the state. * * Execute `pulumi preview` once again. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * * **Switchover** * * To perform a [switchover](https://cloud.google.com/memorystore/docs/cluster/working-with-cross-region-replication#perform_a_switchover), please follow the below steps: * 1. Ensure that the Terraform configuration file for the secondary cluster that needs to become the new primary has the `crossClusterReplicationConfig` field. If it is not present: * * Add the `crossClusterReplicationConfig` field to the configuration file to match the latest value in the state. * * Execute `pulumi preview`. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * 2. Update the `crossClusterReplicationConfig` field of the secondary that needs to become the new primary: * * Change `cross_cluster_replication_config.cluster_role` from `SECONDARY` to `PRIMARY`. * * Remove `cross_cluster_replication_config.primary_cluster` field. * * Set `cross_cluster_replication_config.secondary_clusters` list with the new secondaries. The new secondaries are the current primary and other secondary clusters(if any). * * > You can refer to the current value of `cross_cluster_replication_config.membership` field to lookup the current primary and secondary clusters. * 3. Execute switchover: * * Execute`pulumi up` to apply the change and wait for it to complete. * 4. Fix any configuration drifts on the previous primary and other secondary clusters: * * Execute `pulumi preview`. If any diffs are reported for `crossClusterReplicationConfig` field: * * Manually update `crossClusterReplicationConfig` field in the configuration file(s) for those clusters with the latest value from the state. * * Execute `pulumi preview` once again. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * * **Detach a secondary cluster** * * To [detach](https://cloud.google.com/memorystore/docs/cluster/working-with-cross-region-replication#detach_secondary_clusters_option_1) a secondary cluster, please follow the below steps: * 1. Ensure that the Terraform configuration file for the secondary cluster that needs to be detached has the `crossClusterReplicationConfig` field. If it is not present: * * Add the `crossClusterReplicationConfig` field to the configuration file to match the latest value in the state. * * Execute `pulumi preview`. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * 2. Update the `crossClusterReplicationConfig` field of the secondary that needs to be detached: * * Change `cross_cluster_replication_config.cluster_role` from `SECONDARY` to `NONE`. * * Remove `cross_cluster_replication_config.primary_cluster`. * 3. Execute detach: * * Execute`pulumi up` to apply the change and wait for it to complete. * 4. Fix any configuration drifts on the primary cluster: * * Execute `pulumi preview`. If any diff is reported for `crossClusterReplicationConfig` field: * * Manually update `crossClusterReplicationConfig` field in the configuration file with the latest value from the state. * * Execute `pulumi preview` once again. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * * **Detach secondary cluster(s) via primary cluster** * * To [detach](https://cloud.google.com/memorystore/docs/cluster/working-with-cross-region-replication#detach_secondary_clusters_option_2) secondary clusters via primary, please follow the below steps: * 1. Ensure that the Terraform configuration file for the primary cluster from which the secondary(ies) has(ve) to be detached has the `crossClusterReplicationConfig` field. If it is not present: * * Add the `crossClusterReplicationConfig` field to the configuration file to match the latest value in the state. * * Execute `pulumi preview`. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * 2. Update the `crossClusterReplicationConfig` field of the primary cluster: * * If you are detaching all secondaries from the primary: * * Change `cross_cluster_replication_config.cluster_role` from `PRIMARY` to `NONE`. * * Remove `cross_cluster_replication_config.secondary_clusters` list field. * * If you are detaching a subset of secondaries: * * Update `cross_cluster_replication_config.secondary_clusters` list field to remove the secondary clusters that need to be detached. * 3. Execute detach: * * Execute `pulumi up` to apply the change and wait for it to complete. * 4. Fix any configuration drifts on the secondary cluster(s) that was detached: * * Execute `pulumi preview`. If any diffs are reported for `crossClusterReplicationConfig` field: * * Manually update `crossClusterReplicationConfig` field in the configuration file(s) for those clusters with the latest value from the state. * * Execute `pulumi preview` once again. This should not generate any diff, confirming the configuration is in sync with the infrastructure. * * ## Example Usage * * ### Redis Cluster Ha With Labels * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "my-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "my-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * description: "my basic service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const cluster_ha_with_labels = new gcp.redis.Cluster("cluster-ha-with-labels", { * name: "ha-cluster", * shardCount: 3, * labels: { * my_key: "my_val", * other_key: "other_val", * }, * pscConfigs: [{ * network: consumerNet.id, * }], * region: "us-central1", * replicaCount: 1, * nodeType: "REDIS_SHARED_CORE_NANO", * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED", * authorizationMode: "AUTH_MODE_DISABLED", * redisConfigs: { * "maxmemory-policy": "volatile-ttl", * }, * deletionProtectionEnabled: true, * zoneDistributionConfig: { * mode: "MULTI_ZONE", * }, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "MONDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * }, { * dependsOn: [_default], * }); * ``` * ### Redis Cluster Ha * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "my-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "my-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * description: "my basic service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const cluster_ha = new gcp.redis.Cluster("cluster-ha", { * name: "ha-cluster", * shardCount: 3, * pscConfigs: [{ * network: consumerNet.id, * }], * region: "us-central1", * replicaCount: 1, * nodeType: "REDIS_SHARED_CORE_NANO", * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED", * authorizationMode: "AUTH_MODE_DISABLED", * redisConfigs: { * "maxmemory-policy": "volatile-ttl", * }, * deletionProtectionEnabled: true, * zoneDistributionConfig: { * mode: "MULTI_ZONE", * }, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "MONDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * }, { * dependsOn: [_default], * }); * ``` * ### Redis Cluster Ha Single Zone * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "my-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "my-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * description: "my basic service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const cluster_ha_single_zone = new gcp.redis.Cluster("cluster-ha-single-zone", { * name: "ha-cluster-single-zone", * shardCount: 3, * pscConfigs: [{ * network: consumerNet.id, * }], * region: "us-central1", * zoneDistributionConfig: { * mode: "SINGLE_ZONE", * zone: "us-central1-f", * }, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "MONDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * deletionProtectionEnabled: true, * }, { * dependsOn: [_default], * }); * ``` * ### Redis Cluster Secondary * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "mynetwork", * autoCreateSubnetworks: false, * }); * const primaryClusterConsumerSubnet = new gcp.compute.Subnetwork("primary_cluster_consumer_subnet", { * name: "mysubnet-primary-cluster", * ipCidrRange: "10.0.1.0/29", * region: "us-east1", * network: consumerNet.id, * }); * const primaryClusterRegionScp = new gcp.networkconnectivity.ServiceConnectionPolicy("primary_cluster_region_scp", { * name: "mypolicy-primary-cluster", * location: "us-east1", * serviceClass: "gcp-memorystore-redis", * description: "Primary cluster service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [primaryClusterConsumerSubnet.id], * }, * }); * // Primary cluster * const primaryCluster = new gcp.redis.Cluster("primary_cluster", { * name: "my-primary-cluster", * region: "us-east1", * pscConfigs: [{ * network: consumerNet.id, * }], * authorizationMode: "AUTH_MODE_DISABLED", * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED", * shardCount: 3, * redisConfigs: { * "maxmemory-policy": "volatile-ttl", * }, * nodeType: "REDIS_HIGHMEM_MEDIUM", * persistenceConfig: { * mode: "RDB", * rdbConfig: { * rdbSnapshotPeriod: "ONE_HOUR", * rdbSnapshotStartTime: "2024-10-02T15:01:23Z", * }, * }, * zoneDistributionConfig: { * mode: "MULTI_ZONE", * }, * replicaCount: 1, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "MONDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * deletionProtectionEnabled: true, * }, { * dependsOn: [primaryClusterRegionScp], * }); * const secondaryClusterConsumerSubnet = new gcp.compute.Subnetwork("secondary_cluster_consumer_subnet", { * name: "mysubnet-secondary-cluster", * ipCidrRange: "10.0.2.0/29", * region: "europe-west1", * network: consumerNet.id, * }); * const secondaryClusterRegionScp = new gcp.networkconnectivity.ServiceConnectionPolicy("secondary_cluster_region_scp", { * name: "mypolicy-secondary-cluster", * location: "europe-west1", * serviceClass: "gcp-memorystore-redis", * description: "Secondary cluster service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [secondaryClusterConsumerSubnet.id], * }, * }); * // Secondary cluster * const secondaryCluster = new gcp.redis.Cluster("secondary_cluster", { * name: "my-secondary-cluster", * region: "europe-west1", * pscConfigs: [{ * network: consumerNet.id, * }], * authorizationMode: "AUTH_MODE_DISABLED", * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED", * shardCount: 3, * redisConfigs: { * "maxmemory-policy": "volatile-ttl", * }, * nodeType: "REDIS_HIGHMEM_MEDIUM", * persistenceConfig: { * mode: "RDB", * rdbConfig: { * rdbSnapshotPeriod: "ONE_HOUR", * rdbSnapshotStartTime: "2024-10-02T15:01:23Z", * }, * }, * zoneDistributionConfig: { * mode: "MULTI_ZONE", * }, * replicaCount: 2, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "WEDNESDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * deletionProtectionEnabled: true, * crossClusterReplicationConfig: { * clusterRole: "SECONDARY", * primaryCluster: { * cluster: primaryCluster.id, * }, * }, * }, { * dependsOn: [secondaryClusterRegionScp], * }); * ``` * ### Redis Cluster Rdb * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "my-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "my-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * description: "my basic service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const cluster_rdb = new gcp.redis.Cluster("cluster-rdb", { * name: "rdb-cluster", * shardCount: 3, * pscConfigs: [{ * network: consumerNet.id, * }], * region: "us-central1", * replicaCount: 0, * nodeType: "REDIS_SHARED_CORE_NANO", * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED", * authorizationMode: "AUTH_MODE_DISABLED", * redisConfigs: { * "maxmemory-policy": "volatile-ttl", * }, * deletionProtectionEnabled: true, * zoneDistributionConfig: { * mode: "MULTI_ZONE", * }, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "MONDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * persistenceConfig: { * mode: "RDB", * rdbConfig: { * rdbSnapshotPeriod: "ONE_HOUR", * rdbSnapshotStartTime: "2024-10-02T15:01:23Z", * }, * }, * }, { * dependsOn: [_default], * }); * ``` * ### Redis Cluster Aof * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "my-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "my-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * description: "my basic service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const cluster_aof = new gcp.redis.Cluster("cluster-aof", { * name: "aof-cluster", * shardCount: 3, * pscConfigs: [{ * network: consumerNet.id, * }], * region: "us-central1", * replicaCount: 0, * nodeType: "REDIS_SHARED_CORE_NANO", * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED", * authorizationMode: "AUTH_MODE_DISABLED", * redisConfigs: { * "maxmemory-policy": "volatile-ttl", * }, * deletionProtectionEnabled: true, * zoneDistributionConfig: { * mode: "MULTI_ZONE", * }, * maintenancePolicy: { * weeklyMaintenanceWindows: [{ * day: "MONDAY", * startTime: { * hours: 1, * minutes: 0, * seconds: 0, * nanos: 0, * }, * }], * }, * persistenceConfig: { * mode: "AOF", * aofConfig: { * appendFsync: "EVERYSEC", * }, * }, * }, { * dependsOn: [_default], * }); * ``` * ### Redis Cluster Cmek * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "my-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "my-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * description: "my basic service connection policy", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const cluster_cmek = new gcp.redis.Cluster("cluster-cmek", { * name: "cmek-cluster", * shardCount: 3, * pscConfigs: [{ * network: consumerNet.id, * }], * kmsKey: "my-key", * region: "us-central1", * deletionProtectionEnabled: true, * }, { * dependsOn: [_default], * }); * const project = gcp.organizations.getProject({}); * ``` * ### Redis Cluster Flexible Ca * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.certificateauthority.CaPool("default", { * name: "ca-pool", * location: "us-central1", * tier: "ENTERPRISE", * }); * const defaultAuthority = new gcp.certificateauthority.Authority("default", { * pool: _default.name, * certificateAuthorityId: "ca-auth", * location: "us-central1", * config: { * subjectConfig: { * subject: { * organization: "Google", * commonName: "my-redis-ca", * }, * }, * x509Config: { * caOptions: { * isCa: true, * }, * keyUsage: { * baseKeyUsage: { * certSign: true, * crlSign: true, * }, * extendedKeyUsage: { * serverAuth: true, * }, * }, * }, * }, * keySpec: { * algorithm: "RSA_PKCS1_4096_SHA256", * }, * ignoreActiveCertificatesOnDeletion: true, * deletionProtection: false, * skipGracePeriod: true, * }); * const consumerNet = new gcp.compute.Network("consumer_net", { * name: "ca-network", * autoCreateSubnetworks: false, * }); * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", { * name: "ca-subnet", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: consumerNet.id, * }); * const defaultServiceConnectionPolicy = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "ca-policy", * location: "us-central1", * serviceClass: "gcp-memorystore-redis", * network: consumerNet.id, * pscConfig: { * subnetworks: [consumerSubnet.id], * }, * }); * const test_cluster = new gcp.redis.Cluster("test-cluster", { * name: "ca-cluster", * shardCount: 3, * region: "us-central1", * pscConfigs: [{ * network: consumerNet.id, * }], * transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION", * serverCaMode: "SERVER_CA_MODE_CUSTOMER_MANAGED_CAS_CA", * serverCaPool: _default.id, * deletionProtectionEnabled: true, * }, { * dependsOn: [ * defaultServiceConnectionPolicy, * defaultAuthority, * ], * }); * ``` * * ## Import * * Cluster can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{region}}/clusters/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:redis/cluster:Cluster default projects/{{project}}/locations/{{region}}/clusters/{{name}} * $ pulumi import gcp:redis/cluster:Cluster default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:redis/cluster:Cluster default {{region}}/{{name}} * $ pulumi import gcp:redis/cluster:Cluster default {{name}} * ``` */ class Cluster extends pulumi.CustomResource { /** * Get an existing Cluster resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Cluster(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:redis/cluster:Cluster'; /** * Returns true if the given object is an instance of Cluster. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Cluster.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorizationMode"] = state?.authorizationMode; resourceInputs["automatedBackupConfig"] = state?.automatedBackupConfig; resourceInputs["availableMaintenanceVersions"] = state?.availableMaintenanceVersions; resourceInputs["backupCollection"] = state?.backupCollection; resourceInputs["createTime"] = state?.createTime; resourceInputs["crossClusterReplicationConfig"] = state?.crossClusterReplicationConfig; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deletionProtectionEnabled"] = state?.deletionProtectionEnabled; resourceInputs["discoveryEndpoints"] = state?.discoveryEndpoints; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["effectiveMaintenanceVersion"] = state?.effectiveMaintenanceVersion; resourceInputs["gcsSource"] = state?.gcsSource; resourceInputs["kmsKey"] = state?.kmsKey; resourceInputs["labels"] = state?.labels; resourceInputs["maintenancePolicy"] = state?.maintenancePolicy; resourceInputs["maintenanceSchedules"] = state?.maintenanceSchedules; resourceInputs["maintenanceVersion"] = state?.maintenanceVersion; resourceInputs["managedBackupSource"] = state?.managedBackupSource; resourceInputs["managedServerCas"] = state?.managedServerCas; resourceInputs["name"] = state?.name; resourceInputs["nodeType"] = state?.nodeType; resourceInputs["persistenceConfig"] = state?.persistenceConfig; resourceInputs["preciseSizeGb"] = state?.preciseSizeGb; resourceInputs["project"] = state?.project; resourceInputs["pscConfigs"] = state?.pscConfigs; resourceInputs["pscConnections"] = state?.pscConnections; resourceInputs["pscServiceAttachments"] = state?.pscServiceAttachments; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["redisConfigs"] = state?.redisConfigs; resourceInputs["region"] = state?.region; resourceInputs["replicaCount"] = state?.replicaCount; resourceInputs["serverCaMode"] = state?.serverCaMode; resourceInputs["serverCaPool"] = state?.serverCaPool; resourceInputs["shardCount"] = state?.shardCount; resourceInputs["sizeGb"] = state?.sizeGb; resourceInputs["state"] = state?.state; resourceInputs["stateInfos"] = state?.stateInfos; resourceInputs["transitEncryptionMode"] = state?.transitEncryptionMode; resourceInputs["uid"] = state?.uid; resourceInputs["zoneDistributionConfig"] = state?.zoneDistributionConfig; } else { const args = argsOrState; if (args?.shardCount === undefined && !opts.urn) { throw new Error("Missing required property 'shardCount'"); } resourceInputs["authorizationMode"] = args?.authorizationMode; resourceInputs["automatedBackupConfig"] = args?.automatedBackupConfig; resourceInputs["crossClusterReplicationConfig"] = args?.crossClusterReplicationConfig; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["deletionProtectionEnabled"] = args?.deletionProtectionEnabled; resourceInputs["gcsSource"] = args?.gcsSource; resourceInputs["kmsKey"] = args?.kmsKey; resourceInputs["labels"] = args?.labels; resourceInputs["maintenancePolicy"] = args?.maintenancePolicy; resourceInputs["maintenanceVersion"] = args?.maintenanceVersion; resourceInputs["managedBackupSource"] = args?.managedBackupSource; resourceInputs["name"] = args?.name; resourceInputs["nodeType"] = args?.nodeType; resourceInputs["persistenceConfig"] = args?.persistenceConfig; resourceInputs["project"] = args?.project; resourceInputs["pscConfigs"] = args?.pscConfigs; resourceInputs["redisConfigs"] = args?.redisConfigs; resourceInputs["region"] = args?.region; resourceInputs["replicaCount"] = args?.replicaCount; resourceInputs["serverCaMode"] = args?.serverCaMode; resourceInputs["serverCaPool"] = args?.serverCaPool; resourceInputs["shardCount"] = args?.shardCount; resourceInputs["transitEncryptionMode"] = args?.transitEncryptionMode; resourceInputs["zoneDistributionConfig"] = args?.zoneDistributionConfig; resourceInputs["availableMaintenanceVersions"] = undefined /*out*/; resourceInputs["backupCollection"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["discoveryEndpoints"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["effectiveMaintenanceVersion"] = undefined /*out*/; resourceInputs["maintenanceSchedules"] = undefined /*out*/; resourceInputs["managedServerCas"] = undefined /*out*/; resourceInputs["preciseSizeGb"] = undefined /*out*/; resourceInputs["pscConnections"] = undefined /*out*/; resourceInputs["pscServiceAttachments"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["sizeGb"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["stateInfos"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Cluster.__pulumiType, name, resourceInputs, opts); } } exports.Cluster = Cluster; //# sourceMappingURL=cluster.js.map