• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

AWS CodeDeploy actions

|View as Markdown (English)

Use these actions to deploy application revisions, poll deployment status, advance blue/green wait points, register and inspect revisions, and configure deployment groups directly from a workflow.

重要

AWS CodeDeploy's boto3 client uses camelCase parameter names (for example, applicationName, deploymentGroupName, revision). This differs from most other AWS services that use PascalCase. Use the exact casing shown in the inputs tables below.

Prerequisites

For prerequisites and credentials setup, see Set up AWS credentials.

All CodeDeploy actions accept the same auth inputs. Use awsRoleArn (recommended) or the access key pair (awsAccessKeyId and awsSecretAccessKey). Note that awsRoleArn must be a literal ARN — secret references are not supported for this input.

ヒント

We recommend using two separate IAM roles: a read-only role for the get and list actions, and a state-changing role for createDeployment, stopDeployment, registerApplicationRevision, continueDeployment, and updateDeploymentGroup. Use the awsRoleArn input per step to switch between them in a single workflow.

Shared inputs

The following inputs apply to all CodeDeploy actions. Use awsRoleArn (recommended) or the access key pair. Note that awsRoleArn must be a literal ARN — secret references are not supported for this input.

InputTypeDescription
awsRoleArnStringIAM role ARN to assume for this call. Must be a literal ARN.
awsAccessKeyIdStringAWS access key ID. Pass as a secret.
awsSecretAccessKeyStringAWS secret access key. Pass as a secret.
awsSessionTokenStringTemporary session token for STS authentication. Pass as a secret.
selectorsListJQ selectors to extract specific fields from the action output.

IAM permissions

Each action requires a single CodeDeploy permission matching its API name. AWS provides two managed policies: AWSCodeDeployReadOnlyAccess (covers the 8 read-only actions) and AWSCodeDeployFullAccess (covers all 13). For production, use the least-privilege permissions in the following table.

Action

Required IAM permission

Additional permissions

createDeployment

codedeploy:CreateDeployment

codedeploy:GetApplicationRevision, codedeploy:GetDeploymentConfig, codedeploy:RegisterApplicationRevision. Also codedeploy:UpdateDeploymentGroup when overrideAlarmConfiguration is set.

getDeployment

codedeploy:GetDeployment

None

stopDeployment

codedeploy:StopDeployment

None

listDeployments

codedeploy:ListDeployments

None

continueDeployment

codedeploy:ContinueDeployment

None

listApplications

codedeploy:ListApplications

None

getApplication

codedeploy:GetApplication

None

listDeploymentGroups

codedeploy:ListDeploymentGroups

None

getDeploymentGroup

codedeploy:GetDeploymentGroup

None

registerApplicationRevision

codedeploy:RegisterApplicationRevision

None

listApplicationRevisions

codedeploy:ListApplicationRevisions

None

getApplicationRevision

codedeploy:GetApplicationRevision

None

updateDeploymentGroup

codedeploy:UpdateDeploymentGroup

iam:PassRole on the new service role, only when serviceRoleArn is changed

Create a deployment

Action identifier: aws.codedeploy.createDeployment

Deploys an application revision through AWS CodeDeploy. Returns the new deployment's ID immediately — this action does not wait for the deployment to finish. Use aws.codedeploy.getDeployment to poll for status.

Input

Type

Description

Example

region

String

Required. AWS region of the target application.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application. 1–100 characters.

my-codedeploy-app

deploymentGroupName

String

Optional. Name of the deployment group to deploy to.

my-deployment-group

revision

Map

Optional. The revision to deploy. One of S3, GitHub, String, or AppSpecContent revision shapes. Omit only when deploymentMode is RESTART.

{"revisionType": "S3", "s3Location": {"bucket": "my-bucket", "key": "app.zip", "bundleType": "zip"}}

deploymentConfigName

String

Optional. Deployment configuration to use. Defaults to the deployment group's own config.

CodeDeployDefault.OneAtATime

description

String

Optional. A comment about the deployment.

Automated deployment via workflow

ignoreApplicationStopFailures

Boolean

Optional. If true, a failed ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic lifecycle event does not fail the deployment.

false

autoRollbackConfiguration

Map

Optional. Auto-rollback settings for this deployment.

{"enabled": true, "events": ["DEPLOYMENT_FAILURE"]}

updateOutdatedInstancesOnly

Boolean

Optional. If true, deploys only to instances not already running the latest revision.

false

fileExistsBehavior

String

Optional. How to handle files that already exist on the instance. Allowed values: DISALLOW (default), OVERWRITE, RETAIN.

OVERWRITE

deploymentMode

String

Optional. STANDARD (default) or RESTART. When RESTART, the deployment group's last successful revision is reused and revision must not be set. Supported only for EC2/on-premises in-place deployments.

STANDARD

overrideAlarmConfiguration

Map

Optional. Overrides the deployment group's alarm configuration for this deployment only. Requires codedeploy:UpdateDeploymentGroup on the caller.

{"enabled": false}

parameters

Map

Optional. Passthrough for any CreateDeployment parameter not modeled above, using AWS camelCase names. Dedicated inputs above take precedence over matching keys here.

{"ec2DeploymentOptions": {"autoScalingGroupProcessesToSuspend": ["Terminate", "AZRebalance"]}}

For auth and selector inputs, see Prerequisites.

name: deploy-application-revision
description: Deploy a revision to a CodeDeploy deployment group
steps:
- name: deployRevision
type: action
action: aws.codedeploy.createDeployment
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
deploymentGroupName: my-deployment-group
revision:
revisionType: S3
s3Location:
bucket: my-codedeploy-bucket
key: app.zip
bundleType: zip
selectors:
- name: deploymentId
expression: ".response.deploymentId"
next: end

Get a deployment

Action identifier: aws.codedeploy.getDeployment

Returns the full details and current status of a single AWS CodeDeploy deployment by its deployment ID. Use this to poll after createDeployment until the deployment reaches a terminal status.

Input

Type

Description

Example

region

String

Required. AWS region of the target deployment.

us-east-2

deploymentId

String

Required. The CodeDeploy deployment ID.

d-ABCDEF123

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the get_deployment boto3 reference. Contains deploymentInfo with status (Created, Queued, InProgress, Baking, Succeeded, Failed, Stopped, Ready), errorInformation, timestamps, and deploymentOverview.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: poll-deployment-status
description: Check the status of a CodeDeploy deployment
steps:
- name: checkDeploymentStatus
type: action
action: aws.codedeploy.getDeployment
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
deploymentId: d-ABCDEF123
selectors:
- name: status
expression: ".response.deploymentInfo.status"
next: end

Stop a deployment

Action identifier: aws.codedeploy.stopDeployment

Attempts to stop an in-progress AWS CodeDeploy deployment. Optionally rolls back instances that were already updated before the stop.

Input

Type

Description

Example

region

String

Required. AWS region of the target deployment.

us-east-2

deploymentId

String

Required. The CodeDeploy deployment ID to stop.

d-ABCDEF123

autoRollbackEnabled

Boolean

Optional. If true, instances already updated by the stopped deployment are rolled back to the previous revision.

true

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the stop_deployment boto3 reference. Contains status (Pending, Succeeded, or Forced) and statusMessage.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: stop-failed-deployment
description: Stop a CodeDeploy deployment and roll back updated instances
steps:
- name: stopDeployment
type: action
action: aws.codedeploy.stopDeployment
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
deploymentId: d-ABCDEF123
autoRollbackEnabled: true
selectors:
- name: status
expression: ".response.status"
next: end

List deployments

Action identifier: aws.codedeploy.listDeployments

Returns AWS CodeDeploy deployment IDs for a given application and deployment group, optionally filtered by status or creation time range. The response is paginated — use nextToken from the previous response to retrieve the next page.

重要

applicationName and deploymentGroupName must be provided together or not at all. AWS rejects one without the other.

Input

Type

Description

Example

region

String

Required. AWS region to query.

us-east-2

applicationName

String

Optional. Filter by application name. Must be provided together with deploymentGroupName.

my-codedeploy-app

deploymentGroupName

String

Optional. Filter by deployment group name. Must be provided together with applicationName.

my-deployment-group

includeOnlyStatuses

List

Optional. Filter by deployment status. Allowed values: Created, Queued, InProgress, Baking, Succeeded, Failed, Stopped, Ready.

["Failed", "Stopped"]

createTimeRange

Map

Optional. Filter by creation time. Either start or end may be omitted to leave that side open-ended.

{"start": "2026-01-01T00:00:00Z", "end": "2026-01-31T23:59:59Z"}

nextToken

String

Optional. Pagination token from a previous response. Leave empty on the initial request.

some-next-token

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the list_deployments boto3 reference. Contains deployments (list of deployment ID strings) and nextToken when more pages exist. Pass each ID to getDeployment for details.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: list-failed-deployments
description: List failed CodeDeploy deployments for a deployment group
steps:
- name: listFailedDeployments
type: action
action: aws.codedeploy.listDeployments
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
deploymentGroupName: my-deployment-group
includeOnlyStatuses:
- Failed
- Stopped
selectors:
- name: deployments
expression: ".response.deployments"
next: end

Continue a deployment

Action identifier: aws.codedeploy.continueDeployment

Advances an AWS CodeDeploy blue/green deployment that is waiting at a ready point — either starting traffic rerouting (READY_WAIT) or proceeding past the termination wait (TERMINATION_WAIT). Returns an empty response on success.

Input

Type

Description

Example

region

String

Required. AWS region of the target deployment.

us-east-2

deploymentId

String

Required. The CodeDeploy deployment ID to advance.

d-ABCDEF123

deploymentWaitType

String

Optional. Which wait point to advance. READY_WAIT starts traffic rerouting; TERMINATION_WAIT proceeds without immediately terminating the original target.

READY_WAIT

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the continue_deployment boto3 reference. Returns an empty object on success.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: advance-blue-green-deployment
description: Start traffic rerouting on a blue/green deployment at its ready wait point
steps:
- name: continueDeployment
type: action
action: aws.codedeploy.continueDeployment
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
deploymentId: d-ABCDEF123
deploymentWaitType: READY_WAIT
next: end

List applications

Action identifier: aws.codedeploy.listApplications

Returns the AWS CodeDeploy application names registered in the given account and region. The response is paginated — use nextToken from the previous response to retrieve the next page.

Input

Type

Description

Example

region

String

Required. AWS region to query.

us-east-2

nextToken

String

Optional. Pagination token from a previous response. Leave empty on the initial request.

some-next-token

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the list_applications boto3 reference. Contains applications (list of application name strings) and nextToken when more pages exist.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: list-codedeploy-applications
description: List all CodeDeploy applications in a region
steps:
- name: listApplications
type: action
action: aws.codedeploy.listApplications
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
selectors:
- name: applications
expression: ".response.applications"
next: end

Get an application

Action identifier: aws.codedeploy.getApplication

Returns information about a single AWS CodeDeploy application by name, including its compute platform.

Input

Type

Description

Example

region

String

Required. AWS region of the application.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application.

my-codedeploy-app

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the get_application boto3 reference. Contains application with applicationId, applicationName, createTime, linkedToGitHub, gitHubAccountName, and computePlatform (Server, Lambda, or ECS).

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: get-codedeploy-application
description: Get the compute platform of a CodeDeploy application
steps:
- name: getApplication
type: action
action: aws.codedeploy.getApplication
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
selectors:
- name: computePlatform
expression: ".response.application.computePlatform"
next: end

List deployment groups

Action identifier: aws.codedeploy.listDeploymentGroups

Returns the deployment group names for a single AWS CodeDeploy application. The response is paginated — use nextToken from the previous response to retrieve the next page.

Input

Type

Description

Example

region

String

Required. AWS region of the application.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application.

my-codedeploy-app

nextToken

String

Optional. Pagination token from a previous response. Leave empty on the initial request.

some-next-token

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the list_deployment_groups boto3 reference. Contains applicationName, deploymentGroups (list of group name strings), and nextToken when more pages exist.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: list-deployment-groups
description: List all deployment groups for a CodeDeploy application
steps:
- name: listDeploymentGroups
type: action
action: aws.codedeploy.listDeploymentGroups
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
selectors:
- name: deploymentGroups
expression: ".response.deploymentGroups"
next: end

Get a deployment group

Action identifier: aws.codedeploy.getDeploymentGroup

Returns the full configuration of a single AWS CodeDeploy deployment group, including its deployment config, tag filters, alarms, auto-rollback settings, and blue/green configuration.

Input

Type

Description

Example

region

String

Required. AWS region of the deployment group.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application.

my-codedeploy-app

deploymentGroupName

String

Required. Name of the deployment group.

my-deployment-group

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the get_deployment_group boto3 reference. Contains deploymentGroupInfo with deploymentConfigName, ec2TagFilters, autoScalingGroups, serviceRoleArn, alarmConfiguration, autoRollbackConfiguration, deploymentStyle, blueGreenDeploymentConfiguration, and more.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: get-deployment-group-config
description: Get the configuration of a CodeDeploy deployment group
steps:
- name: getDeploymentGroup
type: action
action: aws.codedeploy.getDeploymentGroup
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
deploymentGroupName: my-deployment-group
selectors:
- name: deploymentConfigName
expression: ".response.deploymentGroupInfo.deploymentConfigName"
next: end

Register an application revision

Action identifier: aws.codedeploy.registerApplicationRevision

Registers an application revision with AWS CodeDeploy, making it available for future deployments without starting one. Returns an empty response on success.

Input

Type

Description

Example

region

String

Required. AWS region of the application.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application to register the revision with.

my-codedeploy-app

revision

Map

Required. The revision to register. One of S3, GitHub, String, or AppSpecContent revision shapes.

{"revisionType": "S3", "s3Location": {"bucket": "my-bucket", "key": "app.zip", "bundleType": "zip"}}

description

String

Optional. A comment about the revision.

Release candidate 1.2.3

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the register_application_revision boto3 reference. Returns an empty object on success — AWS returns no response body for this operation.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: register-application-revision
description: Register a new S3 revision with CodeDeploy
steps:
- name: registerRevision
type: action
action: aws.codedeploy.registerApplicationRevision
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
revision:
revisionType: S3
s3Location:
bucket: my-codedeploy-bucket
key: app.zip
bundleType: zip
description: Release candidate 1.2.3
next: end

List application revisions

Action identifier: aws.codedeploy.listApplicationRevisions

Returns the application revisions registered with AWS CodeDeploy for a single application, with optional sort and filter. The response is paginated — use nextToken from the previous response to retrieve the next page.

Input

Type

Description

Example

region

String

Required. AWS region of the application.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application.

my-codedeploy-app

sortBy

String

Optional. Sort field. Allowed values: registerTime, firstUsedTime, lastUsedTime. Omit for arbitrary order.

registerTime

sortOrder

String

Optional. Sort direction. Allowed values: ascending (default), descending.

descending

s3Bucket

String

Optional. Limit results to revisions in this S3 bucket. Omit to search all buckets.

my-codedeploy-bucket

s3KeyPrefix

String

Optional. Limit results to revisions with this S3 key prefix.

builds/

deployed

String

Optional. Filter by whether the revision is currently deployed. Allowed values: include (only current deployment-group targets), exclude, ignore (default — all revisions).

include

nextToken

String

Optional. Pagination token from a previous response. Leave empty on the initial request.

some-next-token

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the list_application_revisions boto3 reference. Contains revisions (list of revision-location objects with revisionType and the matching location fields) and nextToken when more pages exist.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: list-application-revisions
description: List the most recently registered CodeDeploy revisions
steps:
- name: listRevisions
type: action
action: aws.codedeploy.listApplicationRevisions
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
sortBy: registerTime
sortOrder: descending
selectors:
- name: revisions
expression: ".response.revisions"
next: end

Get an application revision

Action identifier: aws.codedeploy.getApplicationRevision

Returns information about a single application revision already registered with AWS CodeDeploy, identified by application name and revision location.

Input

Type

Description

Example

region

String

Required. AWS region of the application.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application.

my-codedeploy-app

revision

Map

Required. The revision location to look up. One of S3, GitHub, String, or AppSpecContent revision shapes.

{"revisionType": "S3", "s3Location": {"bucket": "my-bucket", "key": "app.zip", "bundleType": "zip"}}

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the get_application_revision boto3 reference. Contains applicationName, revision (the full revision-location object), and revisionInfo with description, deploymentGroups, firstUsedTime, lastUsedTime, and registerTime.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: get-application-revision
description: Get details of a registered CodeDeploy revision
steps:
- name: getRevision
type: action
action: aws.codedeploy.getApplicationRevision
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
revision:
revisionType: S3
s3Location:
bucket: my-codedeploy-bucket
key: app.zip
bundleType: zip
selectors:
- name: revisionInfo
expression: ".response.revisionInfo"
next: end

Update a deployment group

Action identifier: aws.codedeploy.updateDeploymentGroup

Changes the configuration of an existing AWS CodeDeploy deployment group — rename it, or adjust its deployment config, tag targeting, alarms, auto-rollback settings, blue/green configuration, or load balancer info. Only inputs you provide are changed; omitting an input leaves that setting unchanged.

Input

Type

Description

Example

region

String

Required. AWS region of the deployment group.

us-east-2

applicationName

String

Required. Name of the CodeDeploy application.

my-codedeploy-app

currentDeploymentGroupName

String

Required. Current name of the deployment group to update.

my-deployment-group

newDeploymentGroupName

String

Optional. Renames the deployment group when provided.

my-deployment-group-v2

deploymentConfigName

String

Optional. New deployment configuration name.

CodeDeployDefault.AllAtOnce

autoRollbackConfiguration

Map

Optional. Auto-rollback settings. Replaces the existing configuration entirely.

{"enabled": true, "events": ["DEPLOYMENT_FAILURE"]}

alarmConfiguration

Map

Optional. CloudWatch alarm configuration. Replaces the existing configuration entirely.

{"enabled": true, "alarms": [{"name": "my-cloudwatch-alarm"}]}

serviceRoleArn

String

Optional. New IAM role ARN for CodeDeploy to assume. Requires iam:PassRole on the new role.

arn:aws:iam::123456789012:role/CodeDeployServiceRole

ec2TagFilters

List

Optional. Replaces the group's EC2 tag filters entirely. Re-supply existing filters to keep them, or pass an empty list to remove all.

[{"Key": "env", "Value": "prod", "Type": "KEY_AND_VALUE"}]

autoScalingGroups

List

Optional. Replaces the list of Auto Scaling groups associated with this deployment group.

["my-asg"]

deploymentStyle

Map

Optional. Deployment type and traffic control option.

{"deploymentType": "BLUE_GREEN", "deploymentOption": "WITH_TRAFFIC_CONTROL"}

blueGreenDeploymentConfiguration

Map

Optional. Blue/green deployment configuration including termination and traffic rerouting settings.

{"terminateBlueInstancesOnDeploymentSuccess": {"action": "TERMINATE", "terminationWaitTimeInMinutes": 5}, "deploymentReadyOption": {"actionOnTimeout": "STOP_DEPLOYMENT", "waitTimeInMinutes": 10}}

loadBalancerInfo

Map

Optional. Load balancer configuration for traffic shifting.

{"targetGroupInfoList": [{"name": "my-target-group"}]}

parameters

Map

Optional. Passthrough for any UpdateDeploymentGroup parameter not modeled above, using AWS camelCase names. Dedicated inputs above take precedence over matching keys here.

{"ec2DeploymentOptions": {"autoScalingGroupProcessesToSuspend": ["Terminate", "AZRebalance"]}}

For auth and selector inputs, see Prerequisites.

Output

Type

Example

response

Object

See the update_deployment_group boto3 reference. Contains hooksNotCleanedUp — non-empty only when disabling a termination hook left orphaned lifecycle hooks.

success

Boolean

true or false

errorMessage

String

Error message on failure.

name: enable-auto-rollback
description: Enable auto-rollback on a CodeDeploy deployment group
steps:
- name: updateDeploymentGroup
type: action
action: aws.codedeploy.updateDeploymentGroup
version: '1'
inputs:
awsRoleArn: arn:aws:iam::123456789012:role/my-workflow-role
region: us-east-2
applicationName: my-codedeploy-app
currentDeploymentGroupName: my-deployment-group
autoRollbackConfiguration:
enabled: true
events:
- DEPLOYMENT_FAILURE
next: end
Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.