Skip to content
v2.274.0

CodeDeployServerDeployAction Class ​

Example ​

ts
const pipeline = new codepipeline.Pipeline(this, 'MyPipeline', {
  pipelineName: 'MyPipeline',
});

// add the source and build Stages to the Pipeline...
const buildOutput = new codepipeline.Artifact();
declare const deploymentGroup: codedeploy.ServerDeploymentGroup;
const deployAction = new codepipeline_actions.CodeDeployServerDeployAction({
  actionName: 'CodeDeploy',
  input: buildOutput,
  deploymentGroup,
});
pipeline.addStage({
  stageName: 'Deploy',
  actions: [deployAction],
});
python
# deployment_group: codedeploy.ServerDeploymentGroup
pipeline = codepipeline.Pipeline(self, "MyPipeline",
    pipeline_name="MyPipeline"
)

# add the source and build Stages to the Pipeline...
build_output = codepipeline.Artifact()
deploy_action = codepipeline_actions.CodeDeployServerDeployAction(
    action_name="CodeDeploy",
    input=build_output,
    deployment_group=deployment_group
)
pipeline.add_stage(
    stage_name="Deploy",
    actions=[deploy_action]
)
java
ServerDeploymentGroup deploymentGroup;
Pipeline pipeline = Pipeline.Builder.create(this, "MyPipeline")
        .pipelineName("MyPipeline")
        .build();

// add the source and build Stages to the Pipeline...
Artifact buildOutput = new Artifact();
CodeDeployServerDeployAction deployAction = CodeDeployServerDeployAction.Builder.create()
        .actionName("CodeDeploy")
        .input(buildOutput)
        .deploymentGroup(deploymentGroup)
        .build();
pipeline.addStage(StageOptions.builder()
        .stageName("Deploy")
        .actions(List.of(deployAction))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
ServerDeploymentGroup deploymentGroup;
var pipeline = new Pipeline(this, "MyPipeline", new PipelineProps {
    PipelineName = "MyPipeline"
});

// add the source and build Stages to the Pipeline...
var buildOutput = new Artifact();
var deployAction = new CodeDeployServerDeployAction(new CodeDeployServerDeployActionProps {
    ActionName = "CodeDeploy",
    Input = buildOutput,
    DeploymentGroup = deploymentGroup
});
pipeline.AddStage(new StageOptions {
    StageName = "Deploy",
    Actions = new [] { deployAction }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var deploymentGroup ServerDeploymentGroup
pipeline := codepipeline.NewPipeline(this, jsii.String("MyPipeline"), &PipelineProps{
	PipelineName: jsii.String("MyPipeline"),
})

// add the source and build Stages to the Pipeline...
buildOutput := codepipeline.NewArtifact()
deployAction := codepipeline_actions.NewCodeDeployServerDeployAction(&CodeDeployServerDeployActionProps{
	ActionName: jsii.String("CodeDeploy"),
	Input: buildOutput,
	DeploymentGroup: DeploymentGroup,
})
pipeline.AddStage(&StageOptions{
	StageName: jsii.String("Deploy"),
	Actions: []IAction{
		deployAction,
	},
})

Initializer ​

ts
new CodeDeployServerDeployAction(props: CodeDeployServerDeployActionProps)
python
CodeDeployServerDeployAction(props: CodeDeployServerDeployActionProps)
java
new CodeDeployServerDeployAction(CodeDeployServerDeployActionProps props)
csharp
new CodeDeployServerDeployAction(CodeDeployServerDeployActionProps props)
go
NewCodeDeployServerDeployAction(Props CodeDeployServerDeployActionProps)

Properties ​

actionPropertiesActionPropertiesaction_propertiesActionPropertiesactionPropertiesActionPropertiesActionPropertiesActionPropertiesActionPropertiesActionPropertiesrequired#
The simple properties of the Action, like its Owner, name, etc.

Note that this accessor will be called before the bind callback.

Methods ​

bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfigdef bind(self, scope: Construct, stage: IStage, options: ActionBindOptions) -> ActionConfigpublic ActionConfig bind(Construct scope, IStage stage, ActionBindOptions options)public ActionConfig Bind(Construct scope, IStage stage, ActionBindOptions options)func Bind(Scope Construct, Stage IStage, Options ActionBindOptions) ActionConfig#
The callback invoked when this Action is added to a Pipeline.
onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Ruledef on_state_change(self, name: str, target: typing.Optional[IRuleTarget] = None, options: typing.Optional[RuleProps] = None) -> Rulepublic Rule onStateChange(String name, IRuleTarget target, RuleProps options)public Rule OnStateChange(string name, IRuleTarget? target = null, RuleProps? options = null)func OnStateChange(Name *string, Target IRuleTarget, Options RuleProps) Rule#
Creates an Event that will be triggered whenever the state of this Action changes.