UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

127 lines 5.6 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.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, Object.assign(Object.assign({}, 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 ? state.config : undefined; resourceInputs["configJson"] = state ? state.configJson : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["maxTokenTtl"] = state ? state.maxTokenTtl : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namespace"] = state ? state.namespace : undefined; resourceInputs["namespaceRules"] = state ? state.namespaceRules : undefined; resourceInputs["partition"] = state ? state.partition : undefined; resourceInputs["tokenLocality"] = state ? state.tokenLocality : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["config"] = args ? args.config : undefined; resourceInputs["configJson"] = args ? args.configJson : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["maxTokenTtl"] = args ? args.maxTokenTtl : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namespace"] = args ? args.namespace : undefined; resourceInputs["namespaceRules"] = args ? args.namespaceRules : undefined; resourceInputs["partition"] = args ? args.partition : undefined; resourceInputs["tokenLocality"] = args ? args.tokenLocality : undefined; resourceInputs["type"] = args ? args.type : undefined; } 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