Class Ec2DeployActionProps
Construction properties of Ec2DeployAction
.
Inherited Members
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Ec2DeployActionProps : IEc2DeployActionProps, ICommonAwsActionProps, ICommonActionProps
Syntax (vb)
Public Class Ec2DeployActionProps Implements IEc2DeployActionProps, ICommonAwsActionProps, ICommonActionProps
Remarks
ExampleMetadata: infused
Examples
var sourceOutput = new Artifact();
var pipeline = new Pipeline(this, "MyPipeline", new PipelineProps {
PipelineType = PipelineType.V2
});
var deployAction = new Ec2DeployAction(new Ec2DeployActionProps {
ActionName = "Ec2Deploy",
Input = sourceOutput,
InstanceType = Ec2InstanceType.EC2,
InstanceTagKey = "Name",
InstanceTagValue = "MyInstance",
DeploySpecifications = Ec2DeploySpecifications.Inline(new Ec2DeploySpecificationsInlineProps {
TargetDirectory = "/home/ec2-user/deploy",
PreScript = "scripts/pre-deploy.sh",
PostScript = "scripts/post-deploy.sh"
})
});
var deployStage = pipeline.AddStage(new StageOptions {
StageName = "Deploy",
Actions = new [] { deployAction }
});
Synopsis
Constructors
Ec2DeployActionProps() | Construction properties of |
Properties
ActionName | The physical, human-readable name of the Action. |
DeploySpecifications | The deploy specifications. |
Input | The input artifact to deploy to EC2 instances. |
InstanceTagKey | The tag key of the instances that you created in Amazon EC2. |
InstanceTagValue | The tag value of the instances that you created in Amazon EC2. |
InstanceType | The type of instances or SSM nodes created in Amazon EC2. |
MaxBatch | The number or percentage of instances that can deploy in parallel. |
MaxError | Stop the task after the task fails on the specified number or percentage of instances. |
Role | The Role in which context's this Action will be executing in. |
RunOrder | The runOrder property for this Action. |
TargetGroups | The list of target groups for deployment. You must have already created the target groups. |
VariablesNamespace | The name of the namespace to use for variables emitted by this action. |
Constructors
Ec2DeployActionProps()
Construction properties of Ec2DeployAction
.
public Ec2DeployActionProps()
Remarks
ExampleMetadata: infused
Examples
var sourceOutput = new Artifact();
var pipeline = new Pipeline(this, "MyPipeline", new PipelineProps {
PipelineType = PipelineType.V2
});
var deployAction = new Ec2DeployAction(new Ec2DeployActionProps {
ActionName = "Ec2Deploy",
Input = sourceOutput,
InstanceType = Ec2InstanceType.EC2,
InstanceTagKey = "Name",
InstanceTagValue = "MyInstance",
DeploySpecifications = Ec2DeploySpecifications.Inline(new Ec2DeploySpecificationsInlineProps {
TargetDirectory = "/home/ec2-user/deploy",
PreScript = "scripts/pre-deploy.sh",
PostScript = "scripts/post-deploy.sh"
})
});
var deployStage = pipeline.AddStage(new StageOptions {
StageName = "Deploy",
Actions = new [] { deployAction }
});
Properties
ActionName
The physical, human-readable name of the Action.
public string ActionName { get; set; }
Property Value
Remarks
Note that Action names must be unique within a single Stage.
DeploySpecifications
The deploy specifications.
public Ec2DeploySpecifications DeploySpecifications { get; set; }
Property Value
Remarks
ExampleMetadata: infused
Input
The input artifact to deploy to EC2 instances.
public Artifact_ Input { get; set; }
Property Value
Remarks
ExampleMetadata: infused
InstanceTagKey
The tag key of the instances that you created in Amazon EC2.
public string InstanceTagKey { get; set; }
Property Value
Remarks
ExampleMetadata: infused
InstanceTagValue
The tag value of the instances that you created in Amazon EC2.
public string? InstanceTagValue { get; set; }
Property Value
Remarks
Default: - all instances with instanceTagKey
will be matched
InstanceType
The type of instances or SSM nodes created in Amazon EC2.
public Ec2InstanceType InstanceType { get; set; }
Property Value
Remarks
You must have already created, tagged, and installed the SSM agent on all instances.
MaxBatch
The number or percentage of instances that can deploy in parallel.
public Ec2MaxInstances? MaxBatch { get; set; }
Property Value
Remarks
Default: - No configuration
MaxError
Stop the task after the task fails on the specified number or percentage of instances.
public Ec2MaxInstances? MaxError { get; set; }
Property Value
Remarks
Default: - No configuration
Role
The Role in which context's this Action will be executing in.
public IRole? Role { get; set; }
Property Value
Remarks
The Pipeline's Role will assume this Role
(the required permissions for that will be granted automatically)
right before executing this Action.
This Action will be passed into your IAction.bind
method in the ActionBindOptions.role
property.
Default: a new Role will be generated
RunOrder
The runOrder property for this Action.
public double? RunOrder { get; set; }
Property Value
Remarks
RunOrder determines the relative order in which multiple Actions in the same Stage execute.
Default: 1
TargetGroups
The list of target groups for deployment. You must have already created the target groups.
public ITargetGroup[]? TargetGroups { get; set; }
Property Value
Remarks
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
VariablesNamespace
The name of the namespace to use for variables emitted by this action.
public string? VariablesNamespace { get; set; }
Property Value
Remarks
Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set