agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.codepipeline.actions"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CodePipeline.Actions"
},
"python": {
"module": "aws_cdk.aws_codepipeline_actions"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
export * from './lib';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import * as codepipeline from '../../aws-codepipeline';
/**
* Low-level class for generic CodePipeline Actions.
* If you're implementing your own IAction,
* prefer to use the Action class from the codepipeline module.
*/
export declare abstract class Action extends codepipeline.Action {
protected readonly providedActionProperties: codepipeline.ActionProperties;
protected constructor(actionProperties: codepipeline.ActionProperties);
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Action=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../aws-codepipeline");return codepipeline=()=>tmp,tmp};class Action extends codepipeline().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.Action",version:"2.252.0"};providedActionProperties;constructor(actionProperties){super();try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionProperties(actionProperties)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Action),error}this.providedActionProperties=actionProperties}}exports.Action=Action;

View File

@@ -0,0 +1,41 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type { SecretValue } from '../../../core';
import { Action } from '../action';
/**
* Construction properties of the `AlexaSkillDeployAction Alexa deploy Action`.
*/
export interface AlexaSkillDeployActionProps extends codepipeline.CommonActionProps {
/**
* The client id of the developer console token
*/
readonly clientId: string;
/**
* The client secret of the developer console token
*/
readonly clientSecret: SecretValue;
/**
* The refresh token of the developer console token
*/
readonly refreshToken: SecretValue;
/**
* The Alexa skill id
*/
readonly skillId: string;
/**
* The source artifact containing the voice model and skill manifest
*/
readonly input: codepipeline.Artifact;
/**
* An optional artifact containing overrides for the skill manifest
*/
readonly parameterOverridesArtifact?: codepipeline.Artifact;
}
/**
* Deploys the skill to Alexa
*/
export declare class AlexaSkillDeployAction extends Action {
private readonly props;
constructor(props: AlexaSkillDeployActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlexaSkillDeployAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class AlexaSkillDeployAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.AlexaSkillDeployAction",version:"2.252.0"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.DEPLOY,owner:"ThirdParty",provider:"AlexaSkillsKit",artifactBounds:{minInputs:1,maxInputs:2,minOutputs:0,maxOutputs:0},inputs:getInputs(props)});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_AlexaSkillDeployActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AlexaSkillDeployAction),error}this.props=props}bound(_scope,_stage,_options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return{configuration:{ClientId:this.props.clientId,ClientSecret:this.props.clientSecret.unsafeUnwrap(),RefreshToken:this.props.refreshToken.unsafeUnwrap(),SkillId:this.props.skillId}}}}exports.AlexaSkillDeployAction=AlexaSkillDeployAction;function getInputs(props){const ret=[props.input];return props.parameterOverridesArtifact&&ret.push(props.parameterOverridesArtifact),ret}

View File

@@ -0,0 +1,4 @@
import type { Construct } from 'constructs';
import type * as codepipeline from '../../../aws-codepipeline';
import type * as events from '../../../aws-events';
import type { CodeStarConnectionsSourceActionProps } from '../codestar-connections/source-action';

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitBucketSourceAction=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var source_action_1=()=>{var tmp=require("../codestar-connections/source-action");return source_action_1=()=>tmp,tmp};class BitBucketSourceAction{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.BitBucketSourceAction",version:"2.252.0"};codeStarConnectionsSourceAction;constructor(props){this.codeStarConnectionsSourceAction=new(source_action_1()).CodeStarConnectionsSourceAction(props)}get actionProperties(){return this.codeStarConnectionsSourceAction.actionProperties}bind(scope,stage,options){return this.codeStarConnectionsSourceAction.bind(scope,stage,options)}onStateChange(name,target,options){return this.codeStarConnectionsSourceAction.onStateChange(name,target,options)}}exports.BitBucketSourceAction=BitBucketSourceAction;

View File

@@ -0,0 +1,4 @@
export * from './pipeline-actions';
export * from './stackset-action';
export * from './stackinstances-action';
export * from './stackset-types';

View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.CloudFormationExecuteChangeSetAction=void 0,Object.defineProperty(exports,_noFold="CloudFormationExecuteChangeSetAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./pipeline-actions").CloudFormationExecuteChangeSetAction;return Object.defineProperty(exports,_noFold="CloudFormationExecuteChangeSetAction",{enumerable:!0,configurable:!0,value}),value}}),exports.CloudFormationCreateReplaceChangeSetAction=void 0,Object.defineProperty(exports,_noFold="CloudFormationCreateReplaceChangeSetAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./pipeline-actions").CloudFormationCreateReplaceChangeSetAction;return Object.defineProperty(exports,_noFold="CloudFormationCreateReplaceChangeSetAction",{enumerable:!0,configurable:!0,value}),value}}),exports.CloudFormationCreateUpdateStackAction=void 0,Object.defineProperty(exports,_noFold="CloudFormationCreateUpdateStackAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./pipeline-actions").CloudFormationCreateUpdateStackAction;return Object.defineProperty(exports,_noFold="CloudFormationCreateUpdateStackAction",{enumerable:!0,configurable:!0,value}),value}}),exports.CloudFormationDeleteStackAction=void 0,Object.defineProperty(exports,_noFold="CloudFormationDeleteStackAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./pipeline-actions").CloudFormationDeleteStackAction;return Object.defineProperty(exports,_noFold="CloudFormationDeleteStackAction",{enumerable:!0,configurable:!0,value}),value}}),exports.CloudFormationDeployStackSetAction=void 0,Object.defineProperty(exports,_noFold="CloudFormationDeployStackSetAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackset-action").CloudFormationDeployStackSetAction;return Object.defineProperty(exports,_noFold="CloudFormationDeployStackSetAction",{enumerable:!0,configurable:!0,value}),value}}),exports.CloudFormationDeployStackInstancesAction=void 0,Object.defineProperty(exports,_noFold="CloudFormationDeployStackInstancesAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackinstances-action").CloudFormationDeployStackInstancesAction;return Object.defineProperty(exports,_noFold="CloudFormationDeployStackInstancesAction",{enumerable:!0,configurable:!0,value}),value}}),exports.StackSetTemplate=void 0,Object.defineProperty(exports,_noFold="StackSetTemplate",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackset-types").StackSetTemplate;return Object.defineProperty(exports,_noFold="StackSetTemplate",{enumerable:!0,configurable:!0,value}),value}}),exports.StackInstances=void 0,Object.defineProperty(exports,_noFold="StackInstances",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackset-types").StackInstances;return Object.defineProperty(exports,_noFold="StackInstances",{enumerable:!0,configurable:!0,value}),value}}),exports.StackSetParameters=void 0,Object.defineProperty(exports,_noFold="StackSetParameters",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackset-types").StackSetParameters;return Object.defineProperty(exports,_noFold="StackSetParameters",{enumerable:!0,configurable:!0,value}),value}}),exports.StackSetDeploymentModel=void 0,Object.defineProperty(exports,_noFold="StackSetDeploymentModel",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackset-types").StackSetDeploymentModel;return Object.defineProperty(exports,_noFold="StackSetDeploymentModel",{enumerable:!0,configurable:!0,value}),value}}),exports.StackSetOrganizationsAutoDeployment=void 0,Object.defineProperty(exports,_noFold="StackSetOrganizationsAutoDeployment",{enumerable:!0,configurable:!0,get:()=>{var value=require("./stackset-types").StackSetOrganizationsAutoDeployment;return Object.defineProperty(exports,_noFold="StackSetOrganizationsAutoDeployment",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,270 @@
import type { Construct } from 'constructs';
import * as cloudformation from '../../../aws-cloudformation';
import * as codepipeline from '../../../aws-codepipeline';
import * as iam from '../../../aws-iam';
import * as cdk from '../../../core';
import { Action } from '../action';
/**
* Properties common to all CloudFormation actions
*/
interface CloudFormationActionProps extends codepipeline.CommonAwsActionProps {
/**
* The name of the stack to apply this action to
*/
readonly stackName: string;
/**
* A name for the filename in the output artifact to store the AWS CloudFormation call's result.
*
* The file will contain the result of the call to AWS CloudFormation (for example
* the call to UpdateStack or CreateChangeSet).
*
* AWS CodePipeline adds the file to the output artifact after performing
* the specified action.
*
* @default No output artifact generated
*/
readonly outputFileName?: string;
/**
* The name of the output artifact to generate
*
* Only applied if `outputFileName` is set as well.
*
* @default Automatically generated artifact name.
*/
readonly output?: codepipeline.Artifact;
/**
* The AWS region the given Action resides in.
* Note that a cross-region Pipeline requires replication buckets to function correctly.
* You can provide their names with the `PipelineProps#crossRegionReplicationBuckets` property.
* If you don't, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,
* that you will need to `cdk deploy` before deploying the main, Pipeline-containing Stack.
*
* @default the Action resides in the same region as the Pipeline
*/
readonly region?: string;
/**
* The AWS account this Action is supposed to operate in.
* **Note**: if you specify the `role` property,
* this is ignored - the action will operate in the same region the passed role does.
*
* @default - action resides in the same account as the pipeline
*/
readonly account?: string;
}
/**
* Base class for Actions that execute CloudFormation
*/
declare abstract class CloudFormationAction extends Action {
private readonly props;
constructor(props: CloudFormationActionProps, inputs: codepipeline.Artifact[] | undefined);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}
/**
* Properties for the CloudFormationExecuteChangeSetAction.
*/
export interface CloudFormationExecuteChangeSetActionProps extends CloudFormationActionProps {
/**
* Name of the change set to execute.
*/
readonly changeSetName: string;
}
/**
* CodePipeline action to execute a prepared change set.
*/
export declare class CloudFormationExecuteChangeSetAction extends CloudFormationAction {
private readonly props2;
constructor(props: CloudFormationExecuteChangeSetActionProps);
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}
/**
* Properties common to CloudFormation actions that stage deployments
*/
interface CloudFormationDeployActionProps extends CloudFormationActionProps {
/**
* IAM role to assume when deploying changes.
*
* If not specified, a fresh role is created. The role is created with zero
* permissions unless `adminPermissions` is true, in which case the role will have
* full permissions.
*
* @default A fresh role with full or no permissions (depending on the value of `adminPermissions`).
*/
readonly deploymentRole?: iam.IRole;
/**
* Acknowledge certain changes made as part of deployment.
*
* For stacks that contain certain resources,
* explicit acknowledgement is required that AWS CloudFormation might create or update those resources.
* For example, you must specify `ANONYMOUS_IAM` or `NAMED_IAM` if your stack template contains AWS
* Identity and Access Management (IAM) resources.
* For more information, see the link below.
*
* @default None, unless `adminPermissions` is true
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities
*/
readonly cfnCapabilities?: cdk.CfnCapabilities[];
/**
* Whether to grant full permissions to CloudFormation while deploying this template.
*
* Setting this to `true` affects the defaults for `role` and `capabilities`, if you
* don't specify any alternatives.
*
* The default role that will be created for you will have full (i.e., `*`)
* permissions on all resources, and the deployment will have named IAM
* capabilities (i.e., able to create all IAM resources).
*
* This is a shorthand that you can use if you fully trust the templates that
* are deployed in this pipeline. If you want more fine-grained permissions,
* use `addToRolePolicy` and `capabilities` to control what the CloudFormation
* deployment is allowed to do.
*/
readonly adminPermissions: boolean;
/**
* Input artifact to use for template parameters values and stack policy.
*
* The template configuration file should contain a JSON object that should look like this:
* `{ "Parameters": {...}, "Tags": {...}, "StackPolicy": {... }}`. For more information,
* see [AWS CloudFormation Artifacts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-cfn-artifacts.html).
*
* Note that if you include sensitive information, such as passwords, restrict access to this
* file.
*
* @default No template configuration based on input artifacts
*/
readonly templateConfiguration?: codepipeline.ArtifactPath;
/**
* Additional template parameters.
*
* Template parameters specified here take precedence over template parameters
* found in the artifact specified by the `templateConfiguration` property.
*
* We recommend that you use the template configuration file to specify
* most of your parameter values. Use parameter overrides to specify only
* dynamic parameter values (values that are unknown until you run the
* pipeline).
*
* All parameter names must be present in the stack template.
*
* Note: the entire object cannot be more than 1kB.
*
* @default No overrides
*/
readonly parameterOverrides?: {
[name: string]: any;
};
/**
* The list of additional input Artifacts for this Action.
* This is especially useful when used in conjunction with the `parameterOverrides` property.
* For example, if you have:
*
* parameterOverrides: {
* 'Param1': action1.outputArtifact.bucketName,
* 'Param2': action2.outputArtifact.objectKey,
* }
*
* , if the output Artifacts of `action1` and `action2` were not used to
* set either the `templateConfiguration` or the `templatePath` properties,
* you need to make sure to include them in the `extraInputs` -
* otherwise, you'll get an "unrecognized Artifact" error during your Pipeline's execution.
*/
readonly extraInputs?: codepipeline.Artifact[];
}
/**
* Base class for all CloudFormation actions that execute or stage deployments.
*/
declare abstract class CloudFormationDeployAction extends CloudFormationAction {
private _deploymentRole?;
private readonly props2;
constructor(props: CloudFormationDeployActionProps, inputs: codepipeline.Artifact[] | undefined);
/**
* Add statement to the service role assumed by CloudFormation while executing this action.
*/
addToDeploymentRolePolicy(statement: iam.PolicyStatement): boolean;
get deploymentRole(): iam.IRole;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
private getDeploymentRole;
}
/**
* Properties for the CloudFormationCreateReplaceChangeSetAction.
*/
export interface CloudFormationCreateReplaceChangeSetActionProps extends CloudFormationDeployActionProps {
/**
* Name of the change set to create or update.
*/
readonly changeSetName: string;
/**
* Input artifact with the ChangeSet's CloudFormation template
*/
readonly templatePath: codepipeline.ArtifactPath;
}
/**
* CodePipeline action to prepare a change set.
*
* Creates the change set if it doesn't exist based on the stack name and template that you submit.
* If the change set exists, AWS CloudFormation deletes it, and then creates a new one.
*/
export declare class CloudFormationCreateReplaceChangeSetAction extends CloudFormationDeployAction {
private readonly props3;
constructor(props: CloudFormationCreateReplaceChangeSetActionProps);
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}
/**
* Properties for the CloudFormationCreateUpdateStackAction.
*/
export interface CloudFormationCreateUpdateStackActionProps extends CloudFormationDeployActionProps {
/**
* Input artifact with the CloudFormation template to deploy
*/
readonly templatePath: codepipeline.ArtifactPath;
/**
* Replace the stack if it's in a failed state.
*
* If this is set to true and the stack is in a failed state (one of
* ROLLBACK_COMPLETE, ROLLBACK_FAILED, CREATE_FAILED, DELETE_FAILED, or
* UPDATE_ROLLBACK_FAILED), AWS CloudFormation deletes the stack and then
* creates a new stack.
*
* If this is not set to true and the stack is in a failed state,
* the deployment fails.
*
* @default false
*/
readonly replaceOnFailure?: boolean;
}
/**
* CodePipeline action to deploy a stack.
*
* Creates the stack if the specified stack doesn't exist. If the stack exists,
* AWS CloudFormation updates the stack. Use this action to update existing
* stacks.
*
* AWS CodePipeline won't replace the stack, and will fail deployment if the
* stack is in a failed state. Use `ReplaceOnFailure` for an action that
* will delete and recreate the stack to try and recover from failed states.
*
* Use this action to automatically replace failed stacks without recovering or
* troubleshooting them. You would typically choose this mode for testing.
*/
export declare class CloudFormationCreateUpdateStackAction extends CloudFormationDeployAction {
private readonly props3;
constructor(props: CloudFormationCreateUpdateStackActionProps);
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}
/**
* Properties for the CloudFormationDeleteStackAction.
*/
export interface CloudFormationDeleteStackActionProps extends CloudFormationDeployActionProps {
}
/**
* CodePipeline action to delete a stack.
*
* Deletes a stack. If you specify a stack that doesn't exist, the action completes successfully
* without deleting a stack.
*/
export declare class CloudFormationDeleteStackAction extends CloudFormationDeployAction {
private readonly props3;
constructor(props: CloudFormationDeleteStackActionProps);
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,62 @@
import { Construct } from 'constructs';
import * as iam from '../../../../aws-iam';
import * as cdk from '../../../../core';
/**
* Manages a bunch of singleton-y statements on the policy of an IAM Role.
* Dedicated methods can be used to add specific permissions to the role policy
* using as few statements as possible (adding resources to existing compatible
* statements instead of adding new statements whenever possible).
*
* Statements created outside of this class are not considered when adding new
* permissions.
*/
export declare class SingletonPolicy extends Construct implements iam.IGrantable {
private readonly role;
/**
* Obtain a SingletonPolicy for a given role.
* @param role the Role this policy is bound to.
* @returns the SingletonPolicy for this role.
*/
static forRole(role: iam.IRole): SingletonPolicy;
private static readonly UUID;
readonly grantPrincipal: iam.IPrincipal;
private statements;
private constructor();
grantExecuteChangeSet(props: {
stackName: string;
changeSetName: string;
region?: string;
}): void;
grantCreateReplaceChangeSet(props: {
stackName: string;
changeSetName: string;
region?: string;
}): void;
grantCreateUpdateStack(props: {
stackName: string;
replaceOnFailure?: boolean;
region?: string;
}): void;
grantCreateUpdateStackSet(props: {
stackSetName: string;
region?: string;
}): void;
grantDeleteStack(props: {
stackName: string;
region?: string;
}): void;
grantPassRole(role: iam.IRole | string): void;
private statementFor;
private stackArnFromProps;
private stackSetArnFromProps;
}
export interface StatementTemplate {
actions: string[];
conditions?: StatementCondition;
}
export type StatementCondition = {
[op: string]: {
[attribute: string]: string;
};
};
export declare function parseCapabilities(capabilities: cdk.CfnCapabilities[] | undefined): string | undefined;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SingletonPolicy=void 0,exports.parseCapabilities=parseCapabilities;var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../../core");return cdk=()=>tmp,tmp};class SingletonPolicy extends constructs_1().Construct{role;static forRole(role){return role.node.tryFindChild(SingletonPolicy.UUID)||new SingletonPolicy(role)}static UUID="8389e75f-0810-4838-bf64-d6f85a95cf83";grantPrincipal;statements={};constructor(role){super(role,SingletonPolicy.UUID),this.role=role,this.grantPrincipal=role}grantExecuteChangeSet(props){this.statementFor({actions:["cloudformation:DescribeStacks","cloudformation:DescribeStackEvents","cloudformation:DescribeChangeSet","cloudformation:ExecuteChangeSet"],conditions:{StringEqualsIfExists:{"cloudformation:ChangeSetName":props.changeSetName}}}).addResources(this.stackArnFromProps(props))}grantCreateReplaceChangeSet(props){this.statementFor({actions:["cloudformation:CreateChangeSet","cloudformation:DeleteChangeSet","cloudformation:DescribeChangeSet","cloudformation:DescribeStacks"],conditions:{StringEqualsIfExists:{"cloudformation:ChangeSetName":props.changeSetName}}}).addResources(this.stackArnFromProps(props))}grantCreateUpdateStack(props){const actions=["cloudformation:DescribeStack*","cloudformation:CreateStack","cloudformation:UpdateStack","cloudformation:GetTemplate*","cloudformation:ValidateTemplate","cloudformation:GetStackPolicy","cloudformation:SetStackPolicy"];props.replaceOnFailure&&actions.push("cloudformation:DeleteStack"),this.statementFor({actions}).addResources(this.stackArnFromProps(props))}grantCreateUpdateStackSet(props){const actions=["cloudformation:CreateStackSet","cloudformation:UpdateStackSet","cloudformation:DescribeStackSet","cloudformation:DescribeStackSetOperation","cloudformation:ListStackInstances","cloudformation:CreateStackInstances"];this.statementFor({actions}).addResources(this.stackSetArnFromProps(props))}grantDeleteStack(props){this.statementFor({actions:["cloudformation:DescribeStack*","cloudformation:DeleteStack"]}).addResources(this.stackArnFromProps(props))}grantPassRole(role){this.statementFor({actions:["iam:PassRole"]}).addResources(typeof role=="string"?role:role.roleArn)}statementFor(template){const key=keyFor(template);return key in this.statements||(this.statements[key]=new(iam()).PolicyStatement({actions:template.actions}),template.conditions&&this.statements[key].addConditions(template.conditions),this.role.addToPolicy(this.statements[key])),this.statements[key];function keyFor(props){const actions=`${props.actions.sort().join("")}`,conditions=formatConditions(props.conditions);return`${actions}${conditions}`;function formatConditions(cond){if(cond==null)return"";let result="";for(const op of Object.keys(cond).sort()){result+=`${op}`;const condition=cond[op];for(const attribute of Object.keys(condition).sort()){const value=condition[attribute];result+=`${value}`}}return result}}}stackArnFromProps(props){return cdk().Stack.of(this).formatArn({region:props.region,service:"cloudformation",resource:"stack",resourceName:`${props.stackName}/*`})}stackSetArnFromProps(props){return cdk().Stack.of(this).formatArn({region:props.region,service:"cloudformation",resource:"stackset",resourceName:`${props.stackSetName}:*`})}}exports.SingletonPolicy=SingletonPolicy;function parseCapabilities(capabilities){if(capabilities!==void 0){if(capabilities.length===1){const capability=capabilities.toString();return capability===""?void 0:capability}else if(capabilities.length>1)return capabilities.join(",")}}

View File

@@ -0,0 +1,45 @@
import type { Construct } from 'constructs';
import type { CommonCloudFormationStackSetOptions, StackInstances, StackSetParameters } from './stackset-types';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* Properties for the CloudFormationDeployStackInstancesAction
*/
export interface CloudFormationDeployStackInstancesActionProps extends codepipeline.CommonAwsActionProps, CommonCloudFormationStackSetOptions {
/**
* The name of the StackSet we are adding instances to
*/
readonly stackSetName: string;
/**
* Specify where to create or update Stack Instances
*
* You can specify either AWS Accounts Ids or AWS Organizations Organizational Units.
*/
readonly stackInstances: StackInstances;
/**
* Parameter values that only apply to the current Stack Instances
*
* These parameters are shared between all instances added by this action.
*
* @default - no parameters will be overridden
*/
readonly parameterOverrides?: StackSetParameters;
}
/**
* CodePipeline action to create/update Stack Instances of a StackSet
*
* After the initial creation of a stack set, you can add new stack instances by
* using CloudFormationStackInstances. Template parameter values can be
* overridden at the stack instance level during create or update stack set
* instance operations.
*
* Each stack set has one template and set of template parameters. When you
* update the template or template parameters, you update them for the entire
* set. Then all instance statuses are set to OUTDATED until the changes are
* deployed to that instance.
*/
export declare class CloudFormationDeployStackInstancesAction extends Action {
private readonly props;
constructor(props: CloudFormationDeployStackInstancesActionProps);
protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudFormationDeployStackInstancesAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var singleton_policy_1=()=>{var tmp=require("./private/singleton-policy");return singleton_policy_1=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class CloudFormationDeployStackInstancesAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CloudFormationDeployStackInstancesAction",version:"2.252.0"};props;constructor(props){super({...props,region:props.stackSetRegion,provider:"CloudFormationStackInstances",category:codepipeline().ActionCategory.DEPLOY,artifactBounds:{minInputs:0,maxInputs:3,minOutputs:0,maxOutputs:0},inputs:[...props.parameterOverrides?._artifactsReferenced??[],...props.stackInstances?._artifactsReferenced??[]]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_CloudFormationDeployStackInstancesActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CloudFormationDeployStackInstancesAction),error}this.props=props,(0,common_1().validatePercentage)("failureTolerancePercentage",props.failureTolerancePercentage),(0,common_1().validatePercentage)("maxAccountConcurrencyPercentage",props.maxAccountConcurrencyPercentage)}bound(scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}const singletonPolicy=singleton_policy_1().SingletonPolicy.forRole(options.role);singletonPolicy.grantCreateUpdateStackSet(this.props);const instancesResult=this.props.stackInstances?._bind(scope);return(this.actionProperties.inputs||[]).length>0&&options.bucket.grantRead(singletonPolicy),{configuration:{StackSetName:this.props.stackSetName,ParameterOverrides:this.props.parameterOverrides?._render(),FailureTolerancePercentage:this.props.failureTolerancePercentage,MaxConcurrentPercentage:this.props.maxAccountConcurrencyPercentage,...instancesResult?.stackSetConfiguration}}}}exports.CloudFormationDeployStackInstancesAction=CloudFormationDeployStackInstancesAction;

View File

@@ -0,0 +1,108 @@
import type { Construct } from 'constructs';
import type { CommonCloudFormationStackSetOptions, StackInstances, StackSetParameters, StackSetTemplate } from './stackset-types';
import { StackSetDeploymentModel } from './stackset-types';
import * as codepipeline from '../../../aws-codepipeline';
import type * as cdk from '../../../core';
import { Action } from '../action';
/**
* Properties for the CloudFormationDeployStackSetAction
*/
export interface CloudFormationDeployStackSetActionProps extends codepipeline.CommonAwsActionProps, CommonCloudFormationStackSetOptions {
/**
* The name to associate with the stack set. This name must be unique in the Region where it is created.
*
* The name may only contain alphanumeric and hyphen characters. It must begin with an alphabetic character and be 128 characters or fewer.
*/
readonly stackSetName: string;
/**
* The location of the template that defines the resources in the stack set.
* This must point to a template with a maximum size of 460,800 bytes.
*
* Enter the path to the source artifact name and template file.
*/
readonly template: StackSetTemplate;
/**
* A description of the stack set. You can use this to describe the stack sets purpose or other relevant information.
*
* @default - no description
*/
readonly description?: string;
/**
* Specify where to create or update Stack Instances
*
* You can specify either AWS Accounts Ids or AWS Organizations Organizational Units.
*
* @default - don't create or update any Stack Instances
*/
readonly stackInstances?: StackInstances;
/**
* Determines how IAM roles are created and managed.
*
* The choices are:
*
* - Self Managed: you create IAM roles with the required permissions
* in the administration account and all target accounts.
* - Service Managed: only available if the account and target accounts
* are part of an AWS Organization. The necessary roles will be created
* for you.
*
* If you want to deploy to all accounts that are a member of AWS
* Organizations Organizational Units (OUs), you must select Service Managed
* permissions.
*
* Note: This parameter can only be changed when no stack instances exist in
* the stack set.
*
* @default StackSetDeploymentModel.selfManaged()
*/
readonly deploymentModel?: StackSetDeploymentModel;
/**
* The template parameters for your stack set
*
* These parameters are shared between all instances of the stack set.
*
* @default - no parameters will be used
*/
readonly parameters?: StackSetParameters;
/**
* Indicates that the template can create and update resources, depending on the types of resources in the template.
*
* You must use this property if you have IAM resources in your stack template or you create a stack directly from a template containing macros.
*
* @default - the StackSet will have no IAM capabilities
*/
readonly cfnCapabilities?: cdk.CfnCapabilities[];
}
/**
* CodePipeline action to deploy a stackset.
*
* CodePipeline offers the ability to perform AWS CloudFormation StackSets
* operations as part of your CI/CD process. You use a stack set to create
* stacks in AWS accounts across AWS Regions by using a single AWS
* CloudFormation template. All the resources included in each stack are defined
* by the stack sets AWS CloudFormation template. When you create the stack
* set, you specify the template to use, as well as any parameters and
* capabilities that the template requires.
*
* For more information about concepts for AWS CloudFormation StackSets, see
* [StackSets
* concepts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html)
* in the AWS CloudFormation User Guide.
*
* If you use this action to make an update that includes adding stack
* instances, the new instances are deployed first and the update is completed
* last. The new instances first receive the old version, and then the update is
* applied to all instances.
*
* As a best practice, you should construct your pipeline so that the stack set
* is created and initially deploys to a subset or a single instance. After you
* test your deployment and view the generated stack set, then add the
* CloudFormationStackInstances action so that the remaining instances are
* created and updated.
*/
export declare class CloudFormationDeployStackSetAction extends Action {
private readonly props;
private readonly deploymentModel;
constructor(props: CloudFormationDeployStackSetActionProps);
protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudFormationDeployStackSetAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var singleton_policy_1=()=>{var tmp=require("./private/singleton-policy");return singleton_policy_1=()=>tmp,tmp},stackset_types_1=()=>{var tmp=require("./stackset-types");return stackset_types_1=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class CloudFormationDeployStackSetAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CloudFormationDeployStackSetAction",version:"2.252.0"};props;deploymentModel;constructor(props){super({...props,region:props.stackSetRegion,provider:"CloudFormationStackSet",category:codepipeline().ActionCategory.DEPLOY,artifactBounds:{minInputs:1,maxInputs:3,minOutputs:0,maxOutputs:0},inputs:[...props.template._artifactsReferenced??[],...props.parameters?._artifactsReferenced??[],...props.stackInstances?._artifactsReferenced??[]]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_CloudFormationDeployStackSetActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CloudFormationDeployStackSetAction),error}this.props=props,this.deploymentModel=props.deploymentModel??stackset_types_1().StackSetDeploymentModel.selfManaged(),(0,common_1().validatePercentage)("failureTolerancePercentage",props.failureTolerancePercentage),(0,common_1().validatePercentage)("maxAccountConcurrencyPercentage",props.maxAccountConcurrencyPercentage)}bound(scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}const singletonPolicy=singleton_policy_1().SingletonPolicy.forRole(options.role);singletonPolicy.grantCreateUpdateStackSet(this.props);const instancesResult=this.props.stackInstances?._bind(scope),permissionModelBind=this.deploymentModel?._bind(scope);for(const role of permissionModelBind?.passedRoles??[])singletonPolicy.grantPassRole(role);return(this.actionProperties.inputs||[]).length>0&&options.bucket.grantRead(singletonPolicy),{configuration:{StackSetName:this.props.stackSetName,Description:this.props.description,TemplatePath:this.props.template._render(),Parameters:this.props.parameters?._render(),Capabilities:(0,singleton_policy_1().parseCapabilities)(this.props.cfnCapabilities),FailureTolerancePercentage:this.props.failureTolerancePercentage,MaxConcurrentPercentage:this.props.maxAccountConcurrencyPercentage,...instancesResult?.stackSetConfiguration,...permissionModelBind?.stackSetConfiguration}}}}exports.CloudFormationDeployStackSetAction=CloudFormationDeployStackSetAction;

View File

@@ -0,0 +1,369 @@
import type { Construct } from 'constructs';
import type * as codepipeline from '../../../aws-codepipeline';
import * as iam from '../../../aws-iam';
/**
* Options in common between both StackSet actions
*/
export interface CommonCloudFormationStackSetOptions {
/**
* The percentage of accounts per Region for which this stack operation can fail before AWS CloudFormation stops the operation in that Region. If
* the operation is stopped in a Region, AWS CloudFormation doesn't attempt the operation in subsequent Regions. When calculating the number
* of accounts based on the specified percentage, AWS CloudFormation rounds down to the next whole number.
*
* @default 0%
*/
readonly failureTolerancePercentage?: number;
/**
* The maximum percentage of accounts in which to perform this operation at one time. When calculating the number of accounts based on the specified
* percentage, AWS CloudFormation rounds down to the next whole number. If rounding down would result in zero, AWS CloudFormation sets the number as
* one instead. Although you use this setting to specify the maximum, for large deployments the actual number of accounts acted upon concurrently
* may be lower due to service throttling.
*
* @default 1%
*/
readonly maxAccountConcurrencyPercentage?: number;
/**
* The AWS Region the StackSet is in.
*
* Note that a cross-region Pipeline requires replication buckets to function correctly.
* You can provide their names with the `PipelineProps.crossRegionReplicationBuckets` property.
* If you don't, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,
* that you will need to `cdk deploy` before deploying the main, Pipeline-containing Stack.
*
* @default - same region as the Pipeline
*/
readonly stackSetRegion?: string;
}
/**
* The source of a StackSet template
*/
export declare abstract class StackSetTemplate {
/**
* Use a file in an artifact as Stack Template.
*/
static fromArtifactPath(artifactPath: codepipeline.ArtifactPath): StackSetTemplate;
/**
* Which artifacts are referenced by this template
*
* Does not need to be called by app builders.
*
* @internal
*/
abstract readonly _artifactsReferenced?: codepipeline.Artifact[] | undefined;
/**
* Render the template to the pipeline
*
* Does not need to be called by app builders.
*
* @internal
*/
abstract _render(): any;
}
/**
* Where Stack Instances will be created from the StackSet
*/
export declare abstract class StackInstances {
/**
* Create stack instances in a set of accounts and regions passed as literal lists
*
* Stack Instances will be created in every combination of region and account.
*
* > NOTE: `StackInstances.inAccounts()` and `StackInstances.inOrganizationalUnits()`
* > have exactly the same behavior, and you can use them interchangeably if you want.
* > The only difference between them is that your code clearly indicates what entity
* > it's working with.
*/
static inAccounts(accounts: string[], regions: string[]): StackInstances;
/**
* Create stack instances in all accounts in a set of Organizational Units (OUs) and regions passed as literal lists
*
* If you want to deploy to Organization Units, you must choose have created the StackSet
* with `deploymentModel: DeploymentModel.organizations()`.
*
* Stack Instances will be created in every combination of region and account.
*
* > NOTE: `StackInstances.inAccounts()` and `StackInstances.inOrganizationalUnits()`
* > have exactly the same behavior, and you can use them interchangeably if you want.
* > The only difference between them is that your code clearly indicates what entity
* > it's working with.
*/
static inOrganizationalUnits(ous: string[], regions: string[]): StackInstances;
/**
* Create stack instances in a set of accounts or organizational units taken from the pipeline artifacts, and a set of regions
*
* The file must be a JSON file containing a list of strings. For example:
*
* ```json
* [
* "111111111111",
* "222222222222",
* "333333333333"
* ]
* ```
*
* Stack Instances will be created in every combination of region and account, or region and
* Organizational Units (OUs).
*
* If this is set of Organizational Units, you must have selected `StackSetDeploymentModel.organizations()`
* as deployment model.
*/
static fromArtifactPath(artifactPath: codepipeline.ArtifactPath, regions: string[]): StackInstances;
/**
* Create stack instances in a literal set of accounts or organizational units, and a set of regions
*
* Stack Instances will be created in every combination of region and account, or region and
* Organizational Units (OUs).
*
* If this is set of Organizational Units, you must have selected `StackSetDeploymentModel.organizations()`
* as deployment model.
*/
private static fromList;
/**
* The artifacts referenced by the properties of this deployment target
*
* Does not need to be called by app builders.
*
* @internal
*/
readonly _artifactsReferenced?: codepipeline.Artifact[];
/**
* Called to attach the stack set instances to a stackset action
*
* Does not need to be called by app builders.
*
* @internal
*/
abstract _bind(scope: Construct): StackInstancesBindResult;
}
/**
* Returned by the StackInstances.bind() function
*
* Does not need to be used by app builders.
*
* @internal
*/
export interface StackInstancesBindResult {
/**
* Properties to mix into the Action configuration
*/
readonly stackSetConfiguration: any;
}
/**
* Base parameters for the StackSet
*/
export declare abstract class StackSetParameters {
/**
* A list of template parameters for your stack set.
*
* You must specify all template parameters. Parameters you don't specify will revert
* to their `Default` values as specified in the template.
*
* Specify the names of parameters you want to retain their existing values,
* without specifying what those values are, in an array in the second
* argument to this function. Use of this feature is discouraged. CDK is for
* specifying desired-state infrastructure, and use of this feature makes the
* parameter values unmanaged.
*
* @example
*
* const parameters = codepipeline_actions.StackSetParameters.fromLiteral({
* BucketName: 'my-bucket',
* Asset1: 'true',
* });
*/
static fromLiteral(parameters: Record<string, string>, usePreviousValues?: string[]): StackSetParameters;
/**
* Read the parameters from a JSON file from one of the pipeline's artifacts
*
* The file needs to contain a list of `{ ParameterKey, ParameterValue, UsePreviousValue }` objects, like
* this:
*
* ```
* [
* {
* "ParameterKey": "BucketName",
* "ParameterValue": "my-bucket"
* },
* {
* "ParameterKey": "Asset1",
* "ParameterValue": "true"
* },
* {
* "ParameterKey": "Asset2",
* "UsePreviousValue": true
* }
* ]
* ```
*
* You must specify all template parameters. Parameters you don't specify will revert
* to their `Default` values as specified in the template.
*
* For of parameters you want to retain their existing values
* without specifying what those values are, set `UsePreviousValue: true`.
* Use of this feature is discouraged. CDK is for
* specifying desired-state infrastructure, and use of this feature makes the
* parameter values unmanaged.
*/
static fromArtifactPath(artifactPath: codepipeline.ArtifactPath): StackSetParameters;
/**
* Artifacts referenced by this parameter set
*
* @internal
*/
abstract readonly _artifactsReferenced: codepipeline.Artifact[];
/**
* Converts Parameters to a string.
*
* @internal
*/
abstract _render(): string;
}
/**
* Determines how IAM roles are created and managed.
*/
export declare abstract class StackSetDeploymentModel {
/**
* Deploy to AWS Organizations accounts.
*
* AWS CloudFormation StackSets automatically creates the IAM roles required
* to deploy to accounts managed by AWS Organizations. This requires an
* account to be a member of an Organization.
*
* Using this deployment model, you can specify either AWS Account Ids or
* Organization Unit Ids in the `stackInstances` parameter.
*/
static organizations(props?: OrganizationsDeploymentProps): StackSetDeploymentModel;
/**
* Deploy to AWS Accounts not managed by AWS Organizations
*
* You are responsible for creating Execution Roles in every account you will
* be deploying to in advance to create the actual stack instances. Unless you
* specify overrides, StackSets expects the execution roles you create to have
* the default name `AWSCloudFormationStackSetExecutionRole`. See the [Grant
* self-managed
* permissions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html)
* section of the CloudFormation documentation.
*
* The CDK will automatically create the central Administration Role in the
* Pipeline account which will be used to assume the Execution Role in each of
* the target accounts.
*
* If you wish to use a pre-created Administration Role, use `Role.fromRoleName()`
* or `Role.fromRoleArn()` to import it, and pass it to this function:
*
* ```ts
* const existingAdminRole = iam.Role.fromRoleName(this, 'AdminRole', 'AWSCloudFormationStackSetAdministrationRole');
*
* const deploymentModel = codepipeline_actions.StackSetDeploymentModel.selfManaged({
* // Use an existing Role. Leave this out to create a new Role.
* administrationRole: existingAdminRole,
* });
* ```
*
* Using this deployment model, you can only specify AWS Account Ids in the
* `stackInstances` parameter.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html
*/
static selfManaged(props?: SelfManagedDeploymentProps): StackSetDeploymentModel;
/**
* Bind to the Stack Set action and return the Action configuration
*
* Does not need to be called by app builders.
*
* @internal
*/
abstract _bind(scope: Construct): StackSetDeploymentModelBindResult;
}
/**
* Returned by the StackSetDeploymentModel.bind() function
*
* Does not need to be used by app builders.
*
* @internal
*/
export interface StackSetDeploymentModelBindResult {
/**
* Properties to mix into the Action configuration
*/
readonly stackSetConfiguration: any;
/**
* Roles that need to be passed by the pipeline action
*
* @default - No roles
*/
readonly passedRoles?: iam.IRole[];
}
/**
* Properties for configuring service-managed (Organizations) permissions
*/
export interface OrganizationsDeploymentProps {
/**
* Automatically deploy to new accounts added to Organizational Units
*
* Whether AWS CloudFormation StackSets automatically deploys to AWS
* Organizations accounts that are added to a target organization or
* organizational unit (OU).
*
* @default Disabled
*/
readonly autoDeployment?: StackSetOrganizationsAutoDeployment;
}
/**
* Describes whether AWS CloudFormation StackSets automatically deploys to AWS Organizations accounts that are added to a target organization or
* organizational unit (OU).
*/
export declare enum StackSetOrganizationsAutoDeployment {
/**
* StackSets automatically deploys additional stack instances to AWS Organizations accounts that are added to a target organization or
* organizational unit (OU) in the specified Regions. If an account is removed from a target organization or OU, AWS CloudFormation StackSets
* deletes stack instances from the account in the specified Regions.
*/
ENABLED = "Enabled",
/**
* StackSets does not automatically deploy additional stack instances to AWS Organizations accounts that are added to a target organization or
* organizational unit (OU) in the specified Regions.
*/
DISABLED = "Disabled",
/**
* Stack resources are retained when an account is removed from a target organization or OU.
*/
ENABLED_WITH_STACK_RETENTION = "EnabledWithStackRetention"
}
/**
* Properties for configuring self-managed permissions
*/
export interface SelfManagedDeploymentProps {
/**
* The IAM role in the administrator account used to assume execution roles in the target accounts
*
* You must create this role before using the StackSet action.
*
* The role needs to be assumable by CloudFormation, and it needs to be able
* to `sts:AssumeRole` each of the execution roles (whose names are specified
* in the `executionRoleName` parameter) in each of the target accounts.
*
* If you do not specify the role, we assume you have created a role named
* `AWSCloudFormationStackSetAdministrationRole`.
*
* @default - Assume an existing role named `AWSCloudFormationStackSetAdministrationRole` in the same account as the pipeline.
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html
*/
readonly administrationRole?: iam.IRole;
/**
* The name of the IAM role in the target accounts used to perform stack set operations.
*
* You must create these roles in each of the target accounts before using the
* StackSet action.
*
* The roles need to be assumable by by the `administrationRole`, and need to
* have the permissions necessary to successfully create and modify the
* resources that the subsequent CloudFormation deployments need.
* Administrator permissions would be commonly granted to these, but if you can
* scope the permissions down frome there you would be safer.
*
* @default AWSCloudFormationStackSetExecutionRole
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html
*/
readonly executionRoleName?: string;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,118 @@
import type { Construct } from 'constructs';
import * as codebuild from '../../../aws-codebuild';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* The type of the CodeBuild action that determines its CodePipeline Category -
* Build, or Test.
* The default is Build.
*/
export declare enum CodeBuildActionType {
/**
* The action will have the Build Category.
* This is the default.
*/
BUILD = 0,
/**
* The action will have the Test Category.
*/
TEST = 1
}
/**
* Construction properties of the `CodeBuildAction CodeBuild build CodePipeline action`.
*/
export interface CodeBuildActionProps extends codepipeline.CommonAwsActionProps {
/**
* The source to use as input for this action.
*/
readonly input: codepipeline.Artifact;
/**
* The list of additional input Artifacts for this action.
*
* The directories the additional inputs will be available at are available
* during the project's build in the CODEBUILD_SRC_DIR_<artifact-name> environment variables.
* The project's build always starts in the directory with the primary input artifact checked out,
* the one pointed to by the `input` property.
* For more information,
* see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html .
*/
readonly extraInputs?: codepipeline.Artifact[];
/**
* The list of output Artifacts for this action.
* **Note**: if you specify more than one output Artifact here,
* you cannot use the primary 'artifacts' section of the buildspec;
* you have to use the 'secondary-artifacts' section instead.
* See https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html
* for details.
*
* @default the action will not have any outputs
*/
readonly outputs?: codepipeline.Artifact[];
/**
* The action's Project.
*/
readonly project: codebuild.IProject;
/**
* The type of the action that determines its CodePipeline Category -
* Build, or Test.
*
* @default CodeBuildActionType.BUILD
*/
readonly type?: CodeBuildActionType;
/**
* The environment variables to pass to the CodeBuild project when this action executes.
* If a variable with the same name was set both on the project level, and here,
* this value will take precedence.
*
* @default - No additional environment variables are specified.
*/
readonly environmentVariables?: {
[name: string]: codebuild.BuildEnvironmentVariable;
};
/**
* Whether to check for the presence of any secrets in the environment variables of the default type, BuildEnvironmentVariableType.PLAINTEXT.
* Since using a secret for the value of that kind of variable would result in it being displayed in plain text in the AWS Console,
* the construct will throw an exception if it detects a secret was passed there.
* Pass this property as false if you want to skip this validation,
* and keep using a secret in a plain text environment variable.
*
* @default true
*/
readonly checkSecretsInPlainTextEnvVariables?: boolean;
/**
* Trigger a batch build.
*
* Enabling this will enable batch builds on the CodeBuild project.
*
* @default false
*/
readonly executeBatchBuild?: boolean;
/**
* Combine the build artifacts for a batch builds.
*
* Enabling this will combine the build artifacts into the same location for batch builds.
* If `executeBatchBuild` is not set to `true`, this property is ignored.
*
* @default false
*/
readonly combineBatchBuildArtifacts?: boolean;
}
/**
* CodePipeline build action that uses AWS CodeBuild.
*/
export declare class CodeBuildAction extends Action {
private readonly props;
constructor(props: CodeBuildActionProps);
/**
* Reference a CodePipeline variable defined by the CodeBuild project this action points to.
* Variables in CodeBuild actions are defined using the 'exported-variables' subsection of the 'env'
* section of the buildspec.
*
* @param variableName the name of the variable to reference.
* A variable by this name must be present in the 'exported-variables' section of the buildspec
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax
*/
variable(variableName: string): string;
protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeBuildAction=exports.CodeBuildActionType=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var __1=()=>{var tmp=require("..");return __1=()=>tmp,tmp},codebuild=()=>{var tmp=require("../../../aws-codebuild");return codebuild=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},source_action_1=()=>{var tmp=require("../codecommit/source-action");return source_action_1=()=>tmp,tmp},CodeBuildActionType;(function(CodeBuildActionType2){CodeBuildActionType2[CodeBuildActionType2.BUILD=0]="BUILD",CodeBuildActionType2[CodeBuildActionType2.TEST=1]="TEST"})(CodeBuildActionType||(exports.CodeBuildActionType=CodeBuildActionType={}));class CodeBuildAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CodeBuildAction",version:"2.252.0"};props;constructor(props){super({...props,category:props.type===CodeBuildActionType.TEST?codepipeline().ActionCategory.TEST:codepipeline().ActionCategory.BUILD,provider:"CodeBuild",artifactBounds:{minInputs:1,maxInputs:5,minOutputs:0,maxOutputs:5},inputs:[props.input,...props.extraInputs||[]],resource:props.project});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_CodeBuildActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodeBuildAction),error}this.props=props}variable(variableName){return this.variableExpression(variableName)}bound(scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}if((this.actionProperties.outputs||[]).length>0){const pipelineStack=cdk().Stack.of(scope),projectStack=cdk().Stack.of(this.props.project);if(pipelineStack.account!==projectStack.account)throw new(cdk()).ValidationError((0,literal_string_1().lit)`CrossAccountActionCannotHaveOutputs`,"A cross-account CodeBuild action cannot have outputs. This is a known CodeBuild limitation. See https://github.com/aws/aws-cdk/issues/4169 for details",scope)}options.role.addToPolicy(new(iam()).PolicyStatement({resources:[this.props.project.projectArn],actions:[`codebuild:${this.props.executeBatchBuild?"BatchGetBuildBatches":"BatchGetBuilds"}`,`codebuild:${this.props.executeBatchBuild?"StartBuildBatch":"StartBuild"}`,`codebuild:${this.props.executeBatchBuild?"StopBuildBatch":"StopBuild"}`]})),this.props.project.role&&((this.actionProperties.outputs||[]).length>0?options.bucket.grantReadWrite(this.props.project):options.bucket.grantRead(this.props.project)),this.props.project instanceof codebuild().Project&&this.props.project.bindToCodePipeline(scope,{artifactBucket:options.bucket});for(const inputArtifact of this.actionProperties.inputs||[]){const connectionArn=inputArtifact.getMetadata(__1().CodeStarConnectionsSourceAction._CONNECTION_ARN_PROPERTY);connectionArn&&this.props.project.addToRolePolicy(new(iam()).PolicyStatement({actions:["codestar-connections:UseConnection"],resources:[connectionArn]}));const codecommitRepositoryArn=inputArtifact.getMetadata(source_action_1().CodeCommitSourceAction._FULL_CLONE_ARN_PROPERTY);codecommitRepositoryArn&&this.props.project.addToRolePolicy(new(iam()).PolicyStatement({actions:["codecommit:GitPull"],resources:[codecommitRepositoryArn]}))}const configuration={ProjectName:this.props.project.projectName,EnvironmentVariables:this.props.environmentVariables&&cdk().Stack.of(scope).toJsonString(codebuild().Project.serializeEnvVariables(this.props.environmentVariables,this.props.checkSecretsInPlainTextEnvVariables??!0,this.props.project))};return(this.actionProperties.inputs||[]).length>1&&(configuration.PrimarySource=cdk().Lazy.string({produce:()=>this.props.input.artifactName})),this.props.executeBatchBuild&&(configuration.BatchEnabled="true",this.props.project.enableBatchBuilds(),this.props.combineBatchBuildArtifacts&&(configuration.CombineArtifacts="true")),{configuration}}}exports.CodeBuildAction=CodeBuildAction;

View File

@@ -0,0 +1,152 @@
import type { Construct } from 'constructs';
import type * as codecommit from '../../../aws-codecommit';
import * as codepipeline from '../../../aws-codepipeline';
import type { EventPattern, IRuleTarget } from '../../../aws-events';
import * as iam from '../../../aws-iam';
import { Action } from '../action';
/**
* How should the CodeCommit Action detect changes.
* This is the type of the `CodeCommitSourceAction.trigger` property.
*/
export declare enum CodeCommitTrigger {
/**
* The Action will never detect changes -
* the Pipeline it's part of will only begin a run when explicitly started.
*/
NONE = "None",
/**
* CodePipeline will poll the repository to detect changes.
*/
POLL = "Poll",
/**
* CodePipeline will use CloudWatch Events to be notified of changes.
* This is the default method of detecting changes.
*/
EVENTS = "Events"
}
/**
* The CodePipeline variables emitted by the CodeCommit source Action.
*/
export interface CodeCommitSourceVariables {
/** The name of the repository this action points to. */
readonly repositoryName: string;
/** The name of the branch this action tracks. */
readonly branchName: string;
/** The date the currently last commit on the tracked branch was authored, in ISO-8601 format. */
readonly authorDate: string;
/** The date the currently last commit on the tracked branch was committed, in ISO-8601 format. */
readonly committerDate: string;
/** The SHA1 hash of the currently last commit on the tracked branch. */
readonly commitId: string;
/** The message of the currently last commit on the tracked branch. */
readonly commitMessage: string;
}
/**
* Represents a custom event rule in AWS CodePipeline Actions.
*
* This interface defines the structure for specifying a custom event rule
* in the AWS CodePipeline Actions module. The event rule is defined by an
* event pattern and a target.
*
* @see https://docs.aws.amazon.com/codecommit/latest/userguide/monitoring-events.html
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets-readme.html
*/
export interface ICustomEventRule {
/**
* event pattern when this rule should be triggered
*/
readonly eventPattern: EventPattern;
/**
* Target e.g. Lambda when event pattern is fulfilled
*/
readonly target: IRuleTarget;
/**
* Rulename
*/
readonly ruleName?: string;
/**
* Description
*/
readonly description?: string;
}
/**
* Construction properties of the `CodeCommitSourceAction CodeCommit source CodePipeline Action`.
*/
export interface CodeCommitSourceActionProps extends codepipeline.CommonAwsActionProps {
/**
*
*/
readonly output: codepipeline.Artifact;
/**
* @default 'master'
*/
readonly branch?: string;
/**
* How should CodePipeline detect source changes for this Action.
*
* @default CodeCommitTrigger.EVENTS
*/
readonly trigger?: CodeCommitTrigger;
/**
* The CodeCommit repository.
*/
readonly repository: codecommit.IRepository;
/**
* Role to be used by on commit event rule.
* Used only when trigger value is CodeCommitTrigger.EVENTS.
*
* @default a new role will be created.
*/
readonly eventRole?: iam.IRole;
/**
* Whether the output should be the contents of the repository
* (which is the default),
* or a link that allows CodeBuild to clone the repository before building.
*
* **Note**: if this option is true,
* then only CodeBuild actions can use the resulting `output`.
*
* @default false
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeCommit.html
*/
readonly codeBuildCloneOutput?: boolean;
/**
* You can pass a `customEventRule` to set up a custom event rule for the CodeCommit source action.
* You must provide the `eventPattern` and `target` properties in the `customEventRule` object.
* Check which `eventPattern` to use: https://docs.aws.amazon.com/codecommit/latest/userguide/monitoring-events.html
* @default Event rule which is triggered by CodeCommit repository on commit
*/
readonly customEventRule?: ICustomEventRule;
}
/**
* CodePipeline Source that is provided by an AWS CodeCommit repository.
*
* If the CodeCommit repository is in a different account, you must use
* `CodeCommitTrigger.EVENTS` to trigger the pipeline.
*
* (That is because the Pipeline structure normally only has a `RepositoryName`
* field, and that is not enough for the pipeline to locate the repository's
* source account. However, if the pipeline is triggered via an EventBridge
* event, the event itself has the full repository ARN in there, allowing the
* pipeline to locate the repository).
*/
export declare class CodeCommitSourceAction extends Action {
/**
* The name of the property that holds the ARN of the CodeCommit Repository
* inside of the CodePipeline Artifact's metadata.
*
* @internal
*/
static readonly _FULL_CLONE_ARN_PROPERTY = "CodeCommitCloneRepositoryArn";
private static readonly NEW_DEFAULT_BRANCH_NAME;
private static readonly OLD_DEFAULT_BRANCH_NAME;
private readonly branch;
private readonly props;
constructor(props: CodeCommitSourceActionProps);
/** The variables emitted by this action. */
get variables(): CodeCommitSourceVariables;
protected bound(_scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
private getBranchOrDefault;
private generateEventId;
private eventIdFromPrefix;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,102 @@
import type { Construct } from 'constructs';
import type * as codedeploy from '../../../aws-codedeploy';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* Configuration for replacing a placeholder string in the ECS task
* definition template file with an image URI.
*/
export interface CodeDeployEcsContainerImageInput {
/**
* The artifact that contains an `imageDetails.json` file with the image URI.
*
* The artifact's `imageDetails.json` file must be a JSON file containing an
* `ImageURI` property. For example:
* `{ "ImageURI": "ACCOUNTID.dkr.ecr.us-west-2.amazonaws.com/dk-image-repo@sha256:example3" }`
*/
readonly input: codepipeline.Artifact;
/**
* The placeholder string in the ECS task definition template file that will
* be replaced with the image URI.
*
* The placeholder string must be surrounded by angle brackets in the template file.
* For example, if the task definition template file contains a placeholder like
* `"image": "<PLACEHOLDER>"`, then the `taskDefinitionPlaceholder` value should
* be `PLACEHOLDER`.
*
* @default IMAGE
*/
readonly taskDefinitionPlaceholder?: string;
}
/**
* Construction properties of the `CodeDeployEcsDeployAction CodeDeploy ECS deploy CodePipeline Action`.
*/
export interface CodeDeployEcsDeployActionProps extends codepipeline.CommonAwsActionProps {
/**
* The CodeDeploy ECS Deployment Group to deploy to.
*/
readonly deploymentGroup: codedeploy.IEcsDeploymentGroup;
/**
* The artifact containing the ECS task definition template file.
* During deployment, the task definition template file contents
* will be registered with ECS.
*
* If you use this property, it's assumed the file is called 'taskdef.json'.
* If your task definition template uses a different filename, leave this property empty,
* and use the `taskDefinitionTemplateFile` property instead.
*
* @default - one of this property, or `taskDefinitionTemplateFile`, is required
*/
readonly taskDefinitionTemplateInput?: codepipeline.Artifact;
/**
* The name of the ECS task definition template file.
* During deployment, the task definition template file contents
* will be registered with ECS.
*
* Use this property if you want to use a different name for this file than the default 'taskdef.json'.
* If you use this property, you don't need to specify the `taskDefinitionTemplateInput` property.
*
* @default - one of this property, or `taskDefinitionTemplateInput`, is required
*/
readonly taskDefinitionTemplateFile?: codepipeline.ArtifactPath;
/**
* The artifact containing the CodeDeploy AppSpec file.
* During deployment, a new task definition will be registered
* with ECS, and the new task definition ID will be inserted into
* the CodeDeploy AppSpec file. The AppSpec file contents will be
* provided to CodeDeploy for the deployment.
*
* If you use this property, it's assumed the file is called 'appspec.yaml'.
* If your AppSpec file uses a different filename, leave this property empty,
* and use the `appSpecTemplateFile` property instead.
*
* @default - one of this property, or `appSpecTemplateFile`, is required
*/
readonly appSpecTemplateInput?: codepipeline.Artifact;
/**
* The name of the CodeDeploy AppSpec file.
* During deployment, a new task definition will be registered
* with ECS, and the new task definition ID will be inserted into
* the CodeDeploy AppSpec file. The AppSpec file contents will be
* provided to CodeDeploy for the deployment.
*
* Use this property if you want to use a different name for this file than the default 'appspec.yaml'.
* If you use this property, you don't need to specify the `appSpecTemplateInput` property.
*
* @default - one of this property, or `appSpecTemplateInput`, is required
*/
readonly appSpecTemplateFile?: codepipeline.ArtifactPath;
/**
* Configuration for dynamically updated images in the task definition.
*
* Provide pairs of an image details input artifact and a placeholder string
* that will be used to dynamically update the ECS task definition template
* file prior to deployment. A maximum of 4 images can be given.
*/
readonly containerImageInputs?: CodeDeployEcsContainerImageInput[];
}
export declare class CodeDeployEcsDeployAction extends Action {
private readonly actionProps;
constructor(props: CodeDeployEcsDeployActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,22 @@
import type { Construct } from 'constructs';
import type * as codedeploy from '../../../aws-codedeploy';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* Construction properties of the `CodeDeployServerDeployAction CodeDeploy server deploy CodePipeline Action`.
*/
export interface CodeDeployServerDeployActionProps extends codepipeline.CommonAwsActionProps {
/**
* The source to use as input for deployment.
*/
readonly input: codepipeline.Artifact;
/**
* The CodeDeploy server Deployment Group to deploy to.
*/
readonly deploymentGroup: codedeploy.IServerDeploymentGroup;
}
export declare class CodeDeployServerDeployAction extends Action {
private readonly deploymentGroup;
constructor(props: CodeDeployServerDeployActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeDeployServerDeployAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class CodeDeployServerDeployAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CodeDeployServerDeployAction",version:"2.252.0"};deploymentGroup;constructor(props){super({...props,resource:props.deploymentGroup,category:codepipeline().ActionCategory.DEPLOY,provider:"CodeDeploy",artifactBounds:(0,common_1().deployArtifactBounds)(),inputs:[props.input]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_CodeDeployServerDeployActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodeDeployServerDeployAction),error}this.deploymentGroup=props.deploymentGroup}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}options.role.addToPolicy(new(iam()).PolicyStatement({resources:[this.deploymentGroup.application.applicationArn],actions:["codedeploy:GetApplicationRevision","codedeploy:RegisterApplicationRevision"]})),options.role.addToPolicy(new(iam()).PolicyStatement({resources:[this.deploymentGroup.deploymentGroupArn],actions:["codedeploy:CreateDeployment","codedeploy:GetDeployment"]})),options.role.addToPolicy(new(iam()).PolicyStatement({resources:[this.deploymentGroup.deploymentConfig.deploymentConfigArn],actions:["codedeploy:GetDeploymentConfig"]}));for(const asg of this.deploymentGroup.autoScalingGroups||[])options.bucket.grantRead(asg);return options.bucket.grantRead(options.role),{configuration:{ApplicationName:this.deploymentGroup.application.applicationName,DeploymentGroupName:this.deploymentGroup.deploymentGroupName}}}}exports.CodeDeployServerDeployAction=CodeDeployServerDeployAction;

View File

@@ -0,0 +1,84 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type { IPipelineRef } from '../../../interfaces/generated/aws-codepipeline-interfaces.generated';
import { Action } from '../action';
/**
* Construction properties of the `PipelineInvokeAction`.
*/
export interface PipelineInvokeActionProps extends codepipeline.CommonAwsActionProps {
/**
* The pipeline that will, upon running, start the current target pipeline.
* You must have already created the invoking pipeline.
*/
readonly targetPipeline: IPipelineRef;
/**
* The source revisions that you want the target pipeline to use when it is started by the invoking pipeline.
* @default - no specific revisions
*/
readonly sourceRevisions?: SourceRevision[];
/**
* The names and values of variables that you want the action to support.
* @default - no specific variable
*/
readonly variables?: Variable[];
}
/**
* A list that allows you to specify, or override, the source revision for a pipeline execution that's being started.
*/
export interface SourceRevision {
/**
* The name of the action where the override will be applied.
*/
readonly actionName: string;
/**
* The type of source revision, based on the source provider.
*/
readonly revisionType: RevisionType;
/**
* The source revision, or version of your source artifact,
* with the changes that you want to run in the pipeline execution.
*/
readonly revisionValue: string;
}
/**
* A pipeline-level variable used for a pipeline execution.
*/
export interface Variable {
/**
* The name of a pipeline-level variable.
*/
readonly name: string;
/**
* The value of a pipeline-level variable.
*/
readonly value: string;
}
/**
* The types of revision for a pipeline execution.
*/
export declare enum RevisionType {
/**
* The revision type is a commit id.
*/
COMMIT_ID = "COMMIT_ID",
/**
* The revision type is an image digest.
*/
IMAGE_DIGEST = "IMAGE_DIGEST",
/**
* The revision type is an s3 object version id.
*/
S3_OBJECT_VERSION_ID = "S3_OBJECT_VERSION_ID",
/**
* The revision type is an s3 object version key.
*/
S3_OBJECT_KEY = "S3_OBJECT_KEY"
}
/**
* CodePipeline action to invoke a pipeline.
*/
export declare class PipelineInvokeAction extends Action {
private readonly props;
constructor(props: PipelineInvokeActionProps);
protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipelineInvokeAction=exports.RevisionType=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},RevisionType;(function(RevisionType2){RevisionType2.COMMIT_ID="COMMIT_ID",RevisionType2.IMAGE_DIGEST="IMAGE_DIGEST",RevisionType2.S3_OBJECT_VERSION_ID="S3_OBJECT_VERSION_ID",RevisionType2.S3_OBJECT_KEY="S3_OBJECT_KEY"})(RevisionType||(exports.RevisionType=RevisionType={}));class PipelineInvokeAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.PipelineInvokeAction",version:"2.252.0"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.INVOKE,provider:"CodePipeline",artifactBounds:{minInputs:0,maxInputs:0,minOutputs:0,maxOutputs:0},inputs:[],outputs:[]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_PipelineInvokeActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,PipelineInvokeAction),error}this.props=props}bound(scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return options.role.addToPolicy(new(iam()).PolicyStatement({actions:["codepipeline:StartPipelineExecution"],resources:[codepipeline().CfnPipeline.arnForPipeline(this.props.targetPipeline)]})),{configuration:{PipelineName:this.props.targetPipeline.pipelineRef.pipelineName,SourceRevisions:core_1().Stack.of(scope).toJsonString(this.props.sourceRevisions),Variables:core_1().Stack.of(scope).toJsonString(this.props.variables)}}}}exports.PipelineInvokeAction=PipelineInvokeAction;

View File

@@ -0,0 +1,95 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* The CodePipeline variables emitted by CodeStar source Action.
*/
export interface CodeStarSourceVariables {
/** The name of the repository this action points to. */
readonly fullRepositoryName: string;
/** The name of the branch this action tracks. */
readonly branchName: string;
/** The date the currently last commit on the tracked branch was authored, in ISO-8601 format. */
readonly authorDate: string;
/** The SHA1 hash of the currently last commit on the tracked branch. */
readonly commitId: string;
/** The message of the currently last commit on the tracked branch. */
readonly commitMessage: string;
/** The connection ARN this source uses. */
readonly connectionArn: string;
}
/**
* Construction properties for `CodeStarConnectionsSourceAction`.
*/
export interface CodeStarConnectionsSourceActionProps extends codepipeline.CommonAwsActionProps {
/**
* The output artifact that this action produces.
* Can be used as input for further pipeline actions.
*/
readonly output: codepipeline.Artifact;
/**
* The ARN of the CodeStar Connection created in the AWS console
* that has permissions to access this GitHub or BitBucket repository.
*
* @example 'arn:aws:codestar-connections:us-east-1:123456789012:connection/12345678-abcd-12ab-34cdef5678gh'
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/connections-create.html
*/
readonly connectionArn: string;
/**
* The owning user or organization of the repository.
*
* @example 'aws'
*/
readonly owner: string;
/**
* The name of the repository.
*
* @example 'aws-cdk'
*/
readonly repo: string;
/**
* The branch to build.
*
* @default 'master'
*/
readonly branch?: string;
/**
* Whether the output should be the contents of the repository
* (which is the default),
* or a link that allows CodeBuild to clone the repository before building.
*
* **Note**: if this option is true,
* then only CodeBuild actions can use the resulting `output`.
*
* @default false
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config
*/
readonly codeBuildCloneOutput?: boolean;
/**
* Controls automatically starting your pipeline when a new commit
* is made on the configured repository and branch. If unspecified,
* the default value is true, and the field does not display by default.
*
* @default true
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html
*/
readonly triggerOnPush?: boolean;
}
/**
* A CodePipeline source action for the CodeStar Connections source,
* which allows connecting to GitHub and BitBucket.
*/
export declare class CodeStarConnectionsSourceAction extends Action {
/**
* The name of the property that holds the ARN of the CodeStar Connection
* inside of the CodePipeline Artifact's metadata.
*
* @internal
*/
static readonly _CONNECTION_ARN_PROPERTY = "CodeStarConnectionArnProperty";
private readonly props;
constructor(props: CodeStarConnectionsSourceActionProps);
/** The variables emitted by this action. */
get variables(): CodeStarSourceVariables;
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeStarConnectionsSourceAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class CodeStarConnectionsSourceAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CodeStarConnectionsSourceAction",version:"2.252.0"};static _CONNECTION_ARN_PROPERTY="CodeStarConnectionArnProperty";props;constructor(props){super({...props,category:codepipeline().ActionCategory.SOURCE,owner:"AWS",provider:"CodeStarSourceConnection",artifactBounds:(0,common_1().sourceArtifactBounds)(),outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_CodeStarConnectionsSourceActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodeStarConnectionsSourceAction),error}this.props=props}get variables(){return{fullRepositoryName:this.variableExpression("FullRepositoryName"),branchName:this.variableExpression("BranchName"),authorDate:this.variableExpression("AuthorDate"),commitId:this.variableExpression("CommitId"),commitMessage:this.variableExpression("CommitMessage"),connectionArn:this.variableExpression("ConnectionArn")}}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return options.role.addToPolicy(new(iam()).PolicyStatement({actions:["codestar-connections:UseConnection"],resources:[this.props.connectionArn]})),options.bucket.grantReadWrite(options.role),options.bucket.grantPutAcl(options.role),this.props.codeBuildCloneOutput===!0&&this.props.output.setMetadata(CodeStarConnectionsSourceAction._CONNECTION_ARN_PROPERTY,this.props.connectionArn),{configuration:{ConnectionArn:this.props.connectionArn,FullRepositoryId:`${this.props.owner}/${this.props.repo}`,BranchName:this.props.branch??"master",OutputArtifactFormat:this.props.codeBuildCloneOutput===!0?"CODEBUILD_CLONE_REF":void 0,DetectChanges:this.props.triggerOnPush}}}}exports.CodeStarConnectionsSourceAction=CodeStarConnectionsSourceAction;

View File

@@ -0,0 +1,62 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* Construction properties of the `CommandsAction`.
*/
export interface CommandsActionProps extends codepipeline.CommonAwsActionProps {
/**
* The source to use as input for this action.
*/
readonly input: codepipeline.Artifact;
/**
* The list of additional input artifacts for this action.
*
* @default - no extra inputs
*/
readonly extraInputs?: codepipeline.Artifact[];
/**
* The output artifact for this action.
*
* You can filter files that you want to export as the output artifact for the action.
*
* @example
* new codepipeline.Artifact('CommandsArtifact', ['my-dir/**']);
*
* @default - no output artifact
*/
readonly output?: codepipeline.Artifact;
/**
* The names of the variables in your environment that you want to export.
*
* These variables can be referenced in other actions by using the `variable` method
* of this class.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
* @default - No output variables are exported
*/
readonly outputVariables?: string[];
/**
* Shell commands for the Commands action to run.
*
* All formats are supported except multi-line formats.
*
* The length of the commands array must be between 1 and 50.
*/
readonly commands: string[];
}
/**
* CodePipeline compute action that uses AWS Commands.
*/
export declare class CommandsAction extends Action {
private readonly outputVariables;
constructor(props: CommandsActionProps);
/**
* Reference a CodePipeline variable exported in the Commands action.
*
* @param variableName the name of the variable exported by `outputVariables`
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
*/
variable(variableName: string): string;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommandsAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class CommandsAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CommandsAction",version:"2.252.0"};outputVariables;constructor(props){super({...props,category:codepipeline().ActionCategory.COMPUTE,provider:"Commands",artifactBounds:{minInputs:1,maxInputs:10,minOutputs:0,maxOutputs:1},inputs:[props.input,...props.extraInputs||[]],outputs:props.output?[props.output]:[],commands:props.commands,outputVariables:props.outputVariables});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_CommandsActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CommandsAction),error}if(props.commands.length<1||props.commands.length>50)throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`InvalidCommandsLength`,`The length of the commands array must be between 1 and 50, got: ${props.commands.length}`);if(props.outputVariables!==void 0&&(props.outputVariables.length<1||props.outputVariables.length>15))throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`InvalidOutputVariablesLength`,`The length of the outputVariables array must be between 1 and 15, got: ${props.outputVariables.length}`);this.outputVariables=props.outputVariables||[]}variable(variableName){if(!this.outputVariables.includes(variableName))throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`VariableNotExported`,`Variable '${variableName}' is not exported by \`outputVariables\`, exported variables: ${this.outputVariables.join(", ")}`);return this.variableExpression(variableName)}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}const logGroupArn=cdk().Stack.of(scope).formatArn({service:"logs",resource:"log-group",resourceName:`/aws/codepipeline/${stage.pipeline.pipelineName}`,arnFormat:cdk().ArnFormat.COLON_RESOURCE_NAME}),logGroupArnWithWildcard=`${logGroupArn}:*`;return options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[logGroupArn,logGroupArnWithWildcard],actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"]})),options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[logGroupArnWithWildcard],actions:["logs:GetLogEvents"]})),(this.actionProperties.inputs??[]).length>0&&options.bucket.grantRead(options.role),(this.actionProperties.outputs??[]).length>0&&options.bucket.grantWrite(options.role),{}}}exports.CommandsAction=CommandsAction;

View File

@@ -0,0 +1,12 @@
import type * as codepipeline from '../../aws-codepipeline';
/**
* The ArtifactBounds that make sense for source Actions -
* they don't have any inputs, and have exactly one output.
*/
export declare function sourceArtifactBounds(): codepipeline.ActionArtifactBounds;
/**
* The ArtifactBounds that make sense for deploy Actions -
* they have exactly one input, and don't produce any outputs.
*/
export declare function deployArtifactBounds(): codepipeline.ActionArtifactBounds;
export declare function validatePercentage(name: string, value?: number): void;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sourceArtifactBounds=sourceArtifactBounds,exports.deployArtifactBounds=deployArtifactBounds,exports.validatePercentage=validatePercentage;var core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};function sourceArtifactBounds(){return{minInputs:0,maxInputs:0,minOutputs:1,maxOutputs:1}}function deployArtifactBounds(){return{minInputs:1,maxInputs:1,minOutputs:0,maxOutputs:0}}function validatePercentage(name,value){if(!(value===void 0||core_1().Token.isUnresolved(value))&&(value<0||value>100||!Number.isInteger(value)))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidPercentage`,`'${name}': must be a whole number between 0 and 100, got: ${value}`)}

View File

@@ -0,0 +1,130 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type * as elbv2 from '../../../aws-elasticloadbalancingv2';
import { Action } from '../action';
/**
* Construction properties of `Ec2DeployAction`.
*/
export interface Ec2DeployActionProps extends codepipeline.CommonAwsActionProps {
/**
* The input artifact to deploy to EC2 instances.
*/
readonly input: codepipeline.Artifact;
/**
* The tag key of the instances that you created in Amazon EC2.
*/
readonly instanceTagKey: string;
/**
* The tag value of the instances that you created in Amazon EC2.
* @default - all instances with `instanceTagKey` will be matched
*/
readonly instanceTagValue?: string;
/**
* The type of instances or SSM nodes created in Amazon EC2.
*
* You must have already created, tagged, and installed the SSM agent on all instances.
*/
readonly instanceType: Ec2InstanceType;
/**
* The deploy specifications.
*/
readonly deploySpecifications: Ec2DeploySpecifications;
/**
* The number or percentage of instances that can deploy in parallel.
*
* @default - No configuration
*/
readonly maxBatch?: Ec2MaxInstances;
/**
* Stop the task after the task fails on the specified number or percentage of instances.
*
* @default - No configuration
*/
readonly maxError?: Ec2MaxInstances;
/**
* The list of target groups for deployment. You must have already created the target groups.
*
* Target groups provide a set of instances to process specific requests.
* If the target group is specified, instances will be removed from the target group before deployment and added back to the target group after deployment.
*
* @default - No target groups
*/
readonly targetGroups?: elbv2.ITargetGroup[];
}
/**
* The type of instances or SSM nodes created in Amazon EC2.
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-EC2Deploy.html#action-reference-EC2Deploy-parameters
*/
export declare enum Ec2InstanceType {
/** Amazon EC2 instances */
EC2 = "EC2",
/** AWS System Manager (SSM) managed nodes */
SSM_MANAGED_NODE = "SSM_MANAGED_NODE"
}
/**
* Properties of `Ec2DeploySpecifications.inline()`.
*/
export interface Ec2DeploySpecificationsInlineProps {
/**
* The location of the target directory you want to deploy to.
* Use an absolute path like `/home/ec2-user/deploy`.
*/
readonly targetDirectory: string;
/**
* Path to the executable script file that runs BEFORE the Deploy phase.
* It should start from the root directory of your uploaded source artifact.
* Use an absolute path like `uploadDir/preScript.sh`.
*
* @default - No script
*/
readonly preScript?: string;
/**
* Path to the executable script file that runs AFTER the Deploy phase.
* It should start from the root directory of your uploaded source artifact.
* Use an absolute path like `uploadDir/postScript.sh`.
*/
readonly postScript: string;
}
/**
* A deploy specifications for EC2 deploy action.
*/
export declare abstract class Ec2DeploySpecifications {
/**
* Store deploy specifications as action configurations.
*/
static inline(props: Ec2DeploySpecificationsInlineProps): Ec2DeploySpecifications;
/**
* The callback invoked when this deploy specifications is bound to an action.
*
* @param scope the Construct tree scope
* @returns the action configurations
*/
abstract bind(scope: Construct): any;
}
/**
* Number or percentage of max instances for EC2 deploy action.
*/
export declare abstract class Ec2MaxInstances {
/**
* Max number of instances.
*
* Valid range: from 1 to number of your instances
*/
static targets(targets: number): Ec2MaxInstances;
/**
* Max percentage of instances.
*
* Valid range: from 1 to 100
*/
static percentage(percentage: number): Ec2MaxInstances;
/** Template value */
abstract readonly value: string;
}
/**
* CodePipeline Action to deploy EC2 instances.
*/
export declare class Ec2DeployAction extends Action {
private readonly props;
constructor(props: Ec2DeployActionProps);
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,72 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* The CodePipeline variables emitted by the ECR build and publish Action.
*/
export interface EcrBuildAndPublishVariables {
/**
* The sha256 digest of the image manifest.
*/
readonly ecrImageDigestId: string;
/**
* The name of the Amazon ECR repository where the image was pushed.
*/
readonly ecrRepositoryName: string;
}
/**
* The type of registry to use for the EcrBuildAndPublish action.
*/
export declare enum RegistryType {
/**
* Private registry
*/
PRIVATE = "private",
/**
* Public registry
*/
PUBLIC = "public"
}
/**
* Construction properties of the `EcrBuildAndPublishAction`.
*/
export interface EcrBuildAndPublishActionProps extends codepipeline.CommonAwsActionProps {
/**
* The name of the ECR repository where the image is pushed.
*/
readonly repositoryName: string;
/**
* The directory path of Dockerfile used to build the image.
*
* Optionally, you can provide an alternate directory path if Dockerfile is not at the root level.
*
* @default - the source repository root level
*/
readonly dockerfileDirectoryPath?: string;
/**
* The tags used for the image.
*
* @default - latest
*/
readonly imageTags?: string[];
/**
* Specifies whether the repository is public or private.
*
* @default - RegistryType.PRIVATE
*/
readonly registryType?: RegistryType;
/**
* The artifact produced by the source action that contains the Dockerfile needed to build the image.
*/
readonly input: codepipeline.Artifact;
}
/**
* CodePipeline build action that uses AWS EcrBuildAndPublish.
*/
export declare class EcrBuildAndPublishAction extends Action {
private readonly props;
constructor(props: EcrBuildAndPublishActionProps);
/** The variables emitted by this action. */
get variables(): EcrBuildAndPublishVariables;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EcrBuildAndPublishAction=exports.RegistryType=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},ecr=()=>{var tmp=require("../../../aws-ecr");return ecr=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},RegistryType;(function(RegistryType2){RegistryType2.PRIVATE="private",RegistryType2.PUBLIC="public"})(RegistryType||(exports.RegistryType=RegistryType={}));class EcrBuildAndPublishAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.EcrBuildAndPublishAction",version:"2.252.0"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.BUILD,provider:"ECRBuildAndPublish",artifactBounds:{minInputs:1,maxInputs:1,minOutputs:0,maxOutputs:0},inputs:[props.input]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_EcrBuildAndPublishActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,EcrBuildAndPublishAction),error}this.props=props}get variables(){return{ecrImageDigestId:this.variableExpression("ECRImageDigestId"),ecrRepositoryName:this.variableExpression("ECRRepositoryName")}}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}if(this.props.registryType===RegistryType.PUBLIC){const repositoryArn=cdk().Stack.of(scope).formatArn({service:"ecr-public",resource:"repository",resourceName:this.props.repositoryName,region:""});options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[repositoryArn],actions:["ecr-public:DescribeRepositories","ecr-public:InitiateLayerUpload","ecr-public:UploadLayerPart","ecr-public:CompleteLayerUpload","ecr-public:PutImage","ecr-public:BatchCheckLayerAvailability"]})),ecr().PublicGalleryAuthorizationToken.grantRead(options.role)}else{const repositoryArn=cdk().Stack.of(scope).formatArn({service:"ecr",resource:"repository",resourceName:this.props.repositoryName,region:cdk().Stack.of(scope).region});options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[repositoryArn],actions:["ecr:DescribeRepositories","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:PutImage","ecr:GetDownloadUrlForLayer","ecr:BatchCheckLayerAvailability"]})),ecr().AuthorizationToken.grantRead(options.role)}const logGroupArn=cdk().Stack.of(scope).formatArn({service:"logs",resource:"log-group",resourceName:`/aws/codepipeline/${stage.pipeline.pipelineName}`,arnFormat:cdk().ArnFormat.COLON_RESOURCE_NAME}),logGroupArnWithWildcard=`${logGroupArn}:*`;return options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[logGroupArn,logGroupArnWithWildcard],actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"]})),(this.actionProperties.inputs??[]).length>0&&options.bucket.grantRead(options.role),{configuration:{ECRRepositoryName:this.props.repositoryName,DockerFilePath:this.props.dockerfileDirectoryPath,ImageTags:this.props.imageTags!==void 0?this.props.imageTags.join(","):void 0,RegistryType:this.props.registryType}}}}exports.EcrBuildAndPublishAction=EcrBuildAndPublishAction;

View File

@@ -0,0 +1,2 @@
export * from './build-and-publish-action';
export * from './source-action';

View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.RegistryType=void 0,Object.defineProperty(exports,_noFold="RegistryType",{enumerable:!0,configurable:!0,get:()=>{var value=require("./build-and-publish-action").RegistryType;return Object.defineProperty(exports,_noFold="RegistryType",{enumerable:!0,configurable:!0,value}),value}}),exports.EcrBuildAndPublishAction=void 0,Object.defineProperty(exports,_noFold="EcrBuildAndPublishAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./build-and-publish-action").EcrBuildAndPublishAction;return Object.defineProperty(exports,_noFold="EcrBuildAndPublishAction",{enumerable:!0,configurable:!0,value}),value}}),exports.EcrSourceAction=void 0,Object.defineProperty(exports,_noFold="EcrSourceAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./source-action").EcrSourceAction;return Object.defineProperty(exports,_noFold="EcrSourceAction",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,54 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type { IRepositoryRef } from '../../../interfaces/generated/aws-ecr-interfaces.generated';
import { Action } from '../action';
/**
* The CodePipeline variables emitted by the ECR source Action.
*/
export interface EcrSourceVariables {
/** The identifier of the registry. In ECR, this is usually the ID of the AWS account owning it. */
readonly registryId: string;
/** The physical name of the repository that this action tracks. */
readonly repositoryName: string;
/** The digest of the current image, in the form '<digest type>:<digest value>'. */
readonly imageDigest: string;
/** The Docker tag of the current image. */
readonly imageTag: string;
/** The full ECR Docker URI of the current image. */
readonly imageUri: string;
}
/**
* Construction properties of `EcrSourceAction`.
*/
export interface EcrSourceActionProps extends codepipeline.CommonAwsActionProps {
/**
* The image tag that will be checked for changes.
*
* It is not possible to trigger on changes to more than one tag.
*
* @default 'latest'
*/
readonly imageTag?: string;
/**
*
*/
readonly output: codepipeline.Artifact;
/**
* The repository that will be watched for changes.
*/
readonly repository: IRepositoryRef;
}
/**
* The ECR Repository source CodePipeline Action.
*
* Will trigger the pipeline as soon as the target tag in the repository
* changes, but only if there is a CloudTrail Trail in the account that
* captures the ECR event.
*/
export declare class EcrSourceAction extends Action {
private readonly props;
constructor(props: EcrSourceActionProps);
/** The variables emitted by this action. */
get variables(): EcrSourceVariables;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EcrSourceAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},aws_events_1=()=>{var tmp=require("../../../aws-events");return aws_events_1=()=>tmp,tmp},targets=()=>{var tmp=require("../../../aws-events-targets");return targets=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class EcrSourceAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.EcrSourceAction",version:"2.252.0"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.SOURCE,provider:"ECR",artifactBounds:(0,common_1().sourceArtifactBounds)(),outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_EcrSourceActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,EcrSourceAction),error}this.props=props}get variables(){return{registryId:this.variableExpression("RegistryId"),repositoryName:this.variableExpression("RepositoryName"),imageDigest:this.variableExpression("ImageDigest"),imageTag:this.variableExpression("ImageTag"),imageUri:this.variableExpression("ImageURI")}}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return options.role.addToPolicy(new(iam()).PolicyStatement({actions:["ecr:DescribeImages"],resources:[this.props.repository.repositoryRef.repositoryArn]})),new(aws_events_1()).Rule(scope,core_1().Names.nodeUniqueId(stage.pipeline.node)+"SourceEventRule",{targets:[new(targets()).CodePipeline(stage.pipeline)],eventPattern:{detailType:["ECR Image Action"],source:["aws.ecr"],detail:{result:["SUCCESS"],"repository-name":[this.props.repository.repositoryRef.repositoryName],"image-tag":[this.props.imageTag===""?void 0:this.props.imageTag??"latest"],"action-type":["PUSH"]}}}),options.bucket.grantWrite(options.role),{configuration:{RepositoryName:this.props.repository.repositoryRef.repositoryName,ImageTag:this.props.imageTag?this.props.imageTag:void 0}}}}exports.EcrSourceAction=EcrSourceAction;

View File

@@ -0,0 +1,55 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type * as ecs from '../../../aws-ecs';
import type { Duration } from '../../../core';
import { Action } from '../action';
/**
* Construction properties of `EcsDeployAction`.
*/
export interface EcsDeployActionProps extends codepipeline.CommonAwsActionProps {
/**
* The input artifact that contains the JSON image definitions file to use for deployments.
* The JSON file is a list of objects,
* each with 2 keys: `name` is the name of the container in the Task Definition,
* and `imageUri` is the Docker image URI you want to update your service with.
* If you use this property, it's assumed the file is called 'imagedefinitions.json'.
* If your build uses a different file, leave this property empty,
* and use the `imageFile` property instead.
*
* @default - one of this property, or `imageFile`, is required
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html#pipelines-create-image-definitions
*/
readonly input?: codepipeline.Artifact;
/**
* The name of the JSON image definitions file to use for deployments.
* The JSON file is a list of objects,
* each with 2 keys: `name` is the name of the container in the Task Definition,
* and `imageUri` is the Docker image URI you want to update your service with.
* Use this property if you want to use a different name for this file than the default 'imagedefinitions.json'.
* If you use this property, you don't need to specify the `input` property.
*
* @default - one of this property, or `input`, is required
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html#pipelines-create-image-definitions
*/
readonly imageFile?: codepipeline.ArtifactPath;
/**
* The ECS Service to deploy.
*/
readonly service: ecs.IBaseService;
/**
* Timeout for the ECS deployment in minutes. Value must be between 1-60.
*
* @default - 60 minutes
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-ECS.html
*/
readonly deploymentTimeout?: Duration;
}
/**
* CodePipeline Action to deploy an ECS Service.
*/
export declare class EcsDeployAction extends Action {
private readonly props;
private readonly deploymentTimeout?;
constructor(props: EcsDeployActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EcsDeployAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class EcsDeployAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.EcsDeployAction",version:"2.252.0"};props;deploymentTimeout;constructor(props){super({...props,category:codepipeline().ActionCategory.DEPLOY,provider:"ECS",artifactBounds:(0,common_1().deployArtifactBounds)(),inputs:[determineInputArtifact(props)],resource:props.service});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_EcsDeployActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,EcsDeployAction),error}const deploymentTimeout=props.deploymentTimeout?.toMinutes({integral:!0});if(deploymentTimeout!==void 0&&(deploymentTimeout<1||deploymentTimeout>60))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeDeploymentTimeoutBetween`,`Deployment timeout must be between 1 and 60 minutes, got: ${deploymentTimeout}`);this.props=props,this.deploymentTimeout=deploymentTimeout}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return options.role.addToPolicy(new(iam()).PolicyStatement({actions:["ecs:DescribeServices","ecs:DescribeTaskDefinition","ecs:DescribeTasks","ecs:ListTasks","ecs:RegisterTaskDefinition","ecs:TagResource","ecs:UpdateService"],resources:["*"]})),options.role.addToPolicy(new(iam()).PolicyStatement({actions:["iam:PassRole"],resources:["*"],conditions:{StringEqualsIfExists:{"iam:PassedToService":["ec2.amazonaws.com","ecs-tasks.amazonaws.com"]}}})),options.bucket.grantRead(options.role),{configuration:{ClusterName:this.props.service.cluster.clusterName,ServiceName:this.props.service.serviceName,FileName:this.props.imageFile?.fileName,DeploymentTimeout:this.deploymentTimeout}}}}exports.EcsDeployAction=EcsDeployAction;function determineInputArtifact(props){if(props.imageFile&&props.input)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ExactlyInputImagefileProvided`,"Exactly one of 'input' or 'imageFile' can be provided in the ECS deploy Action");if(props.imageFile)return props.imageFile.artifact;if(props.input)return props.input;throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`IsRequiredSpecifyingInputImagefile`,"Specifying one of 'input' or 'imageFile' is required for the ECS deploy Action")}

View File

@@ -0,0 +1,29 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* Construction properties of the `ElasticBeanstalkDeployAction Elastic Beanstalk deploy CodePipeline Action`.
*/
export interface ElasticBeanstalkDeployActionProps extends codepipeline.CommonAwsActionProps {
/**
* The source to use as input for deployment.
*/
readonly input: codepipeline.Artifact;
/**
* The name of the AWS Elastic Beanstalk application to deploy.
*/
readonly applicationName: string;
/**
* The name of the AWS Elastic Beanstalk environment to deploy to.
*/
readonly environmentName: string;
}
/**
* CodePipeline action to deploy an AWS ElasticBeanstalk Application.
*/
export declare class ElasticBeanstalkDeployAction extends Action {
private readonly applicationName;
private readonly environmentName;
constructor(props: ElasticBeanstalkDeployActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ElasticBeanstalkDeployAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},detached_construct_1=()=>{var tmp=require("../../../core/lib/private/detached-construct");return detached_construct_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class ElasticBeanstalkDeployAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.ElasticBeanstalkDeployAction",version:"2.252.0"};applicationName;environmentName;constructor(props){super({...props,category:codepipeline().ActionCategory.DEPLOY,provider:"ElasticBeanstalk",artifactBounds:(0,common_1().deployArtifactBounds)(),inputs:[props.input]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_ElasticBeanstalkDeployActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ElasticBeanstalkDeployAction),error}this.applicationName=props.applicationName,this.environmentName=props.environmentName}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}const policyArn=`arn:${core_1().Aws.PARTITION}:iam::aws:policy/AdministratorAccess-AWSElasticBeanstalk`;return options.role.addManagedPolicy(new class extends detached_construct_1().DetachedConstruct{managedPolicyArn=policyArn;managedPolicyRef={policyArn};constructor(){super("This object can not be used in this API")}}),options.bucket.grantRead(options.role),{configuration:{ApplicationName:this.applicationName,EnvironmentName:this.environmentName}}}}exports.ElasticBeanstalkDeployAction=ElasticBeanstalkDeployAction;

View File

@@ -0,0 +1,96 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type { SecretValue } from '../../../core';
import { Action } from '../action';
/**
* If and how the GitHub source action should be triggered
*/
export declare enum GitHubTrigger {
NONE = "None",
POLL = "Poll",
WEBHOOK = "WebHook"
}
/**
* The CodePipeline variables emitted by GitHub source Action.
*/
export interface GitHubSourceVariables {
/** The name of the repository this action points to. */
readonly repositoryName: string;
/** The name of the branch this action tracks. */
readonly branchName: string;
/** The date the currently last commit on the tracked branch was authored, in ISO-8601 format. */
readonly authorDate: string;
/** The date the currently last commit on the tracked branch was committed, in ISO-8601 format. */
readonly committerDate: string;
/** The SHA1 hash of the currently last commit on the tracked branch. */
readonly commitId: string;
/** The message of the currently last commit on the tracked branch. */
readonly commitMessage: string;
/** The GitHub API URL of the currently last commit on the tracked branch. */
readonly commitUrl: string;
}
/**
* Construction properties of the `GitHubSourceAction GitHub source action`.
*/
export interface GitHubSourceActionProps extends codepipeline.CommonActionProps {
/**
*
*/
readonly output: codepipeline.Artifact;
/**
* The GitHub account/user that owns the repo.
*/
readonly owner: string;
/**
* The name of the repo, without the username.
*/
readonly repo: string;
/**
* The branch to use.
*
* @default "master"
*/
readonly branch?: string;
/**
* A GitHub OAuth token to use for authentication.
*
* It is recommended to use a Secrets Manager `Secret` to obtain the token:
*
* const oauth = cdk.SecretValue.secretsManager('my-github-token');
* new GitHubSourceAction(this, 'GitHubAction', { oauthToken: oauth, ... });
*
* If you rotate the value in the Secret, you must also change at least one property
* of the CodePipeline to force CloudFormation to re-read the secret.
*
* The GitHub Personal Access Token should have these scopes:
*
* * **repo** - to read the repository
* * **admin:repo_hook** - if you plan to use webhooks (true by default)
*
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/appendix-github-oauth.html#GitHub-create-personal-token-CLI
*/
readonly oauthToken: SecretValue;
/**
* How AWS CodePipeline should be triggered
*
* With the default value "WEBHOOK", a webhook is created in GitHub that triggers the action
* With "POLL", CodePipeline periodically checks the source for changes
* With "None", the action is not triggered through changes in the source
*
* To use `WEBHOOK`, your GitHub Personal Access Token should have
* **admin:repo_hook** scope (in addition to the regular **repo** scope).
*
* @default GitHubTrigger.WEBHOOK
*/
readonly trigger?: GitHubTrigger;
}
/**
* Source that is provided by a GitHub repository.
*/
export declare class GitHubSourceAction extends Action {
private readonly props;
constructor(props: GitHubSourceActionProps);
/** The variables emitted by this action. */
get variables(): GitHubSourceVariables;
protected bound(scope: Construct, stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GitHubSourceAction=exports.GitHubTrigger=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp},GitHubTrigger;(function(GitHubTrigger2){GitHubTrigger2.NONE="None",GitHubTrigger2.POLL="Poll",GitHubTrigger2.WEBHOOK="WebHook"})(GitHubTrigger||(exports.GitHubTrigger=GitHubTrigger={}));class GitHubSourceAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.GitHubSourceAction",version:"2.252.0"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.SOURCE,owner:"ThirdParty",provider:"GitHub",artifactBounds:(0,common_1().sourceArtifactBounds)(),outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_GitHubSourceActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,GitHubSourceAction),error}this.props=props}get variables(){return{repositoryName:this.variableExpression("RepositoryName"),branchName:this.variableExpression("BranchName"),authorDate:this.variableExpression("AuthorDate"),committerDate:this.variableExpression("CommitterDate"),commitId:this.variableExpression("CommitId"),commitMessage:this.variableExpression("CommitMessage"),commitUrl:this.variableExpression("CommitUrl")}}bound(scope,stage,_options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return(!this.props.trigger||this.props.trigger===GitHubTrigger.WEBHOOK)&&new(codepipeline()).CfnWebhook(scope,"WebhookResource",{authentication:"GITHUB_HMAC",authenticationConfiguration:{secretToken:this.props.oauthToken.unsafeUnwrap()},filters:[{jsonPath:"$.ref",matchEquals:"refs/heads/{Branch}"}],targetAction:this.actionProperties.actionName,targetPipeline:stage.pipeline.pipelineName,targetPipelineVersion:1,registerWithThirdParty:!0}),{configuration:{Owner:this.props.owner,Repo:this.props.repo,Branch:this.props.branch||"master",OAuthToken:this.props.oauthToken.unsafeUnwrap(),PollForSourceChanges:this.props.trigger===GitHubTrigger.POLL}}}}exports.GitHubSourceAction=GitHubSourceAction;

View File

@@ -0,0 +1,25 @@
export * from './alexa-ask/deploy-action';
import './bitbucket/source-action';
export * from './codestar-connections/source-action';
export * from './cloudformation';
export * from './codebuild/build-action';
export * from './codecommit/source-action';
export * from './codedeploy/ecs-deploy-action';
export * from './codedeploy/server-deploy-action';
export * from './commands/commands-action';
export * from './ec2/deploy-action';
export * from './ecr';
export * from './ecs/deploy-action';
export * from './elastic-beanstalk/deploy-action';
export * from './github/source-action';
export * from './inspector';
export * from './jenkins/jenkins-action';
export * from './jenkins/jenkins-provider';
export * from './lambda/invoke-action';
export * from './manual-approval-action';
export * from './s3/deploy-action';
export * from './s3/source-action';
export * from './stepfunctions/invoke-action';
export * from './servicecatalog/deploy-action-beta1';
export * from './action';
export * from './codepipeline/invoke-action';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,29 @@
import type { Construct } from 'constructs';
import type { InspectorScanActionBaseProps } from './scan-action-base';
import { InspectorScanActionBase } from './scan-action-base';
import type * as codepipeline from '../../../aws-codepipeline';
import type { IRepositoryRef } from '../../../interfaces/generated/aws-ecr-interfaces.generated';
/**
* Construction properties of the `InspectorEcrImageScanAction`.
*/
export interface InspectorEcrImageScanActionProps extends InspectorScanActionBaseProps {
/**
* The Amazon ECR repository where the image is pushed.
*/
readonly repository: IRepositoryRef;
/**
* The tag used for the image.
*
* @default 'latest'
*/
readonly imageTag?: string;
}
/**
* CodePipeline invoke action that uses AWS InspectorScan for ECR images.
*/
export declare class InspectorEcrImageScanAction extends InspectorScanActionBase {
private readonly ecrProps;
constructor(props: InspectorEcrImageScanActionProps);
protected renderActionConfiguration(): Record<string, any>;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InspectorEcrImageScanAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var scan_action_base_1=()=>{var tmp=require("./scan-action-base");return scan_action_base_1=()=>tmp,tmp},ecr=()=>{var tmp=require("../../../aws-ecr");return ecr=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp};class InspectorEcrImageScanAction extends scan_action_base_1().InspectorScanActionBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.InspectorEcrImageScanAction",version:"2.252.0"};ecrProps;constructor(props){super(props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_InspectorEcrImageScanActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,InspectorEcrImageScanAction),error}this.ecrProps=props}renderActionConfiguration(){return{InspectorRunMode:"ECRImageScan",ECRRepositoryName:this.ecrProps.repository.repositoryRef.repositoryName,ImageTag:this.ecrProps.imageTag}}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}const config=super.bound(scope,stage,options);return options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[this.ecrProps.repository.repositoryRef.repositoryArn],actions:["ecr:GetDownloadUrlForLayer","ecr:BatchGetImage","ecr:BatchCheckLayerAvailability"]})),ecr().AuthorizationToken.grantRead(options.role),config}}exports.InspectorEcrImageScanAction=InspectorEcrImageScanAction;

View File

@@ -0,0 +1,3 @@
export * from './scan-action-base';
export * from './source-code-scan-action';
export * from './ecr-image-scan-action';

View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.InspectorScanActionBase=void 0,Object.defineProperty(exports,_noFold="InspectorScanActionBase",{enumerable:!0,configurable:!0,get:()=>{var value=require("./scan-action-base").InspectorScanActionBase;return Object.defineProperty(exports,_noFold="InspectorScanActionBase",{enumerable:!0,configurable:!0,value}),value}}),exports.InspectorSourceCodeScanAction=void 0,Object.defineProperty(exports,_noFold="InspectorSourceCodeScanAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./source-code-scan-action").InspectorSourceCodeScanAction;return Object.defineProperty(exports,_noFold="InspectorSourceCodeScanAction",{enumerable:!0,configurable:!0,value}),value}}),exports.InspectorEcrImageScanAction=void 0,Object.defineProperty(exports,_noFold="InspectorEcrImageScanAction",{enumerable:!0,configurable:!0,get:()=>{var value=require("./ecr-image-scan-action").InspectorEcrImageScanAction;return Object.defineProperty(exports,_noFold="InspectorEcrImageScanAction",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,62 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* The CodePipeline variables emitted by the InspectorScan Action.
*/
export interface InspectorScanVariables {
/**
* The highest severity output from the scan.
*
* Valid values are medium | high | critical.
*/
readonly highestScannedSeverity: string;
}
/**
* Base construction properties of the `InspectorScanActionBase`.
*/
export interface InspectorScanActionBaseProps extends codepipeline.CommonAwsActionProps {
/**
* The number of critical severity vulnerabilities found in your source
* beyond which CodePipeline should fail the action.
*
* @default - no threshold
*/
readonly criticalThreshold?: number;
/**
* The number of high severity vulnerabilities found in your source
* beyond which CodePipeline should fail the action.
*
* @default - no threshold
*/
readonly highThreshold?: number;
/**
* The number of medium severity vulnerabilities found in your source
* beyond which CodePipeline should fail the action.
*
* @default - no threshold
*/
readonly mediumThreshold?: number;
/**
* The number of low severity vulnerabilities found in your source
* beyond which CodePipeline should fail the action.
*
* @default - no threshold
*/
readonly lowThreshold?: number;
/**
* Vulnerability details of your source in the form of a Software Bill of Materials (SBOM) file.
*/
readonly output: codepipeline.Artifact;
}
/**
* CodePipeline invoke action that uses AWS InspectorScan.
*/
export declare abstract class InspectorScanActionBase extends Action {
protected readonly props: InspectorScanActionBaseProps;
constructor(props: InspectorScanActionBaseProps);
/** The variables emitted by this action. */
get variables(): InspectorScanVariables;
protected abstract renderActionConfiguration(): Record<string, any>;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InspectorScanActionBase=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class InspectorScanActionBase extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.InspectorScanActionBase",version:"2.252.0"};props;constructor(props){super({...props,category:codepipeline().ActionCategory.INVOKE,provider:"InspectorScan",artifactBounds:{minInputs:0,maxInputs:1,minOutputs:1,maxOutputs:1},outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_InspectorScanActionBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,InspectorScanActionBase),error}this.props=props}get variables(){return{highestScannedSeverity:this.variableExpression("HighestScannedSeverity")}}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:["*"],actions:["inspector-scan:ScanSbom"]}));const logGroupArn=cdk().Stack.of(scope).formatArn({service:"logs",resource:"log-group",resourceName:`/aws/codepipeline/${stage.pipeline.pipelineName}`,arnFormat:cdk().ArnFormat.COLON_RESOURCE_NAME}),logGroupArnWithWildcard=`${logGroupArn}:*`;return options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({resources:[logGroupArn,logGroupArnWithWildcard],actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"]})),(this.actionProperties.outputs??[]).length>0&&options.bucket.grantWrite(options.role),{configuration:{...this.renderActionConfiguration(),CriticalThreshold:this.props.criticalThreshold,HighThreshold:this.props.highThreshold,MediumThreshold:this.props.mediumThreshold,LowThreshold:this.props.lowThreshold}}}}exports.InspectorScanActionBase=InspectorScanActionBase;

View File

@@ -0,0 +1,21 @@
import type { Construct } from 'constructs';
import type { InspectorScanActionBaseProps } from './scan-action-base';
import { InspectorScanActionBase } from './scan-action-base';
import type * as codepipeline from '../../../aws-codepipeline';
/**
* Construction properties of the `InspectorSourceCodeScanAction`.
*/
export interface InspectorSourceCodeScanActionProps extends InspectorScanActionBaseProps {
/**
* The source code to scan for vulnerabilities.
*/
readonly input: codepipeline.Artifact;
}
/**
* CodePipeline invoke action that uses AWS InspectorScan for source code.
*/
export declare class InspectorSourceCodeScanAction extends InspectorScanActionBase {
constructor(props: InspectorSourceCodeScanActionProps);
protected renderActionConfiguration(): Record<string, any>;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InspectorSourceCodeScanAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var scan_action_base_1=()=>{var tmp=require("./scan-action-base");return scan_action_base_1=()=>tmp,tmp};class InspectorSourceCodeScanAction extends scan_action_base_1().InspectorScanActionBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.InspectorSourceCodeScanAction",version:"2.252.0"};constructor(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_InspectorSourceCodeScanActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,InspectorSourceCodeScanAction),error}const baseProps={...props,inputs:[props.input]};super(baseProps)}renderActionConfiguration(){return{InspectorRunMode:"SourceCodeScan"}}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}const config=super.bound(scope,stage,options);return(this.actionProperties.inputs??[]).length>0&&options.bucket.grantRead(options.role),config}}exports.InspectorSourceCodeScanAction=InspectorSourceCodeScanAction;

View File

@@ -0,0 +1,58 @@
import type { Construct } from 'constructs';
import type { IJenkinsProvider } from './jenkins-provider';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* The type of the Jenkins Action that determines its CodePipeline Category -
* Build, or Test.
* Note that a Jenkins provider, even if it has the same name,
* must be separately registered for each type.
*/
export declare enum JenkinsActionType {
/**
* The Action will have the Build Category.
*/
BUILD = 0,
/**
* The Action will have the Test Category.
*/
TEST = 1
}
/**
* Construction properties of `JenkinsAction`.
*/
export interface JenkinsActionProps extends codepipeline.CommonActionProps {
/**
* The source to use as input for this build.
*/
readonly inputs?: codepipeline.Artifact[];
/**
*
*/
readonly outputs?: codepipeline.Artifact[];
/**
* The Jenkins Provider for this Action.
*/
readonly jenkinsProvider: IJenkinsProvider;
/**
* The name of the project (sometimes also called job, or task)
* on your Jenkins installation that will be invoked by this Action.
*
* @example 'MyJob'
*/
readonly projectName: string;
/**
* The type of the Action - Build, or Test.
*/
readonly type: JenkinsActionType;
}
/**
* Jenkins build CodePipeline Action.
*
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-four-stage-pipeline.html
*/
export declare class JenkinsAction extends Action {
private readonly props;
constructor(props: JenkinsActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JenkinsAction=exports.JenkinsActionType=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var jenkins_provider_1=()=>{var tmp=require("./jenkins-provider");return jenkins_provider_1=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},JenkinsActionType;(function(JenkinsActionType2){JenkinsActionType2[JenkinsActionType2.BUILD=0]="BUILD",JenkinsActionType2[JenkinsActionType2.TEST=1]="TEST"})(JenkinsActionType||(exports.JenkinsActionType=JenkinsActionType={}));class JenkinsAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.JenkinsAction",version:"2.252.0"};props;constructor(props){super({...props,category:props.type===JenkinsActionType.BUILD?codepipeline().ActionCategory.BUILD:codepipeline().ActionCategory.TEST,provider:props.jenkinsProvider.providerName,owner:"Custom",artifactBounds:jenkins_provider_1().jenkinsArtifactsBounds,version:props.jenkinsProvider.version});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_JenkinsActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,JenkinsAction),error}this.props=props}bound(_scope,_stage,_options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return this.actionProperties.category===codepipeline().ActionCategory.BUILD?this.props.jenkinsProvider._registerBuildProvider():this.props.jenkinsProvider._registerTestProvider(),{configuration:{ProjectName:this.props.projectName}}}}exports.JenkinsAction=JenkinsAction;

View File

@@ -0,0 +1,138 @@
import type { IConstruct } from 'constructs';
import { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
/**
* A Jenkins provider.
*
* If you want to create a new Jenkins provider managed alongside your CDK code,
* instantiate the `JenkinsProvider` class directly.
*
* If you want to reference an already registered provider,
* use the `JenkinsProvider#fromJenkinsProviderAttributes` method.
*/
export interface IJenkinsProvider extends IConstruct {
readonly providerName: string;
readonly serverUrl: string;
readonly version: string;
/**
* Registers a Jenkins Provider for the build category.
* This method will be automatically called when creating
* a `JenkinsAction`,
* so you should never need to call it explicitly.
*
* @internal
*/
_registerBuildProvider(): void;
/**
* Registers a Jenkins Provider for the test category.
* This method will be automatically called when creating
* a `JenkinsTestAction`,
* so you should never need to call it explicitly.
*
* @internal
*/
_registerTestProvider(): void;
}
/**
* Properties for importing an existing Jenkins provider.
*/
export interface JenkinsProviderAttributes {
/**
* The name of the Jenkins provider that you set in the AWS CodePipeline plugin configuration of your Jenkins project.
*
* @example 'MyJenkinsProvider'
*/
readonly providerName: string;
/**
* The base URL of your Jenkins server.
*
* @example 'http://myjenkins.com:8080'
*/
readonly serverUrl: string;
/**
* The version of your provider.
*
* @default '1'
*/
readonly version?: string;
}
export interface JenkinsProviderProps {
/**
* The name of the Jenkins provider that you set in the AWS CodePipeline plugin configuration of your Jenkins project.
*
* @example 'MyJenkinsProvider'
*/
readonly providerName: string;
/**
* The base URL of your Jenkins server.
*
* @example 'http://myjenkins.com:8080'
*/
readonly serverUrl: string;
/**
* The version of your provider.
*
* @default '1'
*/
readonly version?: string;
/**
* Whether to immediately register a Jenkins Provider for the build category.
* The Provider will always be registered if you create a `JenkinsAction`.
*
* @default false
*/
readonly forBuild?: boolean;
/**
* Whether to immediately register a Jenkins Provider for the test category.
* The Provider will always be registered if you create a `JenkinsTestAction`.
*
* @default false
*/
readonly forTest?: boolean;
}
export declare abstract class BaseJenkinsProvider extends Construct implements IJenkinsProvider {
abstract readonly providerName: string;
abstract readonly serverUrl: string;
readonly version: string;
protected constructor(scope: Construct, id: string, version?: string);
/**
* @internal
*/
abstract _registerBuildProvider(): void;
/**
* @internal
*/
abstract _registerTestProvider(): void;
}
/**
* A class representing Jenkins providers.
*
* @see #import
*/
export declare class JenkinsProvider extends BaseJenkinsProvider {
/**
* Import a Jenkins provider registered either outside the CDK,
* or in a different CDK Stack.
*
* @param scope the parent Construct for the new provider
* @param id the identifier of the new provider Construct
* @param attrs the properties used to identify the existing provider
* @returns a new Construct representing a reference to an existing Jenkins provider
*/
static fromJenkinsProviderAttributes(scope: Construct, id: string, attrs: JenkinsProviderAttributes): IJenkinsProvider;
readonly providerName: string;
readonly serverUrl: string;
private buildIncluded;
private testIncluded;
constructor(scope: Construct, id: string, props: JenkinsProviderProps);
/**
* @internal
*/
_registerBuildProvider(): void;
/**
* @internal
*/
_registerTestProvider(): void;
private registerJenkinsCustomAction;
}
export declare const jenkinsArtifactsBounds: codepipeline.ActionArtifactBounds;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.jenkinsArtifactsBounds=exports.JenkinsProvider=exports.BaseJenkinsProvider=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp};class BaseJenkinsProvider extends constructs_1().Construct{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.BaseJenkinsProvider",version:"2.252.0"};version;constructor(scope,id,version){super(scope,id),this.version=version||"1"}}exports.BaseJenkinsProvider=BaseJenkinsProvider;class JenkinsProvider extends BaseJenkinsProvider{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.JenkinsProvider",version:"2.252.0"};static fromJenkinsProviderAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_JenkinsProviderAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromJenkinsProviderAttributes),error}return new ImportedJenkinsProvider(scope,id,attrs)}providerName;serverUrl;buildIncluded=!1;testIncluded=!1;constructor(scope,id,props){super(scope,id,props.version);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_JenkinsProviderProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,JenkinsProvider),error}this.providerName=props.providerName,this.serverUrl=props.serverUrl,props.forBuild===!0&&this._registerBuildProvider(),props.forTest===!0&&this._registerTestProvider()}_registerBuildProvider(){this.buildIncluded||(this.buildIncluded=!0,this.registerJenkinsCustomAction("JenkinsBuildProviderResource",codepipeline().ActionCategory.BUILD))}_registerTestProvider(){this.testIncluded||(this.testIncluded=!0,this.registerJenkinsCustomAction("JenkinsTestProviderResource",codepipeline().ActionCategory.TEST))}registerJenkinsCustomAction(id,category){new(codepipeline()).CustomActionRegistration(this,id,{category,artifactBounds:exports.jenkinsArtifactsBounds,provider:this.providerName,version:this.version,entityUrl:appendToUrl(this.serverUrl,"job/{Config:ProjectName}"),executionUrl:appendToUrl(this.serverUrl,"job/{Config:ProjectName}/{ExternalExecutionId}"),actionProperties:[{name:"ProjectName",required:!0,key:!0,queryable:!0}]})}}exports.JenkinsProvider=JenkinsProvider;class ImportedJenkinsProvider extends BaseJenkinsProvider{providerName;serverUrl;constructor(scope,id,props){super(scope,id,props.version),this.providerName=props.providerName,this.serverUrl=props.serverUrl}_registerBuildProvider(){}_registerTestProvider(){}}function appendToUrl(baseUrl,path){return baseUrl.endsWith("/")?baseUrl+path:`${baseUrl}/${path}`}exports.jenkinsArtifactsBounds={minInputs:0,maxInputs:5,minOutputs:0,maxOutputs:5};

View File

@@ -0,0 +1,77 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type * as lambda from '../../../aws-lambda';
import { Action } from '../action';
/**
* Construction properties of the `LambdaInvokeAction Lambda invoke CodePipeline Action`.
*/
export interface LambdaInvokeActionProps extends codepipeline.CommonAwsActionProps {
/**
* The optional input Artifacts of the Action.
* A Lambda Action can have up to 5 inputs.
* The inputs will appear in the event passed to the Lambda,
* under the `'CodePipeline.job'.data.inputArtifacts` path.
*
* @default the Action will not have any inputs
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
*/
readonly inputs?: codepipeline.Artifact[];
/**
* The optional names of the output Artifacts of the Action.
* A Lambda Action can have up to 5 outputs.
* The outputs will appear in the event passed to the Lambda,
* under the `'CodePipeline.job'.data.outputArtifacts` path.
* It is the responsibility of the Lambda to upload ZIP files with the Artifact contents to the provided locations.
*
* @default the Action will not have any outputs
*/
readonly outputs?: codepipeline.Artifact[];
/**
* A set of key-value pairs that will be accessible to the invoked Lambda
* inside the event that the Pipeline will call it with.
*
* Only one of `userParameters` or `userParametersString` can be specified.
*
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
* @default - no user parameters will be passed
*/
readonly userParameters?: {
[key: string]: any;
};
/**
* The string representation of the user parameters that will be
* accessible to the invoked Lambda inside the event
* that the Pipeline will call it with.
*
* Only one of `userParametersString` or `userParameters` can be specified.
*
* @default - no user parameters will be passed
*/
readonly userParametersString?: string;
/**
* The lambda function to invoke.
*/
readonly lambda: lambda.IFunction;
}
/**
* CodePipeline invoke Action that is provided by an AWS Lambda function.
*
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html
*/
export declare class LambdaInvokeAction extends Action {
private readonly props;
constructor(props: LambdaInvokeActionProps);
/**
* Reference a CodePipeline variable defined by the Lambda function this action points to.
* Variables in Lambda invoke actions are defined by calling the PutJobSuccessResult CodePipeline API call
* with the 'outputVariables' property filled.
*
* @param variableName the name of the variable to reference.
* A variable by this name must be present in the 'outputVariables' section of the PutJobSuccessResult
* request that the Lambda function calls when the action is invoked
*
* @see https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutJobSuccessResult.html
*/
variable(variableName: string): string;
protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaInvokeAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class LambdaInvokeAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.LambdaInvokeAction",version:"2.252.0"};props;constructor(props){super({...props,resource:props.lambda,category:codepipeline().ActionCategory.INVOKE,provider:"Lambda",artifactBounds:{minInputs:0,maxInputs:5,minOutputs:0,maxOutputs:5}});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_LambdaInvokeActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,LambdaInvokeAction),error}if(this.props=props,props.userParameters&&props.userParametersString)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`OneUserParametersUserParameters`,"Only one of userParameters or userParametersString can be specified")}variable(variableName){return this.variableExpression(variableName)}bound(scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return options.role.addToPolicy(new(iam()).PolicyStatement({actions:["lambda:ListFunctions"],resources:["*"]})),this.props.lambda.grantInvoke(options.role),(this.actionProperties.inputs||[]).length>0&&options.bucket.grantRead(options.role),(this.actionProperties.outputs||[]).length>0&&options.bucket.grantWrite(options.role),this.props.lambda.addToRolePolicy(new(iam()).PolicyStatement({resources:["*"],actions:["codepipeline:PutJobSuccessResult","codepipeline:PutJobFailureResult"]})),{configuration:{FunctionName:this.props.lambda.functionName,UserParameters:this.props.userParametersString??core_1().Stack.of(scope).toJsonString(this.props.userParameters)}}}}exports.LambdaInvokeAction=LambdaInvokeAction;

View File

@@ -0,0 +1,67 @@
import type { Construct } from 'constructs';
import { Action } from './action';
import * as codepipeline from '../../aws-codepipeline';
import * as iam from '../../aws-iam';
import * as sns from '../../aws-sns';
import type { Duration } from '../../core';
/**
* Construction properties of the `ManualApprovalAction`.
*/
export interface ManualApprovalActionProps extends codepipeline.CommonAwsActionProps {
/**
* Optional SNS topic to send notifications to when an approval is pending.
*/
readonly notificationTopic?: sns.ITopic;
/**
* A list of email addresses to subscribe to notifications when this Action is pending approval.
* If this has been provided, but not `notificationTopic`,
* a new Topic will be created.
*/
readonly notifyEmails?: string[];
/**
* Any additional information that you want to include in the notification email message.
*/
readonly additionalInformation?: string;
/**
* URL you want to provide to the reviewer as part of the approval request.
*
* @default - the approval request will not have an external link
*/
readonly externalEntityLink?: string;
/**
* A timeout duration.
*
* It is configurable up to 86400 minutes (60 days) with a minimum value of 5 minutes.
*
* @default - 10080 minutes (7 days)
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/limits.html
*/
readonly timeout?: Duration;
}
/**
* Manual approval action.
*/
export declare class ManualApprovalAction extends Action {
/**
* The SNS Topic passed when constructing the Action.
* If no Topic was passed, but `notifyEmails` were provided,
* a new Topic will be created.
*/
private _notificationTopic?;
private readonly props;
private stage?;
constructor(props: ManualApprovalActionProps);
get notificationTopic(): sns.ITopic | undefined;
/**
* grant the provided principal the permissions to approve or reject this manual approval action
*
* For more info see:
* https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-iam-permissions.html
*
* [disable-awslint:no-grants]
*
* @param grantable the grantable to attach the permissions to
*/
grantManualApproval(grantable: iam.IGrantable): void;
protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ManualApprovalAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var action_1=()=>{var tmp=require("./action");return action_1=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},sns=()=>{var tmp=require("../../aws-sns");return sns=()=>tmp,tmp},subs=()=>{var tmp=require("../../aws-sns-subscriptions");return subs=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class ManualApprovalAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.ManualApprovalAction",version:"2.252.0"};_notificationTopic;props;stage;constructor(props){super({...props,category:codepipeline().ActionCategory.APPROVAL,provider:"Manual",artifactBounds:{minInputs:0,maxInputs:0,minOutputs:0,maxOutputs:0}});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_ManualApprovalActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ManualApprovalAction),error}if(props.timeout&&(props.timeout.toMinutes()<5||props.timeout.toMinutes()>86400))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidTimeout`,`timeout must be between 5 minutes and 86400 minutes (60 days), got ${props.timeout.toMinutes()} minutes`);this.props=props}get notificationTopic(){return this._notificationTopic}grantManualApproval(grantable){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantable)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grantManualApproval),error}if(!this.stage)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ActionNotBound`,"Cannot grant permissions before binding action to a stage");grantable.grantPrincipal.addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["codepipeline:ListPipelines"],resources:["*"]})),grantable.grantPrincipal.addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["codepipeline:GetPipeline","codepipeline:GetPipelineState","codepipeline:GetPipelineExecution"],resources:[this.stage.pipeline.pipelineArn]})),grantable.grantPrincipal.addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["codepipeline:PutApprovalResult"],resources:[`${this.stage.pipeline.pipelineArn}/${this.stage.stageName}/${this.props.actionName}`]}))}bound(scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}if(this.props.notificationTopic?this._notificationTopic=this.props.notificationTopic:(this.props.notifyEmails||[]).length>0&&(this._notificationTopic=new(sns()).Topic(scope,"TopicResource")),this._notificationTopic){this._notificationTopic.grantPublish(options.role);for(const notifyEmail of this.props.notifyEmails||[])this._notificationTopic.addSubscription(new(subs()).EmailSubscription(notifyEmail))}return this.stage=stage,{configuration:undefinedIfAllValuesAreEmpty({NotificationArn:this._notificationTopic?.topicArn,CustomData:this.props.additionalInformation,ExternalEntityLink:this.props.externalEntityLink})}}}exports.ManualApprovalAction=ManualApprovalAction;function undefinedIfAllValuesAreEmpty(object){return Object.values(object).some(v=>v!==void 0)?object:void 0}

View File

@@ -0,0 +1,21 @@
import type * as iam from '../../../aws-iam';
import type * as s3 from '../../../aws-s3';
/**
* Create a dependency between the stack of the replication bucket and the stack of the action role
*
* If the deployment action happens in across-account/cross-region fashion, we
* create two support stacks (stack R for the cross-account role, and stack B for the
* cross-region replication bucket), but these stacks are not related to each
* other by default.
*
* To make it more interesting, if these are roles with autogenerated names, the
* stacks have bidirectional policies: the bucket and key (B) refer to the role
* (R), and the role (R) refers to the bucket and key (B). This is an
* unfortunate way of setting up the policies, and it should really be
* completely replaced with a tag-based mechanism.
*
* Until then, we've determined that deployment accidentally works fine if we deploy
* the account stack R first, followed by the region stack B. So explicitly establish
* this dependency in CodePipeline Actions.
*/
export declare function forceSupportStackDependency(bucket: s3.IBucket, role: iam.IRole): void;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.forceSupportStackDependency=forceSupportStackDependency;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};function forceSupportStackDependency(bucket,role){core_1().Resource.isOwnedResource(bucket)&&core_1().Resource.isOwnedResource(role)&&core_1().Stack.of(bucket).addDependency(core_1().Stack.of(role),`replication bucket {${bucket.node.path}} to action role {${role}}`)}

View File

@@ -0,0 +1,101 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type * as kms from '../../../aws-kms';
import type * as s3 from '../../../aws-s3';
import type { Duration } from '../../../core';
import { Action } from '../action';
/**
* Used for HTTP cache-control header, which influences downstream caches.
* Use the provided static factory methods to construct instances of this class.
* Used in the `S3DeployActionProps.cacheControl` property.
*
* @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
*/
export declare class CacheControl {
value: string;
/** The 'must-revalidate' cache control directive. */
static mustRevalidate(): CacheControl;
/** The 'no-cache' cache control directive. */
static noCache(): CacheControl;
/** The 'no-transform' cache control directive. */
static noTransform(): CacheControl;
/** The 'no-store' cache control directive. */
static noStore(): CacheControl;
/** The 'must-understand' cache control directive. */
static mustUnderstand(): CacheControl;
/** The 'public' cache control directive. */
static setPublic(): CacheControl;
/** The 'private' cache control directive. */
static setPrivate(): CacheControl;
/** The 'immutable' cache control directive. */
static immutable(): CacheControl;
/** The 'proxy-revalidate' cache control directive. */
static proxyRevalidate(): CacheControl;
/** The 'max-age' cache control directive. */
static maxAge(t: Duration): CacheControl;
/** The 's-max-age' cache control directive. */
static sMaxAge(t: Duration): CacheControl;
/** The 'stale-while-revalidate' cache control directive. */
static staleWhileRevalidate(t: Duration): CacheControl;
/** The 'stale-if-error' cache control directive. */
static staleIfError(t: Duration): CacheControl;
/**
* Allows you to create an arbitrary cache control directive,
* in case our support is missing a method for a particular directive.
*/
static fromString(s: string): CacheControl;
/** @param value the actual text value of the created directive */
private constructor();
}
/**
* Construction properties of the `S3DeployAction S3 deploy Action`.
*/
export interface S3DeployActionProps extends codepipeline.CommonAwsActionProps {
/**
* Should the deploy action extract the artifact before deploying to Amazon S3.
*
* @default true
*/
readonly extract?: boolean;
/**
* The key of the target object. This is required if extract is false.
*/
readonly objectKey?: string;
/**
* The input Artifact to deploy to Amazon S3.
*/
readonly input: codepipeline.Artifact;
/**
* The Amazon S3 bucket that is the deploy target.
*/
readonly bucket: s3.IBucket;
/**
* The specified canned ACL to objects deployed to Amazon S3.
* This overwrites any existing ACL that was applied to the object.
*
* @default - the original object ACL
*/
readonly accessControl?: s3.BucketAccessControl;
/**
* The caching behavior for requests/responses for objects in the bucket.
* The final cache control property will be the result of joining all of the provided array elements with a comma
* (plus a space after the comma).
*
* @default - none, decided by the HTTP client
*/
readonly cacheControl?: CacheControl[];
/**
* The AWS KMS encryption key for the host bucket.
* The encryptionKey parameter encrypts uploaded artifacts with the provided AWS KMS key.
* @default - none
*/
readonly encryptionKey?: kms.IKey;
}
/**
* Deploys the sourceArtifact to Amazon S3.
*/
export declare class S3DeployAction extends Action {
private readonly props;
constructor(props: S3DeployActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.S3DeployAction=exports.CacheControl=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var case_1=()=>{var tmp=require("case");return case_1=()=>tmp,tmp},codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp};class CacheControl{value;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CacheControl",version:"2.252.0"};static mustRevalidate(){return new CacheControl("must-revalidate")}static noCache(){return new CacheControl("no-cache")}static noTransform(){return new CacheControl("no-transform")}static noStore(){return new CacheControl("no-store")}static mustUnderstand(){return new CacheControl("must-understand")}static setPublic(){return new CacheControl("public")}static setPrivate(){return new CacheControl("private")}static immutable(){return new CacheControl("immutable")}static proxyRevalidate(){return new CacheControl("proxy-revalidate")}static maxAge(t){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(t)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.maxAge),error}return new CacheControl(`max-age=${t.toSeconds()}`)}static sMaxAge(t){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(t)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.sMaxAge),error}return new CacheControl(`s-maxage=${t.toSeconds()}`)}static staleWhileRevalidate(t){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(t)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.staleWhileRevalidate),error}return new CacheControl(`stale-while-revalidate=${t.toSeconds()}`)}static staleIfError(t){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(t)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.staleIfError),error}return new CacheControl(`stale-if-error=${t.toSeconds()}`)}static fromString(s){return new CacheControl(s)}constructor(value){this.value=value}}exports.CacheControl=CacheControl;class S3DeployAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.S3DeployAction",version:"2.252.0"};props;constructor(props){super({...props,resource:props.bucket,category:codepipeline().ActionCategory.DEPLOY,provider:"S3",artifactBounds:(0,common_1().deployArtifactBounds)(),inputs:[props.input]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_S3DeployActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,S3DeployAction),error}this.props=props}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}this.props.bucket.grantWrite(options.role),this.props.accessControl!==void 0&&this.props.bucket.grantPutAcl(options.role),options.bucket.grantRead(options.role),this.props.encryptionKey?.grantEncrypt(options.role);const acl=this.props.accessControl;return{configuration:{BucketName:this.props.bucket.bucketName,Extract:this.props.extract===!1?"false":"true",ObjectKey:this.props.objectKey,CannedACL:acl?(0,case_1().kebab)(acl.toString()):void 0,CacheControl:this.props.cacheControl&&this.props.cacheControl.map(ac=>ac.value).join(", "),KMSEncryptionKeyARN:this.props.encryptionKey?.keyArn}}}}exports.S3DeployAction=S3DeployAction;

View File

@@ -0,0 +1,80 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type * as s3 from '../../../aws-s3';
import { Action } from '../action';
/**
* How should the S3 Action detect changes.
* This is the type of the `S3SourceAction.trigger` property.
*/
export declare enum S3Trigger {
/**
* The Action will never detect changes -
* the Pipeline it's part of will only begin a run when explicitly started.
*/
NONE = "None",
/**
* CodePipeline will poll S3 to detect changes.
* This is the default method of detecting changes.
*/
POLL = "Poll",
/**
* CodePipeline will use CloudWatch Events to be notified of changes.
* Note that the Bucket that the Action uses needs to be part of a CloudTrail Trail
* for the events to be delivered.
*/
EVENTS = "Events"
}
/**
* The CodePipeline variables emitted by the S3 source Action.
*/
export interface S3SourceVariables {
/** The identifier of the S3 version of the object that triggered the build. */
readonly versionId: string;
/** The e-tag of the S3 version of the object that triggered the build. */
readonly eTag: string;
}
/**
* Construction properties of the `S3SourceAction S3 source Action`.
*/
export interface S3SourceActionProps extends codepipeline.CommonAwsActionProps {
/**
*
*/
readonly output: codepipeline.Artifact;
/**
* The key within the S3 bucket that stores the source code.
*
* @example 'path/to/file.zip'
*/
readonly bucketKey: string;
/**
* How should CodePipeline detect source changes for this Action.
* Note that if this is S3Trigger.EVENTS, you need to make sure to include the source Bucket in a CloudTrail Trail,
* as otherwise the CloudWatch Events will not be emitted.
*
* @default S3Trigger.POLL
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/log-s3-data-events.html
*/
readonly trigger?: S3Trigger;
/**
* The Amazon S3 bucket that stores the source code.
*
* If you import an encrypted bucket in your stack, please specify
* the encryption key at import time by using `Bucket.fromBucketAttributes()` method.
*/
readonly bucket: s3.IBucket;
}
/**
* Source that is provided by a specific Amazon S3 object.
*
* Will trigger the pipeline as soon as the S3 object changes, but only if there is
* a CloudTrail Trail in the account that captures the S3 event.
*/
export declare class S3SourceAction extends Action {
private readonly props;
constructor(props: S3SourceActionProps);
/** The variables emitted by this action. */
get variables(): S3SourceVariables;
protected bound(_scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
private generateEventId;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.S3SourceAction=exports.S3Trigger=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},targets=()=>{var tmp=require("../../../aws-events-targets");return targets=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp},S3Trigger;(function(S3Trigger2){S3Trigger2.NONE="None",S3Trigger2.POLL="Poll",S3Trigger2.EVENTS="Events"})(S3Trigger||(exports.S3Trigger=S3Trigger={}));class S3SourceAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.S3SourceAction",version:"2.252.0"};props;constructor(props){super({...props,resource:props.bucket,category:codepipeline().ActionCategory.SOURCE,provider:"S3",artifactBounds:(0,common_1().sourceArtifactBounds)(),outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_S3SourceActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,S3SourceAction),error}if(props.bucketKey.length===0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`PropertyBucketkeyCannotEmpty`,"Property bucketKey cannot be an empty string");this.props=props}get variables(){return{versionId:this.variableExpression("VersionId"),eTag:this.variableExpression("ETag")}}bound(_scope,stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}if(this.props.trigger===S3Trigger.EVENTS){const id=this.generateEventId(stage);this.props.bucket.onCloudTrailWriteObject(id,{target:new(targets()).CodePipeline(stage.pipeline),paths:[this.props.bucketKey],crossStackScope:stage.pipeline})}return this.props.bucket.grantRead(options.role,this.props.bucketKey),options.bucket.grantWrite(options.role),{configuration:{S3Bucket:this.props.bucket.bucketName,S3ObjectKey:this.props.bucketKey,PollForSourceChanges:this.props.trigger&&this.props.trigger===S3Trigger.POLL}}}generateEventId(stage){let ret;const baseId=core_1().Names.nodeUniqueId(stage.pipeline.node)+"SourceEventRule";if(core_1().Token.isUnresolved(this.props.bucketKey)){let candidate=baseId,counter=0;for(;this.props.bucket.node.tryFindChild(candidate)!==void 0;)counter+=1,candidate=baseId+counter;ret=candidate}else if(ret=baseId+this.props.bucketKey,this.props.bucket.node.tryFindChild(ret))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`SourceActionPathAlready`,`S3 source action with path '${this.props.bucketKey}' is already present in the pipeline for this source bucket`);return ret}}exports.S3SourceAction=S3SourceAction;

View File

@@ -0,0 +1,39 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import { Action } from '../action';
/**
* Construction properties of the `ServiceCatalogDeployActionBeta1 ServiceCatalog deploy CodePipeline Action`.
*/
export interface ServiceCatalogDeployActionBeta1Props extends codepipeline.CommonAwsActionProps {
/**
* The path to the cloudformation artifact.
*/
readonly templatePath: codepipeline.ArtifactPath;
/**
* The name of the version of the Service Catalog product to be deployed.
*/
readonly productVersionName: string;
/**
* The optional description of this version of the Service Catalog product.
* @default ''
*/
readonly productVersionDescription?: string;
/**
* The identifier of the product in the Service Catalog. This product must already exist.
*/
readonly productId: string;
}
/**
* CodePipeline action to connect to an existing ServiceCatalog product.
*
* **Note**: this class is still experimental, and may have breaking changes in the future!
*/
export declare class ServiceCatalogDeployActionBeta1 extends Action {
private readonly templatePath;
private readonly productVersionName;
private readonly productVersionDescription?;
private readonly productId;
private readonly productType;
constructor(props: ServiceCatalogDeployActionBeta1Props);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ServiceCatalogDeployActionBeta1=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class ServiceCatalogDeployActionBeta1 extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.ServiceCatalogDeployActionBeta1",version:"2.252.0"};templatePath;productVersionName;productVersionDescription;productId;productType;constructor(props){super({...props,provider:"ServiceCatalog",category:codepipeline().ActionCategory.DEPLOY,artifactBounds:{minInputs:1,maxInputs:1,minOutputs:0,maxOutputs:0},inputs:[props.templatePath.artifact]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_ServiceCatalogDeployActionBeta1Props(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ServiceCatalogDeployActionBeta1),error}this.templatePath=props.templatePath.fileName,this.productVersionName=props.productVersionName,this.productVersionDescription=props.productVersionDescription,this.productId=props.productId,this.productType="CLOUD_FORMATION_TEMPLATE"}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return options.role.addManagedPolicy(iam().ManagedPolicy.fromAwsManagedPolicyName("AWSServiceCatalogAdminFullAccess")),options.bucket.grantRead(options.role),{configuration:{TemplateFilePath:this.templatePath,ProductVersionName:this.productVersionName,ProductVersionDescription:this.productVersionDescription,ProductType:this.productType,ProductId:this.productId}}}}exports.ServiceCatalogDeployActionBeta1=ServiceCatalogDeployActionBeta1;

View File

@@ -0,0 +1,87 @@
import type { Construct } from 'constructs';
import * as codepipeline from '../../../aws-codepipeline';
import type * as stepfunction from '../../../aws-stepfunctions';
import { Action } from '../action';
/**
* Represents the input for the StateMachine.
*/
export declare class StateMachineInput {
/**
* When the input type is FilePath, input artifact and
* filepath must be specified.
*/
static filePath(inputFile: codepipeline.ArtifactPath): StateMachineInput;
/**
* When the input type is Literal, input value is passed
* directly to the state machine input.
*/
static literal(object: object): StateMachineInput;
/**
* The optional input Artifact of the Action.
* If InputType is set to FilePath, this artifact is required
* and is used to source the input for the state machine execution.
*
* @default - the Action will not have any inputs
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-StepFunctions.html#action-reference-StepFunctions-example
*/
readonly inputArtifact?: codepipeline.Artifact;
/**
* Optional StateMachine InputType
* InputType can be Literal or FilePath
*
* @default - Literal
*/
readonly inputType?: string;
/**
* When InputType is set to Literal (default), the Input field is used
* directly as the input for the state machine execution.
* Otherwise, the state machine is invoked with an empty JSON object {}.
*
* When InputType is set to FilePath, this field is required.
* An input artifact is also required when InputType is set to FilePath.
*
* @default - none
*/
readonly input: any;
private constructor();
}
/**
* Construction properties of the `StepFunctionsInvokeAction StepFunction Invoke Action`.
*/
export interface StepFunctionsInvokeActionProps extends codepipeline.CommonAwsActionProps {
/**
* The optional output Artifact of the Action.
*
* @default the Action will not have any outputs
*/
readonly output?: codepipeline.Artifact;
/**
* The state machine to invoke.
*/
readonly stateMachine: stepfunction.IStateMachine;
/**
* Represents the input to the StateMachine.
* This includes input artifact, input type and the statemachine input.
*
* @default - none
*/
readonly stateMachineInput?: StateMachineInput;
/**
* Prefix (optional)
*
* By default, the action execution ID is used as the state machine execution name.
* If a prefix is provided, it is prepended to the action execution ID with a hyphen and
* together used as the state machine execution name.
*
* @default - action execution ID
*/
readonly executionNamePrefix?: string;
}
/**
* StepFunctionInvokeAction that is provided by an AWS CodePipeline.
*/
export declare class StepFunctionInvokeAction extends Action {
private readonly props;
constructor(props: StepFunctionsInvokeActionProps);
protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StepFunctionInvokeAction=exports.StateMachineInput=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp};class StateMachineInput{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.StateMachineInput",version:"2.252.0"};static filePath(inputFile){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ArtifactPath(inputFile)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.filePath),error}return new StateMachineInput(inputFile.location,inputFile.artifact,"FilePath")}static literal(object){return new StateMachineInput(JSON.stringify(object),void 0,"Literal")}inputArtifact;inputType;input;constructor(input,inputArtifact,inputType){this.input=input,this.inputArtifact=inputArtifact,this.inputType=inputType}}exports.StateMachineInput=StateMachineInput;class StepFunctionInvokeAction extends action_1().Action{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codepipeline_actions.StepFunctionInvokeAction",version:"2.252.0"};props;constructor(props){super({...props,resource:props.stateMachine,category:codepipeline().ActionCategory.INVOKE,provider:"StepFunctions",artifactBounds:{minInputs:0,maxInputs:1,minOutputs:0,maxOutputs:1},inputs:props.stateMachineInput&&props.stateMachineInput.inputArtifact?[props.stateMachineInput.inputArtifact]:[],outputs:props.output?[props.output]:[]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_StepFunctionsInvokeActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,StepFunctionInvokeAction),error}this.props=props}bound(_scope,_stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["states:StartExecution","states:DescribeStateMachine"],resources:[this.props.stateMachine.stateMachineArn]}));const{account,region,partition,resourceName}=cdk().Stack.of(this.props.stateMachine).splitArn(this.props.stateMachine.stateMachineArn,cdk().ArnFormat.COLON_RESOURCE_NAME);return options.role.addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["states:DescribeExecution"],resources:[cdk().Stack.of(this.props.stateMachine).formatArn({account,region,partition,service:"states",resource:"execution",resourceName:`${resourceName}:${this.props.executionNamePrefix??""}*`,arnFormat:cdk().ArnFormat.COLON_RESOURCE_NAME})]})),(this.actionProperties.inputs??[]).length>0&&options.bucket.grantRead(options.role),(this.actionProperties.outputs??[]).length>0&&options.bucket.grantWrite(options.role),{configuration:{StateMachineArn:this.props.stateMachine.stateMachineArn,Input:this.props.stateMachineInput?.input,InputType:this.props.stateMachineInput?.inputType,ExecutionNamePrefix:this.props.executionNamePrefix}}}}exports.StepFunctionInvokeAction=StepFunctionInvokeAction;