@piclemx/pulumi-opensearch
Version:
A Pulumi package for creating and managing Opensearch resources. Based on terraform-provider-opensearch: version v2.2.1
88 lines • 3.81 kB
JavaScript
;
// *** 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.RolesMapping = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides an OpenSearch security role mapping. Please refer to the OpenSearch Access Control documentation for details.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opensearch from "@piclemx/pulumi-opensearch";
*
* // Create a role mapping
* const mapper = new opensearch.RolesMapping("mapper", {
* backendRoles: [
* "arn:aws:iam::123456789012:role/lambda-call-opensearch",
* "arn:aws:iam::123456789012:role/run-containers",
* ],
* description: "Mapping AWS IAM roles to ES role",
* roleName: "logs_writer",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import opensearch:index/rolesMapping:RolesMapping mapper logs_writer
* ```
*/
class RolesMapping extends pulumi.CustomResource {
/**
* Get an existing RolesMapping 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 RolesMapping(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RolesMapping. 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'] === RolesMapping.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["andBackendRoles"] = state ? state.andBackendRoles : undefined;
resourceInputs["backendRoles"] = state ? state.backendRoles : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["hosts"] = state ? state.hosts : undefined;
resourceInputs["roleName"] = state ? state.roleName : undefined;
resourceInputs["users"] = state ? state.users : undefined;
}
else {
const args = argsOrState;
if ((!args || args.roleName === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleName'");
}
resourceInputs["andBackendRoles"] = args ? args.andBackendRoles : undefined;
resourceInputs["backendRoles"] = args ? args.backendRoles : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["hosts"] = args ? args.hosts : undefined;
resourceInputs["roleName"] = args ? args.roleName : undefined;
resourceInputs["users"] = args ? args.users : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RolesMapping.__pulumiType, name, resourceInputs, opts);
}
}
exports.RolesMapping = RolesMapping;
/** @internal */
RolesMapping.__pulumiType = 'opensearch:index/rolesMapping:RolesMapping';
//# sourceMappingURL=rolesMapping.js.map