@spacelift-io/pulumi-spacelift
Version:
A Pulumi package for creating and managing Spacelift resources.
73 lines • 4.47 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.StackAwsRole = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > **Note:** `spacelift.StackAwsRole` is deprecated. Please use `spacelift.AwsRole` instead. The functionality is identical.
*
* **NOTE:** while this resource continues to work, we have replaced it with the `spacelift.AwsIntegration` resource. The new resource allows integrations to be shared by multiple stacks/modules and also supports separate read vs write roles. Please use the `spacelift.AwsIntegration` resource instead.
*
* `spacelift.StackAwsRole` represents [cross-account IAM role delegation](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) between the Spacelift worker and an individual stack or module. If this is set, Spacelift will use AWS STS to assume the supplied IAM role and put its temporary credentials in the runtime environment.
*
* If you use private workers, you can also assume IAM role on the worker side using your own AWS credentials (e.g. from EC2 instance profile).
*
* Note: when assuming credentials for **shared worker**, Spacelift will use `$accountName@$stackID` or `$accountName@$moduleID` as [external ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) and `$runID@$stackID@$accountName` truncated to 64 characters as [session ID](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole).
*/
class StackAwsRole extends pulumi.CustomResource {
/**
* Get an existing StackAwsRole 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 StackAwsRole(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of StackAwsRole. 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'] === StackAwsRole.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["durationSeconds"] = state ? state.durationSeconds : undefined;
resourceInputs["externalId"] = state ? state.externalId : undefined;
resourceInputs["generateCredentialsInWorker"] = state ? state.generateCredentialsInWorker : undefined;
resourceInputs["moduleId"] = state ? state.moduleId : undefined;
resourceInputs["roleArn"] = state ? state.roleArn : undefined;
resourceInputs["stackId"] = state ? state.stackId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.roleArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
resourceInputs["durationSeconds"] = args ? args.durationSeconds : undefined;
resourceInputs["externalId"] = args ? args.externalId : undefined;
resourceInputs["generateCredentialsInWorker"] = args ? args.generateCredentialsInWorker : undefined;
resourceInputs["moduleId"] = args ? args.moduleId : undefined;
resourceInputs["roleArn"] = args ? args.roleArn : undefined;
resourceInputs["stackId"] = args ? args.stackId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StackAwsRole.__pulumiType, name, resourceInputs, opts);
}
}
exports.StackAwsRole = StackAwsRole;
/** @internal */
StackAwsRole.__pulumiType = 'spacelift:index/stackAwsRole:StackAwsRole';
//# sourceMappingURL=stackAwsRole.js.map