UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

123 lines 4.85 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.UserWorkloadsSecret = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * User workloads Secret used by Airflow tasks that run with Kubernetes Executor or KubernetesPodOperator. * Intended for Composer 3 Environments. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const example = new gcp.composer.Environment("example", { * name: "example-environment", * project: "example-project", * region: "us-central1", * config: { * softwareConfig: { * imageVersion: "example-image-version", * }, * }, * }); * const exampleUserWorkloadsSecret = new gcp.composer.UserWorkloadsSecret("example", { * name: "example-secret", * project: "example-project", * region: "us-central1", * environment: example.name, * data: { * email: std.base64encode({ * input: "example-email", * }).then(invoke => invoke.result), * password: std.base64encode({ * input: "example-password", * }).then(invoke => invoke.result), * }, * }); * ``` * * ## Import * * Secret can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsSecrets/{{name}}` * * * `{{project}}/{{region}}/{{environment}}/{{name}}` * * * `{{environment}}/{{name}}` * * When using the `pulumi import` command, Environment can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:composer/userWorkloadsSecret:UserWorkloadsSecret example projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsSecrets/{{name}} * ``` * * ```sh * $ pulumi import gcp:composer/userWorkloadsSecret:UserWorkloadsSecret example {{project}}/{{region}}/{{environment}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:composer/userWorkloadsSecret:UserWorkloadsSecret example {{environment}}/{{name}} * ``` */ class UserWorkloadsSecret extends pulumi.CustomResource { /** * Get an existing UserWorkloadsSecret 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 UserWorkloadsSecret(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of UserWorkloadsSecret. 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'] === UserWorkloadsSecret.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["data"] = state?.data; resourceInputs["environment"] = state?.environment; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.environment === undefined && !opts.urn) { throw new Error("Missing required property 'environment'"); } resourceInputs["data"] = args?.data ? pulumi.secret(args.data) : undefined; resourceInputs["environment"] = args?.environment; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["data"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(UserWorkloadsSecret.__pulumiType, name, resourceInputs, opts); } } exports.UserWorkloadsSecret = UserWorkloadsSecret; /** @internal */ UserWorkloadsSecret.__pulumiType = 'gcp:composer/userWorkloadsSecret:UserWorkloadsSecret'; //# sourceMappingURL=userWorkloadsSecret.js.map