@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
116 lines • 5.74 kB
JavaScript
;
// *** 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.ReservedCacheNode = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an ElastiCache Reserved Cache Node.
*
* > **NOTE:** Once created, a reservation is valid for the `duration` of the provided `offeringId` and cannot be deleted. Performing a `destroy` will only remove the resource from state. For more information see [ElastiCache Reserved Nodes Documentation](https://aws.amazon.com/elasticache/reserved-cache-nodes/) and [PurchaseReservedCacheNodesOffering](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_PurchaseReservedCacheNodesOffering.html).
*
* > **NOTE:** Due to the expense of testing this resource, we provide it as best effort. If you find it useful, and have the ability to help test or notice issues, consider reaching out to us on GitHub.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.elasticache.getReservedCacheNodeOffering({
* cacheNodeType: "cache.t4g.small",
* duration: "P1Y",
* offeringType: "No Upfront",
* productDescription: "redis",
* });
* const exampleReservedCacheNode = new aws.elasticache.ReservedCacheNode("example", {
* reservedCacheNodesOfferingId: example.then(example => example.offeringId),
* id: "optionalCustomReservationID",
* cacheNodeCount: 3,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import ElastiCache Reserved Cache Node using the `id`. For example:
*
* ```sh
* $ pulumi import aws:elasticache/reservedCacheNode:ReservedCacheNode example CustomReservationID
* ```
*/
class ReservedCacheNode extends pulumi.CustomResource {
/**
* Get an existing ReservedCacheNode 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 ReservedCacheNode(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ReservedCacheNode. 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'] === ReservedCacheNode.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["cacheNodeCount"] = state?.cacheNodeCount;
resourceInputs["cacheNodeType"] = state?.cacheNodeType;
resourceInputs["duration"] = state?.duration;
resourceInputs["fixedPrice"] = state?.fixedPrice;
resourceInputs["offeringType"] = state?.offeringType;
resourceInputs["productDescription"] = state?.productDescription;
resourceInputs["recurringCharges"] = state?.recurringCharges;
resourceInputs["region"] = state?.region;
resourceInputs["reservedCacheNodesOfferingId"] = state?.reservedCacheNodesOfferingId;
resourceInputs["startTime"] = state?.startTime;
resourceInputs["state"] = state?.state;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["usagePrice"] = state?.usagePrice;
}
else {
const args = argsOrState;
if (args?.reservedCacheNodesOfferingId === undefined && !opts.urn) {
throw new Error("Missing required property 'reservedCacheNodesOfferingId'");
}
resourceInputs["cacheNodeCount"] = args?.cacheNodeCount;
resourceInputs["region"] = args?.region;
resourceInputs["reservedCacheNodesOfferingId"] = args?.reservedCacheNodesOfferingId;
resourceInputs["tags"] = args?.tags;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["cacheNodeType"] = undefined /*out*/;
resourceInputs["duration"] = undefined /*out*/;
resourceInputs["fixedPrice"] = undefined /*out*/;
resourceInputs["offeringType"] = undefined /*out*/;
resourceInputs["productDescription"] = undefined /*out*/;
resourceInputs["recurringCharges"] = undefined /*out*/;
resourceInputs["startTime"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["usagePrice"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ReservedCacheNode.__pulumiType, name, resourceInputs, opts);
}
}
exports.ReservedCacheNode = ReservedCacheNode;
/** @internal */
ReservedCacheNode.__pulumiType = 'aws:elasticache/reservedCacheNode:ReservedCacheNode';
//# sourceMappingURL=reservedCacheNode.js.map