@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
95 lines • 3.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.AuthBackendUser = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to create a user in an
* [Okta auth backend within Vault](https://www.vaultproject.io/docs/auth/okta.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const example = new vault.okta.AuthBackend("example", {
* path: "user_okta",
* organization: "dummy",
* });
* const foo = new vault.okta.AuthBackendUser("foo", {
* path: example.path,
* username: "foo",
* groups: [
* "one",
* "two",
* ],
* });
* ```
*
* ## Import
*
* Okta authentication backend users can be imported using its `path/user` ID format, e.g.
*
* ```sh
* $ pulumi import vault:okta/authBackendUser:AuthBackendUser example okta/foo
* ```
*/
class AuthBackendUser extends pulumi.CustomResource {
/**
* Get an existing AuthBackendUser 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 AuthBackendUser(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AuthBackendUser. 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'] === AuthBackendUser.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["groups"] = state?.groups;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["path"] = state?.path;
resourceInputs["policies"] = state?.policies;
resourceInputs["username"] = state?.username;
}
else {
const args = argsOrState;
if (args?.path === undefined && !opts.urn) {
throw new Error("Missing required property 'path'");
}
if (args?.username === undefined && !opts.urn) {
throw new Error("Missing required property 'username'");
}
resourceInputs["groups"] = args?.groups;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["path"] = args?.path;
resourceInputs["policies"] = args?.policies;
resourceInputs["username"] = args?.username;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AuthBackendUser.__pulumiType, name, resourceInputs, opts);
}
}
exports.AuthBackendUser = AuthBackendUser;
/** @internal */
AuthBackendUser.__pulumiType = 'vault:okta/authBackendUser:AuthBackendUser';
//# sourceMappingURL=authBackendUser.js.map