Skip to content
v2.273.0

CodeDeployEcsDeployAction Class ​

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codedeploy as codedeploy } from 'aws-cdk-lib';
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';
import { aws_codepipeline_actions as codepipeline_actions } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const artifact: codepipeline.Artifact;
declare const artifactPath: codepipeline.ArtifactPath;
declare const ecsDeploymentGroup: codedeploy.EcsDeploymentGroup;
declare const role: iam.Role;
const codeDeployEcsDeployAction = new codepipeline_actions.CodeDeployEcsDeployAction({
  actionName: 'actionName',
  deploymentGroup: ecsDeploymentGroup,

  // the properties below are optional
  appSpecTemplateFile: artifactPath,
  appSpecTemplateInput: artifact,
  containerImageInputs: [{
    input: artifact,

    // the properties below are optional
    taskDefinitionPlaceholder: 'taskDefinitionPlaceholder',
  }],
  role: role,
  runOrder: 123,
  taskDefinitionTemplateFile: artifactPath,
  taskDefinitionTemplateInput: artifact,
  variablesNamespace: 'variablesNamespace',
});
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codedeploy as codedeploy
from aws_cdk import aws_codepipeline as codepipeline
from aws_cdk import aws_codepipeline_actions as codepipeline_actions
from aws_cdk import aws_iam as iam

# artifact: codepipeline.Artifact
# artifact_path: codepipeline.ArtifactPath
# ecs_deployment_group: codedeploy.EcsDeploymentGroup
# role: iam.Role

code_deploy_ecs_deploy_action = codepipeline_actions.CodeDeployEcsDeployAction(
    action_name="actionName",
    deployment_group=ecs_deployment_group,

    # the properties below are optional
    app_spec_template_file=artifact_path,
    app_spec_template_input=artifact,
    container_image_inputs=[codepipeline_actions.CodeDeployEcsContainerImageInput(
        input=artifact,

        # the properties below are optional
        task_definition_placeholder="taskDefinitionPlaceholder"
    )],
    role=role,
    run_order=123,
    task_definition_template_file=artifact_path,
    task_definition_template_input=artifact,
    variables_namespace="variablesNamespace"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codedeploy.*;
import software.amazon.awscdk.services.codepipeline.*;
import software.amazon.awscdk.services.codepipeline.actions.*;
import software.amazon.awscdk.services.iam.*;

Artifact artifact;
ArtifactPath artifactPath;
EcsDeploymentGroup ecsDeploymentGroup;
Role role;

CodeDeployEcsDeployAction codeDeployEcsDeployAction = CodeDeployEcsDeployAction.Builder.create()
        .actionName("actionName")
        .deploymentGroup(ecsDeploymentGroup)

        // the properties below are optional
        .appSpecTemplateFile(artifactPath)
        .appSpecTemplateInput(artifact)
        .containerImageInputs(List.of(CodeDeployEcsContainerImageInput.builder()
                .input(artifact)

                // the properties below are optional
                .taskDefinitionPlaceholder("taskDefinitionPlaceholder")
                .build()))
        .role(role)
        .runOrder(123)
        .taskDefinitionTemplateFile(artifactPath)
        .taskDefinitionTemplateInput(artifact)
        .variablesNamespace("variablesNamespace")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeDeploy;
using Amazon.CDK.AWS.CodePipeline;
using Amazon.CDK.AWS.CodePipeline.Actions;
using Amazon.CDK.AWS.IAM;

Artifact artifact;
ArtifactPath artifactPath;
EcsDeploymentGroup ecsDeploymentGroup;
Role role;

var codeDeployEcsDeployAction = new CodeDeployEcsDeployAction(new CodeDeployEcsDeployActionProps {
    ActionName = "actionName",
    DeploymentGroup = ecsDeploymentGroup,

    // the properties below are optional
    AppSpecTemplateFile = artifactPath,
    AppSpecTemplateInput = artifact,
    ContainerImageInputs = new [] { new CodeDeployEcsContainerImageInput {
        Input = artifact,

        // the properties below are optional
        TaskDefinitionPlaceholder = "taskDefinitionPlaceholder"
    } },
    Role = role,
    RunOrder = 123,
    TaskDefinitionTemplateFile = artifactPath,
    TaskDefinitionTemplateInput = artifact,
    VariablesNamespace = "variablesNamespace"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var artifact Artifact
var artifactPath ArtifactPath
var ecsDeploymentGroup EcsDeploymentGroup
var role Role

codeDeployEcsDeployAction := awscdk.Aws_codepipeline_actions.NewCodeDeployEcsDeployAction(&CodeDeployEcsDeployActionProps{
	ActionName: jsii.String("actionName"),
	DeploymentGroup: ecsDeploymentGroup,

	// the properties below are optional
	AppSpecTemplateFile: artifactPath,
	AppSpecTemplateInput: artifact,
	ContainerImageInputs: []CodeDeployEcsContainerImageInput{
		&CodeDeployEcsContainerImageInput{
			Input: artifact,

			// the properties below are optional
			TaskDefinitionPlaceholder: jsii.String("taskDefinitionPlaceholder"),
		},
	},
	Role: role,
	RunOrder: jsii.Number(123),
	TaskDefinitionTemplateFile: artifactPath,
	TaskDefinitionTemplateInput: artifact,
	VariablesNamespace: jsii.String("variablesNamespace"),
})

Initializer ​

ts
new CodeDeployEcsDeployAction(props: CodeDeployEcsDeployActionProps)
python
CodeDeployEcsDeployAction(props: CodeDeployEcsDeployActionProps)
java
new CodeDeployEcsDeployAction(CodeDeployEcsDeployActionProps props)
csharp
new CodeDeployEcsDeployAction(CodeDeployEcsDeployActionProps props)
go
NewCodeDeployEcsDeployAction(Props CodeDeployEcsDeployActionProps)

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.