UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

168 lines 8.55 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.GlobalReplicationGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an ElastiCache Global Replication Group resource, which manages replication between two or more Replication Groups in different regions. For more information, see the [ElastiCache User Guide](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastore.html). * * ## Example Usage * * ### Global replication group with one secondary replication group * * The global replication group depends on the primary group existing. Secondary replication groups depend on the global replication group. the provider dependency management will handle this transparently using resource value references. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const primary = new aws.elasticache.ReplicationGroup("primary", { * replicationGroupId: "example-primary", * description: "primary replication group", * engine: "redis", * engineVersion: "5.0.6", * nodeType: "cache.m5.large", * numCacheClusters: 1, * }); * const example = new aws.elasticache.GlobalReplicationGroup("example", { * globalReplicationGroupIdSuffix: "example", * primaryReplicationGroupId: primary.id, * }); * const secondary = new aws.elasticache.ReplicationGroup("secondary", { * replicationGroupId: "example-secondary", * description: "secondary replication group", * globalReplicationGroupId: example.globalReplicationGroupId, * numCacheClusters: 1, * }); * ``` * * ### Managing Redis OOS/Valkey Engine Versions * * The initial Redis version is determined by the version set on the primary replication group. * However, once it is part of a Global Replication Group, * the Global Replication Group manages the version of all member replication groups. * * The provider is configured to ignore changes to `engine`, `engineVersion` and `parameterGroupName` inside `aws.elasticache.ReplicationGroup` resources if they belong to a global replication group. * * In this example, * the primary replication group will be created with Redis 6.0, * and then upgraded to Redis 6.2 once added to the Global Replication Group. * The secondary replication group will be created with Redis 6.2. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const primary = new aws.elasticache.ReplicationGroup("primary", { * replicationGroupId: "example-primary", * description: "primary replication group", * engine: "redis", * engineVersion: "6.0", * nodeType: "cache.m5.large", * numCacheClusters: 1, * }); * const example = new aws.elasticache.GlobalReplicationGroup("example", { * globalReplicationGroupIdSuffix: "example", * primaryReplicationGroupId: primary.id, * engineVersion: "6.2", * }); * const secondary = new aws.elasticache.ReplicationGroup("secondary", { * replicationGroupId: "example-secondary", * description: "secondary replication group", * globalReplicationGroupId: example.globalReplicationGroupId, * numCacheClusters: 1, * }); * ``` * * ## Import * * Using `pulumi import`, import ElastiCache Global Replication Groups using the `global_replication_group_id`. For example: * * ```sh * $ pulumi import aws:elasticache/globalReplicationGroup:GlobalReplicationGroup my_global_replication_group okuqm-global-replication-group-1 * ``` */ class GlobalReplicationGroup extends pulumi.CustomResource { /** * Get an existing GlobalReplicationGroup 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 GlobalReplicationGroup(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of GlobalReplicationGroup. 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'] === GlobalReplicationGroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["atRestEncryptionEnabled"] = state?.atRestEncryptionEnabled; resourceInputs["authTokenEnabled"] = state?.authTokenEnabled; resourceInputs["automaticFailoverEnabled"] = state?.automaticFailoverEnabled; resourceInputs["cacheNodeType"] = state?.cacheNodeType; resourceInputs["clusterEnabled"] = state?.clusterEnabled; resourceInputs["engine"] = state?.engine; resourceInputs["engineVersion"] = state?.engineVersion; resourceInputs["engineVersionActual"] = state?.engineVersionActual; resourceInputs["globalNodeGroups"] = state?.globalNodeGroups; resourceInputs["globalReplicationGroupDescription"] = state?.globalReplicationGroupDescription; resourceInputs["globalReplicationGroupId"] = state?.globalReplicationGroupId; resourceInputs["globalReplicationGroupIdSuffix"] = state?.globalReplicationGroupIdSuffix; resourceInputs["numNodeGroups"] = state?.numNodeGroups; resourceInputs["parameterGroupName"] = state?.parameterGroupName; resourceInputs["primaryReplicationGroupId"] = state?.primaryReplicationGroupId; resourceInputs["region"] = state?.region; resourceInputs["transitEncryptionEnabled"] = state?.transitEncryptionEnabled; } else { const args = argsOrState; if (args?.globalReplicationGroupIdSuffix === undefined && !opts.urn) { throw new Error("Missing required property 'globalReplicationGroupIdSuffix'"); } if (args?.primaryReplicationGroupId === undefined && !opts.urn) { throw new Error("Missing required property 'primaryReplicationGroupId'"); } resourceInputs["automaticFailoverEnabled"] = args?.automaticFailoverEnabled; resourceInputs["cacheNodeType"] = args?.cacheNodeType; resourceInputs["engine"] = args?.engine; resourceInputs["engineVersion"] = args?.engineVersion; resourceInputs["globalReplicationGroupDescription"] = args?.globalReplicationGroupDescription; resourceInputs["globalReplicationGroupIdSuffix"] = args?.globalReplicationGroupIdSuffix; resourceInputs["numNodeGroups"] = args?.numNodeGroups; resourceInputs["parameterGroupName"] = args?.parameterGroupName; resourceInputs["primaryReplicationGroupId"] = args?.primaryReplicationGroupId; resourceInputs["region"] = args?.region; resourceInputs["arn"] = undefined /*out*/; resourceInputs["atRestEncryptionEnabled"] = undefined /*out*/; resourceInputs["authTokenEnabled"] = undefined /*out*/; resourceInputs["clusterEnabled"] = undefined /*out*/; resourceInputs["engineVersionActual"] = undefined /*out*/; resourceInputs["globalNodeGroups"] = undefined /*out*/; resourceInputs["globalReplicationGroupId"] = undefined /*out*/; resourceInputs["transitEncryptionEnabled"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GlobalReplicationGroup.__pulumiType, name, resourceInputs, opts); } } exports.GlobalReplicationGroup = GlobalReplicationGroup; /** @internal */ GlobalReplicationGroup.__pulumiType = 'aws:elasticache/globalReplicationGroup:GlobalReplicationGroup'; //# sourceMappingURL=globalReplicationGroup.js.map