# CodeDeployEcsDeployAction

Extends: [Action](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Action.html) › [Action](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.Action.html) › CodeDeployEcsDeployAction
Implements: [IAction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.IAction.html)

- Source: [`aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.ts#L111)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"
});
```

Golang:

```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

TypeScript:

```ts
new CodeDeployEcsDeployAction(props: CodeDeployEcsDeployActionProps)
```

Python:

```python
CodeDeployEcsDeployAction(props: CodeDeployEcsDeployActionProps)
```

Java:

```java
new CodeDeployEcsDeployAction(CodeDeployEcsDeployActionProps props)
```

C# / .NET:

```csharp
new CodeDeployEcsDeployAction(CodeDeployEcsDeployActionProps props)
```

Golang:

```go
NewCodeDeployEcsDeployAction(Props CodeDeployEcsDeployActionProps)
```

## Properties

- `actionProperties`: [ActionProperties](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.ActionProperties.html) — 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): ActionConfig` — The callback invoked when this Action is added to a Pipeline.

- `onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Rule` — Creates an Event that will be triggered whenever the state of this Action changes.
