UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

127 lines 5.13 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.AclAuthMethod = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Starting with Consul 1.5.0, the `consul.AclAuthMethod` resource can be used to managed [Consul ACL auth methods](https://www.consul.io/docs/acl/auth-methods). * * ## Example Usage * * Define a `kubernetes` auth method: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as consul from "@pulumi/consul"; * * const minikube = new consul.AclAuthMethod("minikube", { * name: "minikube", * type: "kubernetes", * description: "dev minikube cluster", * configJson: JSON.stringify({ * Host: "https://192.0.2.42:8443", * CACert: `-----BEGIN CERTIFICATE----- * ...-----END CERTIFICATE----- * `, * ServiceAccountJWT: "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9...", * }), * }); * ``` * * Define a `jwt` auth method: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as consul from "@pulumi/consul"; * * const oidc = new consul.AclAuthMethod("oidc", { * name: "auth0", * type: "oidc", * maxTokenTtl: "5m", * configJson: JSON.stringify({ * AllowedRedirectURIs: [ * "http://localhost:8550/oidc/callback", * "http://localhost:8500/ui/oidc/callback", * ], * BoundAudiences: ["V1RPi2MYptMV1RPi2MYptMV1RPi2MYpt"], * ClaimMappings: { * "http://example.com/first_name": "first_name", * "http://example.com/last_name": "last_name", * }, * ListClaimMappings: { * "http://consul.com/groups": "groups", * }, * OIDCClientID: "V1RPi2MYptMV1RPi2MYptMV1RPi2MYpt", * OIDCClientSecret: "...(omitted)...", * OIDCDiscoveryURL: "https://my-corp-app-name.auth0.com/", * }), * }); * ``` */ class AclAuthMethod extends pulumi.CustomResource { /** * Get an existing AclAuthMethod 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 AclAuthMethod(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AclAuthMethod. 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'] === AclAuthMethod.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["config"] = state?.config; resourceInputs["configJson"] = state?.configJson; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["maxTokenTtl"] = state?.maxTokenTtl; resourceInputs["name"] = state?.name; resourceInputs["namespace"] = state?.namespace; resourceInputs["namespaceRules"] = state?.namespaceRules; resourceInputs["partition"] = state?.partition; resourceInputs["tokenLocality"] = state?.tokenLocality; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["config"] = args?.config; resourceInputs["configJson"] = args?.configJson; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["maxTokenTtl"] = args?.maxTokenTtl; resourceInputs["name"] = args?.name; resourceInputs["namespace"] = args?.namespace; resourceInputs["namespaceRules"] = args?.namespaceRules; resourceInputs["partition"] = args?.partition; resourceInputs["tokenLocality"] = args?.tokenLocality; resourceInputs["type"] = args?.type; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AclAuthMethod.__pulumiType, name, resourceInputs, opts); } } exports.AclAuthMethod = AclAuthMethod; /** @internal */ AclAuthMethod.__pulumiType = 'consul:index/aclAuthMethod:AclAuthMethod'; //# sourceMappingURL=aclAuthMethod.js.map