@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
119 lines • 5.4 kB
JavaScript
;
// *** 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.SigningProfilePermission = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates a Signer Signing Profile Permission. That is, a cross-account permission for a signing profile.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const prodSp = new aws.signer.SigningProfile("prod_sp", {
* platformId: "AWSLambda-SHA384-ECDSA",
* namePrefix: "prod_sp_",
* signatureValidityPeriod: {
* value: 5,
* type: "YEARS",
* },
* tags: {
* tag1: "value1",
* tag2: "value2",
* },
* });
* const spPermission1 = new aws.signer.SigningProfilePermission("sp_permission_1", {
* profileName: prodSp.name,
* action: "signer:StartSigningJob",
* principal: awsAccount,
* });
* const spPermission2 = new aws.signer.SigningProfilePermission("sp_permission_2", {
* profileName: prodSp.name,
* action: "signer:GetSigningProfile",
* principal: awsTeamRoleArn,
* statementId: "ProdAccountStartSigningJob_StatementId",
* });
* const spPermission3 = new aws.signer.SigningProfilePermission("sp_permission_3", {
* profileName: prodSp.name,
* action: "signer:RevokeSignature",
* principal: "123456789012",
* profileVersion: prodSp.version,
* statementIdPrefix: "version-permission-",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Signer signing profile permission statements using profile_name/statement_id. For example:
*
* ```sh
* $ pulumi import aws:signer/signingProfilePermission:SigningProfilePermission test_signer_signing_profile_permission prod_profile_DdW3Mk1foYL88fajut4mTVFGpuwfd4ACO6ANL0D1uIj7lrn8adK/ProdAccountStartSigningJobStatementId
* ```
*/
class SigningProfilePermission extends pulumi.CustomResource {
/**
* Get an existing SigningProfilePermission 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 SigningProfilePermission(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SigningProfilePermission. 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'] === SigningProfilePermission.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["principal"] = state ? state.principal : undefined;
resourceInputs["profileName"] = state ? state.profileName : undefined;
resourceInputs["profileVersion"] = state ? state.profileVersion : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["statementId"] = state ? state.statementId : undefined;
resourceInputs["statementIdPrefix"] = state ? state.statementIdPrefix : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.principal === undefined) && !opts.urn) {
throw new Error("Missing required property 'principal'");
}
if ((!args || args.profileName === undefined) && !opts.urn) {
throw new Error("Missing required property 'profileName'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["principal"] = args ? args.principal : undefined;
resourceInputs["profileName"] = args ? args.profileName : undefined;
resourceInputs["profileVersion"] = args ? args.profileVersion : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["statementId"] = args ? args.statementId : undefined;
resourceInputs["statementIdPrefix"] = args ? args.statementIdPrefix : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SigningProfilePermission.__pulumiType, name, resourceInputs, opts);
}
}
exports.SigningProfilePermission = SigningProfilePermission;
/** @internal */
SigningProfilePermission.__pulumiType = 'aws:signer/signingProfilePermission:SigningProfilePermission';
//# sourceMappingURL=signingProfilePermission.js.map