deployments
Creates, updates, deletes, gets or lists a deployments resource.
Overview
| Name | deployments |
| Type | Resource |
| Id | aws.codedeploy.deployments |
Fields
The following fields are returned by SELECT queries:
- batch_get_deployments
- get_deployment
- list_deployments
| Name | Datatype | Description |
|---|---|---|
deployments_info | array | Information about the deployments. |
| Name | Datatype | Description |
|---|---|---|
additional_deployment_status_info | string | Provides information about the results of a deployment, such as whether instances in the original environment in a blue/green deployment were not terminated. |
application_name | string | The application name. |
auto_rollback_configuration | object | Information about the automatic rollback configuration associated with the deployment. |
blue_green_deployment_configuration | object | Information about blue/green deployment options for this deployment. |
complete_time | string (date-time) | A timestamp that indicates when the deployment was complete. |
compute_platform | string | The destination platform type for the deployment (Lambda, Server, or ECS). (Server, Lambda, ECS) |
create_time | string (date-time) | A timestamp that indicates when the deployment was created. |
creator | string | The means by which the deployment was created: user: A user created the deployment. autoscaling: Amazon EC2 Auto Scaling created the deployment. codeDeployRollback: A rollback process created the deployment. CodeDeployAutoUpdate: An auto-update process created the deployment when it detected outdated Amazon EC2 instances. (user, autoscaling, codeDeployRollback, CodeDeploy, CodeDeployAutoUpdate, CloudFormation, CloudFormationRollback, autoscalingTermination) |
deployment_config_name | string | The deployment configuration name. |
deployment_group_name | string | The deployment group name. |
deployment_id | string | The unique ID of a deployment. |
deployment_overview | object | A summary of the deployment status of the instances in the deployment. |
deployment_status_messages | array | Messages that contain information about the status of a deployment. |
deployment_style | object | Information about the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer. |
description | string | A comment about the deployment. |
error_information | object | Information about any error associated with this deployment. |
external_id | string | The unique ID for an external resource (for example, a CloudFormation stack ID) that is linked to this deployment. |
file_exists_behavior | string | Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment. DISALLOW: The deployment fails. This is also the default behavior if no option is specified. OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance. RETAIN: The version of the file already on the instance is kept and used as part of the new deployment. (DISALLOW, OVERWRITE, RETAIN) |
ignore_application_stop_failures | boolean | If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if ApplicationStop fails, the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, the deployment continues with BlockTraffic. If AfterBlockTraffic fails, the deployment continues with ApplicationStop. If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted. During a deployment, the CodeDeploy agent runs the scripts specified for ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail. If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use ignoreApplicationStopFailures to specify that the ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic failures should be ignored. |
instance_termination_wait_time_started | boolean | Indicates whether the wait period set for the termination of instances in the original environment has started. Status is 'false' if the KEEP_ALIVE option is specified. Otherwise, 'true' as soon as the termination wait period starts. |
load_balancer_info | object | Information about the load balancer used in the deployment. |
override_alarm_configuration | object | Information about alarms associated with a deployment or deployment group. |
previous_revision | object | Information about the location of an application revision. |
related_deployments | object | Information about deployments related to the specified deployment. |
revision | object | Information about the location of an application revision. |
rollback_info | object | Information about a deployment rollback. |
start_time | string (date-time) | A timestamp that indicates when the deployment was deployed to the deployment group. In some cases, the reported value of the start time might be later than the complete time. This is due to differences in the clock settings of backend servers that participate in the deployment process. |
status | string | The current state of the deployment as a whole. (Created, Queued, InProgress, Baking, Succeeded, Failed, Stopped, Ready) |
target_instances | object | Information about the instances that belong to the replacement environment in a blue/green deployment. |
update_outdated_instances_only | boolean | Indicates whether only instances that are not running the latest application revision are to be deployed to. |
| Name | Datatype | Description |
|---|---|---|
deployment | string | A list of deployment IDs. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_deployments | select | region | Gets information about one or more deployments. The maximum number of deployments that can be returned is 25. | |
get_deployment | select | region | Gets information about a deployment. The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256 property of the returned appSpecContent object to get the content of the deployment’s AppSpec file. | |
list_deployments | select | region | Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account. | |
create_deployment | insert | region, applicationName | Deploys an application revision through the specified deployment group. | |
stop_deployment | exec | region, deploymentId | Attempts to stop an ongoing deployment. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- batch_get_deployments
- get_deployment
- list_deployments
Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.
SELECT
deployments_info
FROM aws.codedeploy.deployments
WHERE region = '{{ region }}' -- required
;
Gets information about a deployment. The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256 property of the returned appSpecContent object to get the content of the deployment’s AppSpec file.
SELECT
additional_deployment_status_info,
application_name,
auto_rollback_configuration,
blue_green_deployment_configuration,
complete_time,
compute_platform,
create_time,
creator,
deployment_config_name,
deployment_group_name,
deployment_id,
deployment_overview,
deployment_status_messages,
deployment_style,
description,
error_information,
external_id,
file_exists_behavior,
ignore_application_stop_failures,
instance_termination_wait_time_started,
load_balancer_info,
override_alarm_configuration,
previous_revision,
related_deployments,
revision,
rollback_info,
start_time,
status,
target_instances,
update_outdated_instances_only
FROM aws.codedeploy.deployments
WHERE region = '{{ region }}' -- required
;
Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.
SELECT
deployment
FROM aws.codedeploy.deployments
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_deployment
- Manifest
Deploys an application revision through the specified deployment group.
INSERT INTO aws.codedeploy.deployments (
applicationName,
deploymentGroupName,
revision,
deploymentConfigName,
description,
ignoreApplicationStopFailures,
targetInstances,
autoRollbackConfiguration,
updateOutdatedInstancesOnly,
fileExistsBehavior,
overrideAlarmConfiguration,
region
)
SELECT
'{{ applicationName }}' /* required */,
'{{ deploymentGroupName }}',
'{{ revision }}',
'{{ deploymentConfigName }}',
'{{ description }}',
{{ ignoreApplicationStopFailures }},
'{{ targetInstances }}',
'{{ autoRollbackConfiguration }}',
{{ updateOutdatedInstancesOnly }},
'{{ fileExistsBehavior }}',
'{{ overrideAlarmConfiguration }}',
'{{ region }}'
RETURNING
deployment_id
;
# Description fields are for documentation purposes
- name: deployments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the deployments resource.
- name: applicationName
value: "{{ applicationName }}"
description: |
The name of an CodeDeploy application associated with the user or Amazon Web Services account.
- name: deploymentGroupName
value: "{{ deploymentGroupName }}"
description: |
The name of the deployment group.
- name: revision
description: |
Information about the location of an application revision.
value:
revisionType: "{{ revisionType }}"
s3Location:
bucket: "{{ bucket }}"
key: "{{ key }}"
bundleType: "{{ bundleType }}"
version: "{{ version }}"
eTag: "{{ eTag }}"
gitHubLocation:
repository: "{{ repository }}"
commitId: "{{ commitId }}"
string:
content: "{{ content }}"
sha256: "{{ sha256 }}"
appSpecContent:
content: "{{ content }}"
sha256: "{{ sha256 }}"
- name: deploymentConfigName
value: "{{ deploymentConfigName }}"
description: |
The name of a deployment configuration associated with the user or Amazon Web Services account. If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, CodeDeployDefault.OneAtATime is used by default.
- name: description
value: "{{ description }}"
description: |
A comment about the deployment.
- name: ignoreApplicationStopFailures
value: {{ ignoreApplicationStopFailures }}
description: |
If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if ApplicationStop fails, the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, the deployment continues with BlockTraffic. If AfterBlockTraffic fails, the deployment continues with ApplicationStop. If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted. During a deployment, the CodeDeploy agent runs the scripts specified for ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail. If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use ignoreApplicationStopFailures to specify that the ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic failures should be ignored.
- name: targetInstances
description: |
Information about the instances that belong to the replacement environment in a blue/green deployment.
value:
tagFilters:
- Key: "{{ Key }}"
Value: "{{ Value }}"
Type: "{{ Type }}"
autoScalingGroups:
- "{{ autoScalingGroups }}"
ec2TagSet:
ec2TagSetList:
- "{{ ec2TagSetList }}"
- name: autoRollbackConfiguration
description: |
Configuration information for an automatic rollback that is added when a deployment is created.
value:
enabled: {{ enabled }}
events:
- "{{ events }}"
- name: updateOutdatedInstancesOnly
value: {{ updateOutdatedInstancesOnly }}
description: |
Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.
- name: fileExistsBehavior
value: "{{ fileExistsBehavior }}"
description: |
Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment. The fileExistsBehavior parameter takes any of the following values: DISALLOW: The deployment fails. This is also the default behavior if no option is specified. OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance. RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
valid_values: ['DISALLOW', 'OVERWRITE', 'RETAIN']
- name: overrideAlarmConfiguration
description: |
Information about alarms associated with a deployment or deployment group.
value:
enabled: {{ enabled }}
ignorePollAlarmFailure: {{ ignorePollAlarmFailure }}
alarms:
- name: "{{ name }}"
Lifecycle Methods
- stop_deployment
Attempts to stop an ongoing deployment.
EXEC aws.codedeploy.deployments.stop_deployment
@region='{{ region }}' --required
@@json=
'{
"deploymentId": "{{ deploymentId }}",
"autoRollbackEnabled": {{ autoRollbackEnabled }}
}'
;