UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

115 lines 5.17 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.ActionsEnvironmentVariable = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. * You must have write access to a repository to use this resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const exampleVariable = new github.ActionsEnvironmentVariable("example_variable", { * environment: "example_environment", * variableName: "example_variable_name", * value: "example_variable_value", * }); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const repo = github.getRepository({ * fullName: "my-org/repo", * }); * const repoEnvironment = new github.RepositoryEnvironment("repo_environment", { * repository: repo.then(repo => repo.name), * environment: "example_environment", * }); * const exampleVariable = new github.ActionsEnvironmentVariable("example_variable", { * repository: repo.then(repo => repo.name), * environment: repoEnvironment.environment, * variableName: "example_variable_name", * value: "example_variable_value", * }); * ``` * * ## Import * * This resource can be imported using an ID made up of the repository name, environment name, and variable name: * * ```sh * $ pulumi import github:index/actionsEnvironmentVariable:ActionsEnvironmentVariable test_variable myrepo:myenv:myvariable * ``` */ class ActionsEnvironmentVariable extends pulumi.CustomResource { /** * Get an existing ActionsEnvironmentVariable 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 ActionsEnvironmentVariable(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ActionsEnvironmentVariable. 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'] === ActionsEnvironmentVariable.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["environment"] = state ? state.environment : undefined; resourceInputs["repository"] = state ? state.repository : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["value"] = state ? state.value : undefined; resourceInputs["variableName"] = state ? state.variableName : undefined; } else { const args = argsOrState; if ((!args || args.environment === undefined) && !opts.urn) { throw new Error("Missing required property 'environment'"); } if ((!args || args.repository === undefined) && !opts.urn) { throw new Error("Missing required property 'repository'"); } if ((!args || args.value === undefined) && !opts.urn) { throw new Error("Missing required property 'value'"); } if ((!args || args.variableName === undefined) && !opts.urn) { throw new Error("Missing required property 'variableName'"); } resourceInputs["environment"] = args ? args.environment : undefined; resourceInputs["repository"] = args ? args.repository : undefined; resourceInputs["value"] = args ? args.value : undefined; resourceInputs["variableName"] = args ? args.variableName : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ActionsEnvironmentVariable.__pulumiType, name, resourceInputs, opts); } } exports.ActionsEnvironmentVariable = ActionsEnvironmentVariable; /** @internal */ ActionsEnvironmentVariable.__pulumiType = 'github:index/actionsEnvironmentVariable:ActionsEnvironmentVariable'; //# sourceMappingURL=actionsEnvironmentVariable.js.map