@pulumi/nomad
Version:
A Pulumi package for creating and managing nomad cloud resources.
107 lines • 4.67 kB
JavaScript
;
// *** 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");
/**
* Manages an ACL Auth Method in Nomad.
*
* ## Example Usage
*
* Creating an ALC Auth Method:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as nomad from "@pulumi/nomad";
*
* const myNomadAclAuthMethod = new nomad.AclAuthMethod("my_nomad_acl_auth_method", {
* name: "my-nomad-acl-auth-method",
* type: "OIDC",
* tokenLocality: "global",
* maxTokenTtl: "10m0s",
* tokenNameFormat: `${auth_method_type}-${value.user}`,
* "default": true,
* config: {
* oidcDiscoveryUrl: "https://uk.auth0.com/",
* oidcClientId: "someclientid",
* oidcClientSecret: "someclientsecret-t",
* boundAudiences: ["someclientid"],
* allowedRedirectUris: [
* "http://localhost:4649/oidc/callback",
* "http://localhost:4646/ui/settings/tokens",
* ],
* listClaimMappings: {
* "http://nomad.internal/roles": "roles",
* },
* },
* });
* ```
*/
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["default"] = state ? state.default : undefined;
resourceInputs["maxTokenTtl"] = state ? state.maxTokenTtl : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["tokenLocality"] = state ? state.tokenLocality : undefined;
resourceInputs["tokenNameFormat"] = state ? state.tokenNameFormat : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.config === undefined) && !opts.urn) {
throw new Error("Missing required property 'config'");
}
if ((!args || args.maxTokenTtl === undefined) && !opts.urn) {
throw new Error("Missing required property 'maxTokenTtl'");
}
if ((!args || args.tokenLocality === undefined) && !opts.urn) {
throw new Error("Missing required property 'tokenLocality'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["default"] = args ? args.default : undefined;
resourceInputs["maxTokenTtl"] = args ? args.maxTokenTtl : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["tokenLocality"] = args ? args.tokenLocality : undefined;
resourceInputs["tokenNameFormat"] = args ? args.tokenNameFormat : 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 = 'nomad:index/aclAuthMethod:AclAuthMethod';
//# sourceMappingURL=aclAuthMethod.js.map