@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
189 lines • 7.43 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.ServerlessCache = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an ElastiCache Serverless Cache resource which manages memcached, redis or valkey.
*
* ## Example Usage
*
* ### Memcached Serverless
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.elasticache.ServerlessCache("example", {
* engine: "memcached",
* name: "example",
* cacheUsageLimits: {
* dataStorage: {
* maximum: 10,
* unit: "GB",
* },
* ecpuPerSeconds: [{
* maximum: 5000,
* }],
* },
* description: "Test Server",
* kmsKeyId: test.arn,
* majorEngineVersion: "1.6",
* securityGroupIds: [testAwsSecurityGroup.id],
* subnetIds: testAwsSubnet.map(__item => __item.id),
* });
* ```
*
* ### Redis OSS Serverless
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.elasticache.ServerlessCache("example", {
* engine: "redis",
* name: "example",
* cacheUsageLimits: {
* dataStorage: {
* maximum: 10,
* unit: "GB",
* },
* ecpuPerSeconds: [{
* maximum: 5000,
* }],
* },
* dailySnapshotTime: "09:00",
* description: "Test Server",
* kmsKeyId: test.arn,
* majorEngineVersion: "7",
* snapshotRetentionLimit: 1,
* securityGroupIds: [testAwsSecurityGroup.id],
* subnetIds: testAwsSubnet.map(__item => __item.id),
* });
* ```
*
* ### Valkey Serverless
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.elasticache.ServerlessCache("example", {
* engine: "valkey",
* name: "example",
* cacheUsageLimits: {
* dataStorage: {
* maximum: 10,
* unit: "GB",
* },
* ecpuPerSeconds: [{
* maximum: 5000,
* }],
* },
* dailySnapshotTime: "09:00",
* description: "Test Server",
* kmsKeyId: test.arn,
* majorEngineVersion: "7",
* snapshotRetentionLimit: 1,
* securityGroupIds: [testAwsSecurityGroup.id],
* subnetIds: testAwsSubnet.map(__item => __item.id),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import ElastiCache Serverless Cache using the `name`. For example:
*
* ```sh
* $ pulumi import aws:elasticache/serverlessCache:ServerlessCache my_cluster my_cluster
* ```
*/
class ServerlessCache extends pulumi.CustomResource {
/**
* Get an existing ServerlessCache 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 ServerlessCache(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ServerlessCache. 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'] === ServerlessCache.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["cacheUsageLimits"] = state?.cacheUsageLimits;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["dailySnapshotTime"] = state?.dailySnapshotTime;
resourceInputs["description"] = state?.description;
resourceInputs["endpoints"] = state?.endpoints;
resourceInputs["engine"] = state?.engine;
resourceInputs["fullEngineVersion"] = state?.fullEngineVersion;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["majorEngineVersion"] = state?.majorEngineVersion;
resourceInputs["name"] = state?.name;
resourceInputs["readerEndpoints"] = state?.readerEndpoints;
resourceInputs["region"] = state?.region;
resourceInputs["securityGroupIds"] = state?.securityGroupIds;
resourceInputs["snapshotArnsToRestores"] = state?.snapshotArnsToRestores;
resourceInputs["snapshotRetentionLimit"] = state?.snapshotRetentionLimit;
resourceInputs["status"] = state?.status;
resourceInputs["subnetIds"] = state?.subnetIds;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["userGroupId"] = state?.userGroupId;
}
else {
const args = argsOrState;
if (args?.engine === undefined && !opts.urn) {
throw new Error("Missing required property 'engine'");
}
resourceInputs["cacheUsageLimits"] = args?.cacheUsageLimits;
resourceInputs["dailySnapshotTime"] = args?.dailySnapshotTime;
resourceInputs["description"] = args?.description;
resourceInputs["engine"] = args?.engine;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["majorEngineVersion"] = args?.majorEngineVersion;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["securityGroupIds"] = args?.securityGroupIds;
resourceInputs["snapshotArnsToRestores"] = args?.snapshotArnsToRestores;
resourceInputs["snapshotRetentionLimit"] = args?.snapshotRetentionLimit;
resourceInputs["subnetIds"] = args?.subnetIds;
resourceInputs["tags"] = args?.tags;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["userGroupId"] = args?.userGroupId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["endpoints"] = undefined /*out*/;
resourceInputs["fullEngineVersion"] = undefined /*out*/;
resourceInputs["readerEndpoints"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServerlessCache.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServerlessCache = ServerlessCache;
/** @internal */
ServerlessCache.__pulumiType = 'aws:elasticache/serverlessCache:ServerlessCache';
//# sourceMappingURL=serverlessCache.js.map