@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
132 lines • 6.57 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.CertAuthBackendRole = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a resource to create a role in an [Cert auth backend within Vault](https://www.vaultproject.io/docs/auth/cert.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as std from "@pulumi/std";
* import * as vault from "@pulumi/vault";
*
* const cert = new vault.AuthBackend("cert", {
* path: "cert",
* type: "cert",
* });
* const certCertAuthBackendRole = new vault.CertAuthBackendRole("cert", {
* name: "foo",
* certificate: std.file({
* input: "/path/to/certs/ca-cert.pem",
* }).then(invoke => invoke.result),
* backend: cert.path,
* allowedNames: [
* "foo.example.org",
* "baz.example.org",
* ],
* tokenTtl: 300,
* tokenMaxTtl: 600,
* tokenPolicies: ["foo"],
* });
* ```
*/
class CertAuthBackendRole extends pulumi.CustomResource {
/**
* Get an existing CertAuthBackendRole 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 CertAuthBackendRole(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CertAuthBackendRole. 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'] === CertAuthBackendRole.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedCommonNames"] = state?.allowedCommonNames;
resourceInputs["allowedDnsSans"] = state?.allowedDnsSans;
resourceInputs["allowedEmailSans"] = state?.allowedEmailSans;
resourceInputs["allowedNames"] = state?.allowedNames;
resourceInputs["allowedOrganizationalUnits"] = state?.allowedOrganizationalUnits;
resourceInputs["allowedUriSans"] = state?.allowedUriSans;
resourceInputs["backend"] = state?.backend;
resourceInputs["certificate"] = state?.certificate;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["ocspCaCertificates"] = state?.ocspCaCertificates;
resourceInputs["ocspEnabled"] = state?.ocspEnabled;
resourceInputs["ocspFailOpen"] = state?.ocspFailOpen;
resourceInputs["ocspQueryAllServers"] = state?.ocspQueryAllServers;
resourceInputs["ocspServersOverrides"] = state?.ocspServersOverrides;
resourceInputs["requiredExtensions"] = state?.requiredExtensions;
resourceInputs["tokenBoundCidrs"] = state?.tokenBoundCidrs;
resourceInputs["tokenExplicitMaxTtl"] = state?.tokenExplicitMaxTtl;
resourceInputs["tokenMaxTtl"] = state?.tokenMaxTtl;
resourceInputs["tokenNoDefaultPolicy"] = state?.tokenNoDefaultPolicy;
resourceInputs["tokenNumUses"] = state?.tokenNumUses;
resourceInputs["tokenPeriod"] = state?.tokenPeriod;
resourceInputs["tokenPolicies"] = state?.tokenPolicies;
resourceInputs["tokenTtl"] = state?.tokenTtl;
resourceInputs["tokenType"] = state?.tokenType;
}
else {
const args = argsOrState;
if (args?.certificate === undefined && !opts.urn) {
throw new Error("Missing required property 'certificate'");
}
resourceInputs["allowedCommonNames"] = args?.allowedCommonNames;
resourceInputs["allowedDnsSans"] = args?.allowedDnsSans;
resourceInputs["allowedEmailSans"] = args?.allowedEmailSans;
resourceInputs["allowedNames"] = args?.allowedNames;
resourceInputs["allowedOrganizationalUnits"] = args?.allowedOrganizationalUnits;
resourceInputs["allowedUriSans"] = args?.allowedUriSans;
resourceInputs["backend"] = args?.backend;
resourceInputs["certificate"] = args?.certificate;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["ocspCaCertificates"] = args?.ocspCaCertificates;
resourceInputs["ocspEnabled"] = args?.ocspEnabled;
resourceInputs["ocspFailOpen"] = args?.ocspFailOpen;
resourceInputs["ocspQueryAllServers"] = args?.ocspQueryAllServers;
resourceInputs["ocspServersOverrides"] = args?.ocspServersOverrides;
resourceInputs["requiredExtensions"] = args?.requiredExtensions;
resourceInputs["tokenBoundCidrs"] = args?.tokenBoundCidrs;
resourceInputs["tokenExplicitMaxTtl"] = args?.tokenExplicitMaxTtl;
resourceInputs["tokenMaxTtl"] = args?.tokenMaxTtl;
resourceInputs["tokenNoDefaultPolicy"] = args?.tokenNoDefaultPolicy;
resourceInputs["tokenNumUses"] = args?.tokenNumUses;
resourceInputs["tokenPeriod"] = args?.tokenPeriod;
resourceInputs["tokenPolicies"] = args?.tokenPolicies;
resourceInputs["tokenTtl"] = args?.tokenTtl;
resourceInputs["tokenType"] = args?.tokenType;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CertAuthBackendRole.__pulumiType, name, resourceInputs, opts);
}
}
exports.CertAuthBackendRole = CertAuthBackendRole;
/** @internal */
CertAuthBackendRole.__pulumiType = 'vault:index/certAuthBackendRole:CertAuthBackendRole';
//# sourceMappingURL=certAuthBackendRole.js.map