131 lines
4.4 KiB
TypeScript
131 lines
4.4 KiB
TypeScript
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;
|
|
}
|