UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

80 lines 4.04 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.CodespacesSecret = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ## Import * * This resource can be imported using an ID made up of the `repository` and `secret_name`: * * ```sh * $ pulumi import github:index/codespacesSecret:CodespacesSecret example_secret example_repository/example_secret_name * ``` * NOTE: the implementation is limited in that it won't fetch the value of the * `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. */ class CodespacesSecret extends pulumi.CustomResource { /** * Get an existing CodespacesSecret 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 CodespacesSecret(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CodespacesSecret. 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'] === CodespacesSecret.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["encryptedValue"] = state ? state.encryptedValue : undefined; resourceInputs["plaintextValue"] = state ? state.plaintextValue : undefined; resourceInputs["repository"] = state ? state.repository : undefined; resourceInputs["secretName"] = state ? state.secretName : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState; if ((!args || args.repository === undefined) && !opts.urn) { throw new Error("Missing required property 'repository'"); } if ((!args || args.secretName === undefined) && !opts.urn) { throw new Error("Missing required property 'secretName'"); } resourceInputs["encryptedValue"] = (args === null || args === void 0 ? void 0 : args.encryptedValue) ? pulumi.secret(args.encryptedValue) : undefined; resourceInputs["plaintextValue"] = (args === null || args === void 0 ? void 0 : args.plaintextValue) ? pulumi.secret(args.plaintextValue) : undefined; resourceInputs["repository"] = args ? args.repository : undefined; resourceInputs["secretName"] = args ? args.secretName : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["encryptedValue", "plaintextValue"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(CodespacesSecret.__pulumiType, name, resourceInputs, opts); } } exports.CodespacesSecret = CodespacesSecret; /** @internal */ CodespacesSecret.__pulumiType = 'github:index/codespacesSecret:CodespacesSecret'; //# sourceMappingURL=codespacesSecret.js.map