UNPKG

@spacelift-io/pulumi-spacelift

Version:

A Pulumi package for creating and managing Spacelift resources.

90 lines 4.1 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.StackGcpServiceAccount = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as google from "@pulumi/google"; * import * as spacelift from "@spacelift-io/pulumi-spacelift"; * * const k8s_coreStack = new spacelift.Stack("k8s-coreStack", { * branch: "master", * repository: "core-infra", * }); * const k8s_coreStackGcpServiceAccount = new spacelift.StackGcpServiceAccount("k8s-coreStackGcpServiceAccount", { * stackId: k8s_coreStack.id, * tokenScopes: [ * "https://www.googleapis.com/auth/compute", * "https://www.googleapis.com/auth/cloud-platform", * "https://www.googleapis.com/auth/devstorage.full_control", * ], * }); * const k8s_coregoogle_project = new google.index.Google_project("k8s-coregoogle_project", { * name: "Kubernetes code", * projectId: "unicorn-k8s-core", * orgId: _var.gcp_organization_id, * }); * const k8s_coregoogle_project_iam_member = new google.index.Google_project_iam_member("k8s-coregoogle_project_iam_member", { * project: k8s_coregoogle_project.id, * role: "roles/owner", * member: `serviceAccount:${k8s_coreStackGcpServiceAccount.serviceAccountEmail}`, * }); * ``` */ class StackGcpServiceAccount extends pulumi.CustomResource { /** * Get an existing StackGcpServiceAccount 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 StackGcpServiceAccount(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of StackGcpServiceAccount. 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'] === StackGcpServiceAccount.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["moduleId"] = state ? state.moduleId : undefined; resourceInputs["serviceAccountEmail"] = state ? state.serviceAccountEmail : undefined; resourceInputs["stackId"] = state ? state.stackId : undefined; resourceInputs["tokenScopes"] = state ? state.tokenScopes : undefined; } else { const args = argsOrState; if ((!args || args.tokenScopes === undefined) && !opts.urn) { throw new Error("Missing required property 'tokenScopes'"); } resourceInputs["moduleId"] = args ? args.moduleId : undefined; resourceInputs["stackId"] = args ? args.stackId : undefined; resourceInputs["tokenScopes"] = args ? args.tokenScopes : undefined; resourceInputs["serviceAccountEmail"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(StackGcpServiceAccount.__pulumiType, name, resourceInputs, opts); } } exports.StackGcpServiceAccount = StackGcpServiceAccount; /** @internal */ StackGcpServiceAccount.__pulumiType = 'spacelift:index/stackGcpServiceAccount:StackGcpServiceAccount'; //# sourceMappingURL=stackGcpServiceAccount.js.map