UNPKG

@piclemx/pulumi-opensearch

Version:

A Pulumi package for creating and managing Opensearch resources. Based on terraform-provider-opensearch: version v2.2.1

91 lines 4 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.IsmPolicyMapping = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides an OpenSearch Index State Management (ISM) policy. Please refer to the OpenSearch ISM documentation for details. * * !> `opensearch.IsmPolicyMapping` is deprecated in OpenSearch 1.x please use the `opensearch.IsmPolicy` resource and specify the `ismTemplate` attribute in the policies instead. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as opensearch from "@piclemx/pulumi-opensearch"; * * const test = new opensearch.IsmPolicyMapping("test", { * indexes: "test_index", * policyId: "policy_1", * state: "delete", * }); * ``` * * ## Import * * Import by poilcy_id * * ```sh * $ pulumi import opensearch:index/ismPolicyMapping:IsmPolicyMapping test policy_1 * ``` */ class IsmPolicyMapping extends pulumi.CustomResource { /** * Get an existing IsmPolicyMapping 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 IsmPolicyMapping(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of IsmPolicyMapping. 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'] === IsmPolicyMapping.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["includes"] = state ? state.includes : undefined; resourceInputs["indexes"] = state ? state.indexes : undefined; resourceInputs["isSafe"] = state ? state.isSafe : undefined; resourceInputs["managedIndexes"] = state ? state.managedIndexes : undefined; resourceInputs["policyId"] = state ? state.policyId : undefined; resourceInputs["state"] = state ? state.state : undefined; } else { const args = argsOrState; if ((!args || args.indexes === undefined) && !opts.urn) { throw new Error("Missing required property 'indexes'"); } if ((!args || args.policyId === undefined) && !opts.urn) { throw new Error("Missing required property 'policyId'"); } resourceInputs["includes"] = args ? args.includes : undefined; resourceInputs["indexes"] = args ? args.indexes : undefined; resourceInputs["isSafe"] = args ? args.isSafe : undefined; resourceInputs["managedIndexes"] = args ? args.managedIndexes : undefined; resourceInputs["policyId"] = args ? args.policyId : undefined; resourceInputs["state"] = args ? args.state : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IsmPolicyMapping.__pulumiType, name, resourceInputs, opts); } } exports.IsmPolicyMapping = IsmPolicyMapping; /** @internal */ IsmPolicyMapping.__pulumiType = 'opensearch:index/ismPolicyMapping:IsmPolicyMapping'; //# sourceMappingURL=ismPolicyMapping.js.map