UNPKG

@pulumi/aws

Version:

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

189 lines • 8.16 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.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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["cacheUsageLimits"] = state ? state.cacheUsageLimits : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["dailySnapshotTime"] = state ? state.dailySnapshotTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["endpoints"] = state ? state.endpoints : undefined; resourceInputs["engine"] = state ? state.engine : undefined; resourceInputs["fullEngineVersion"] = state ? state.fullEngineVersion : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["majorEngineVersion"] = state ? state.majorEngineVersion : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["readerEndpoints"] = state ? state.readerEndpoints : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined; resourceInputs["snapshotArnsToRestores"] = state ? state.snapshotArnsToRestores : undefined; resourceInputs["snapshotRetentionLimit"] = state ? state.snapshotRetentionLimit : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetIds"] = state ? state.subnetIds : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["timeouts"] = state ? state.timeouts : undefined; resourceInputs["userGroupId"] = state ? state.userGroupId : undefined; } else { const args = argsOrState; if ((!args || args.engine === undefined) && !opts.urn) { throw new Error("Missing required property 'engine'"); } resourceInputs["cacheUsageLimits"] = args ? args.cacheUsageLimits : undefined; resourceInputs["dailySnapshotTime"] = args ? args.dailySnapshotTime : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["engine"] = args ? args.engine : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["majorEngineVersion"] = args ? args.majorEngineVersion : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined; resourceInputs["snapshotArnsToRestores"] = args ? args.snapshotArnsToRestores : undefined; resourceInputs["snapshotRetentionLimit"] = args ? args.snapshotRetentionLimit : undefined; resourceInputs["subnetIds"] = args ? args.subnetIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["timeouts"] = args ? args.timeouts : undefined; resourceInputs["userGroupId"] = args ? args.userGroupId : undefined; 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