@spacelift-io/pulumi-spacelift
Version:
A Pulumi package for creating and managing Spacelift resources.
100 lines • 4.26 kB
JavaScript
;
// *** 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.GcpServiceAccount = 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_coreGcpServiceAccount = new spacelift.GcpServiceAccount("k8s-coreGcpServiceAccount", {
* 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_coreGcpServiceAccount.serviceAccountEmail}`,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import spacelift:index/gcpServiceAccount:GcpServiceAccount k8s-core stack/$STACK_ID
* ```
*
* ```sh
* $ pulumi import spacelift:index/gcpServiceAccount:GcpServiceAccount k8s-core module/$MODULE_ID
* ```
*/
class GcpServiceAccount extends pulumi.CustomResource {
/**
* Get an existing GcpServiceAccount 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 GcpServiceAccount(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GcpServiceAccount. 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'] === GcpServiceAccount.__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(GcpServiceAccount.__pulumiType, name, resourceInputs, opts);
}
}
exports.GcpServiceAccount = GcpServiceAccount;
/** @internal */
GcpServiceAccount.__pulumiType = 'spacelift:index/gcpServiceAccount:GcpServiceAccount';
//# sourceMappingURL=gcpServiceAccount.js.map