UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

91 lines 3.85 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.AclRole = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as consul from "@pulumi/consul"; * * const read_policy = new consul.AclPolicy("read-policy", { * name: "read-policy", * rules: "node \"\" { policy = \"read\" }", * datacenters: ["dc1"], * }); * const read = new consul.AclRole("read", { * name: "foo", * description: "bar", * policies: [read_policy.id], * serviceIdentities: [{ * serviceName: "foo", * }], * }); * ``` * * ## Import * * ```sh * $ pulumi import consul:index/aclRole:AclRole read 816a195f-6cb1-2e8d-92af-3011ae706318 * ``` */ class AclRole extends pulumi.CustomResource { /** * Get an existing AclRole 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 AclRole(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AclRole. 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'] === AclRole.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namespace"] = state ? state.namespace : undefined; resourceInputs["nodeIdentities"] = state ? state.nodeIdentities : undefined; resourceInputs["partition"] = state ? state.partition : undefined; resourceInputs["policies"] = state ? state.policies : undefined; resourceInputs["serviceIdentities"] = state ? state.serviceIdentities : undefined; resourceInputs["templatedPolicies"] = state ? state.templatedPolicies : undefined; } else { const args = argsOrState; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namespace"] = args ? args.namespace : undefined; resourceInputs["nodeIdentities"] = args ? args.nodeIdentities : undefined; resourceInputs["partition"] = args ? args.partition : undefined; resourceInputs["policies"] = args ? args.policies : undefined; resourceInputs["serviceIdentities"] = args ? args.serviceIdentities : undefined; resourceInputs["templatedPolicies"] = args ? args.templatedPolicies : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AclRole.__pulumiType, name, resourceInputs, opts); } } exports.AclRole = AclRole; /** @internal */ AclRole.__pulumiType = 'consul:index/aclRole:AclRole'; //# sourceMappingURL=aclRole.js.map