UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

170 lines 7.35 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.SecretV1 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Simple secret * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const secret1 = new openstack.keymanager.SecretV1("secret_1", { * algorithm: "aes", * bitLength: 256, * mode: "cbc", * name: "mysecret", * payload: "foobar", * payloadContentType: "text/plain", * secretType: "passphrase", * metadata: { * key: "foo", * }, * }); * ``` * * ### Secret with whitespaces * * > **Note** If you want to store payload with leading or trailing whitespaces, * it's recommended to store it in a base64 encoding. Plain text payload can also * work, but further addind or removing of the leading or trailing whitespaces * won't be detected as a state change, e.g. changing plain text payload from * ` password ` to `password` won't recreate the secret. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * import * as std from "@pulumi/std"; * * const secret1 = new openstack.keymanager.SecretV1("secret_1", { * name: "password", * payload: std.base64encode({ * input: "password with the whitespace at the end ", * }).then(invoke => invoke.result), * secretType: "passphrase", * payloadContentType: "application/octet-stream", * payloadContentEncoding: "base64", * }); * ``` * * ### Secret with the ACL * * > **Note** Only read ACLs are supported * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * import * as std from "@pulumi/std"; * * const secret1 = new openstack.keymanager.SecretV1("secret_1", { * name: "certificate", * payload: std.file({ * input: "certificate.pem", * }).then(invoke => invoke.result), * secretType: "certificate", * payloadContentType: "text/plain", * acl: { * read: { * projectAccess: false, * users: [ * "userid1", * "userid2", * ], * }, * }, * }); * ``` * * ## Import * * Secrets can be imported using the secret id (the last part of the secret reference), e.g.: * * ```sh * $ pulumi import openstack:keymanager/secretV1:SecretV1 secret_1 8a7a79c2-cf17-4e65-b2ae-ddc8bfcf6c74 * ``` */ class SecretV1 extends pulumi.CustomResource { /** * Get an existing SecretV1 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 SecretV1(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SecretV1. 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'] === SecretV1.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acl"] = state ? state.acl : undefined; resourceInputs["algorithm"] = state ? state.algorithm : undefined; resourceInputs["allMetadata"] = state ? state.allMetadata : undefined; resourceInputs["bitLength"] = state ? state.bitLength : undefined; resourceInputs["contentTypes"] = state ? state.contentTypes : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["creatorId"] = state ? state.creatorId : undefined; resourceInputs["expiration"] = state ? state.expiration : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["mode"] = state ? state.mode : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["payload"] = state ? state.payload : undefined; resourceInputs["payloadContentEncoding"] = state ? state.payloadContentEncoding : undefined; resourceInputs["payloadContentType"] = state ? state.payloadContentType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["secretRef"] = state ? state.secretRef : undefined; resourceInputs["secretType"] = state ? state.secretType : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState; resourceInputs["acl"] = args ? args.acl : undefined; resourceInputs["algorithm"] = args ? args.algorithm : undefined; resourceInputs["bitLength"] = args ? args.bitLength : undefined; resourceInputs["expiration"] = args ? args.expiration : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["mode"] = args ? args.mode : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["payload"] = (args === null || args === void 0 ? void 0 : args.payload) ? pulumi.secret(args.payload) : undefined; resourceInputs["payloadContentEncoding"] = args ? args.payloadContentEncoding : undefined; resourceInputs["payloadContentType"] = args ? args.payloadContentType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["secretType"] = args ? args.secretType : undefined; resourceInputs["allMetadata"] = undefined /*out*/; resourceInputs["contentTypes"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["creatorId"] = undefined /*out*/; resourceInputs["secretRef"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["payload"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(SecretV1.__pulumiType, name, resourceInputs, opts); } } exports.SecretV1 = SecretV1; /** @internal */ SecretV1.__pulumiType = 'openstack:keymanager/secretV1:SecretV1'; //# sourceMappingURL=secretV1.js.map