Skip to content

aws.codedeploy.get_deployment_target

Example SQL Queries

SELECT * FROM
aws.codedeploy.get_deployment_target
WHERE
"deployment_id" = 'VALUE'
AND "target_id" = 'VALUE';

Description

Returns information about a deployment target.

Table Definition

Column NameColumn Data Type
deployment_id Required Input Column

The unique ID of a deployment.

VARCHAR
target_id Required Input Column

The unique ID of a deployment target.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
deployment_target

A deployment target that contains information about a deployment such as its status, lifecycle events, and when it was last updated. It also contains metadata about the deployment target. The deployment target metadata depends on the deployment target's type (instanceTarget, lambdaTarget, or ecsTarget).

STRUCT(
"deployment_target_type" VARCHAR,
"instance_target" STRUCT(
"deployment_id" VARCHAR,
"target_id" VARCHAR,
"target_arn" VARCHAR,
"status" VARCHAR,
"last_updated_at" TIMESTAMP_S,
"lifecycle_events" STRUCT(
"lifecycle_event_name" VARCHAR,
"diagnostics" STRUCT(
"error_code" VARCHAR,
"script_name" VARCHAR,
"message" VARCHAR,
"log_tail" VARCHAR
),
"start_time" TIMESTAMP_S,
"end_time" TIMESTAMP_S,
"status" VARCHAR
)[],
"instance_label" VARCHAR
),
"lambda_target" STRUCT(
"deployment_id" VARCHAR,
"target_id" VARCHAR,
"target_arn" VARCHAR,
"status" VARCHAR,
"last_updated_at" TIMESTAMP_S,
"lifecycle_events" STRUCT(
"lifecycle_event_name" VARCHAR,
"diagnostics" STRUCT(
"error_code" VARCHAR,
"script_name" VARCHAR,
"message" VARCHAR,
"log_tail" VARCHAR
),
"start_time" TIMESTAMP_S,
"end_time" TIMESTAMP_S,
"status" VARCHAR
)[],
"lambda_function_info" STRUCT(
"function_name" VARCHAR,
"function_alias" VARCHAR,
"current_version" VARCHAR,
"target_version" VARCHAR,
"target_version_weight" DOUBLE
)
),
"ecs_target" STRUCT(
"deployment_id" VARCHAR,
"target_id" VARCHAR,
"target_arn" VARCHAR,
"last_updated_at" TIMESTAMP_S,
"lifecycle_events" STRUCT(
"lifecycle_event_name" VARCHAR,
"diagnostics" STRUCT(
"error_code" VARCHAR,
"script_name" VARCHAR,
"message" VARCHAR,
"log_tail" VARCHAR
),
"start_time" TIMESTAMP_S,
"end_time" TIMESTAMP_S,
"status" VARCHAR
)[],
"status" VARCHAR,
"task_sets_info" STRUCT(
"identifer" VARCHAR,
"desired_count" BIGINT,
"pending_count" BIGINT,
"running_count" BIGINT,
"status" VARCHAR,
"traffic_weight" DOUBLE,
"target_group" STRUCT(
"name" VARCHAR
),
"task_set_label" VARCHAR
)[]
),
"cloud_formation_target" STRUCT(
"deployment_id" VARCHAR,
"target_id" VARCHAR,
"last_updated_at" TIMESTAMP_S,
"lifecycle_events" STRUCT(
"lifecycle_event_name" VARCHAR,
"diagnostics" STRUCT(
"error_code" VARCHAR,
"script_name" VARCHAR,
"message" VARCHAR,
"log_tail" VARCHAR
),
"start_time" TIMESTAMP_S,
"end_time" TIMESTAMP_S,
"status" VARCHAR
)[],
"status" VARCHAR,
"resource_type" VARCHAR,
"target_version_weight" DOUBLE
)
)
Show child fields
deployment_target.cloud_formation_target

Information about the target to be updated by an CloudFormation blue/green deployment. This target type is used for all deployments initiated by a CloudFormation stack update.

Show child fields
deployment_target.cloud_formation_target.deployment_id

The unique ID of an CloudFormation blue/green deployment.

deployment_target.cloud_formation_target.last_updated_at

The date and time when the target application was updated by an CloudFormation blue/green deployment.

deployment_target.cloud_formation_target.lifecycle_events[]
Show child fields
deployment_target.cloud_formation_target.lifecycle_events[].diagnostics

Diagnostic information about the deployment lifecycle event.

Show child fields
deployment_target.cloud_formation_target.lifecycle_events[].diagnostics.error_code

The associated error code:

  • Success: The specified script ran.

  • ScriptMissing: The specified script was not found in the specified location.

  • ScriptNotExecutable: The specified script is not a recognized executable file type.

  • ScriptTimedOut: The specified script did not finish running in the specified time period.

  • ScriptFailed: The specified script failed to run as expected.

  • UnknownError: The specified script did not run for an unknown reason.

deployment_target.cloud_formation_target.lifecycle_events[].diagnostics.log_tail

The last portion of the diagnostic log.

If available, CodeDeploy returns up to the last 4 KB of the diagnostic log.

deployment_target.cloud_formation_target.lifecycle_events[].diagnostics.message

The message associated with the error.

deployment_target.cloud_formation_target.lifecycle_events[].diagnostics.script_name

The name of the script.

deployment_target.cloud_formation_target.lifecycle_events[].end_time

A timestamp that indicates when the deployment lifecycle event ended.

deployment_target.cloud_formation_target.lifecycle_events[].lifecycle_event_name

The deployment lifecycle event name, such as ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart, or ValidateService.

deployment_target.cloud_formation_target.lifecycle_events[].start_time

A timestamp that indicates when the deployment lifecycle event started.

deployment_target.cloud_formation_target.lifecycle_events[].status

The deployment lifecycle event status:

  • Pending: The deployment lifecycle event is pending.

  • InProgress: The deployment lifecycle event is in progress.

  • Succeeded: The deployment lifecycle event ran successfully.

  • Failed: The deployment lifecycle event has failed.

  • Skipped: The deployment lifecycle event has been skipped.

  • Unknown: The deployment lifecycle event is unknown.

deployment_target.cloud_formation_target.resource_type

The resource type for the CloudFormation blue/green deployment.

deployment_target.cloud_formation_target.status

The status of an CloudFormation blue/green deployment's target application.

deployment_target.cloud_formation_target.target_id

The unique ID of a deployment target that has a type of CloudFormationTarget.

deployment_target.cloud_formation_target.target_version_weight

The percentage of production traffic that the target version of an CloudFormation blue/green deployment receives.

deployment_target.deployment_target_type

The deployment type that is specific to the deployment's compute platform or deployments initiated by a CloudFormation stack update.

deployment_target.ecs_target

Information about the target for a deployment that uses the Amazon ECS compute platform.

Show child fields
deployment_target.ecs_target.deployment_id

The unique ID of a deployment.

deployment_target.ecs_target.last_updated_at

The date and time when the target Amazon ECS application was updated by a deployment.

deployment_target.ecs_target.lifecycle_events[]
Show child fields
deployment_target.ecs_target.lifecycle_events[].diagnostics

Diagnostic information about the deployment lifecycle event.

Show child fields
deployment_target.ecs_target.lifecycle_events[].diagnostics.error_code

The associated error code:

  • Success: The specified script ran.

  • ScriptMissing: The specified script was not found in the specified location.

  • ScriptNotExecutable: The specified script is not a recognized executable file type.

  • ScriptTimedOut: The specified script did not finish running in the specified time period.

  • ScriptFailed: The specified script failed to run as expected.

  • UnknownError: The specified script did not run for an unknown reason.

deployment_target.ecs_target.lifecycle_events[].diagnostics.log_tail

The last portion of the diagnostic log.

If available, CodeDeploy returns up to the last 4 KB of the diagnostic log.

deployment_target.ecs_target.lifecycle_events[].diagnostics.message

The message associated with the error.

deployment_target.ecs_target.lifecycle_events[].diagnostics.script_name

The name of the script.

deployment_target.ecs_target.lifecycle_events[].end_time

A timestamp that indicates when the deployment lifecycle event ended.

deployment_target.ecs_target.lifecycle_events[].lifecycle_event_name

The deployment lifecycle event name, such as ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart, or ValidateService.

deployment_target.ecs_target.lifecycle_events[].start_time

A timestamp that indicates when the deployment lifecycle event started.

deployment_target.ecs_target.lifecycle_events[].status

The deployment lifecycle event status:

  • Pending: The deployment lifecycle event is pending.

  • InProgress: The deployment lifecycle event is in progress.

  • Succeeded: The deployment lifecycle event ran successfully.

  • Failed: The deployment lifecycle event has failed.

  • Skipped: The deployment lifecycle event has been skipped.

  • Unknown: The deployment lifecycle event is unknown.

deployment_target.ecs_target.status

The status an Amazon ECS deployment's target ECS application.

deployment_target.ecs_target.target_arn

The Amazon Resource Name (ARN) of the target.

deployment_target.ecs_target.target_id

The unique ID of a deployment target that has a type of ecsTarget.

deployment_target.ecs_target.task_sets_info[]
Show child fields
deployment_target.ecs_target.task_sets_info[].desired_count

The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set.

deployment_target.ecs_target.task_sets_info[].identifer

A unique ID of an ECSTaskSet.

deployment_target.ecs_target.task_sets_info[].pending_count

The number of tasks in the task set that are in the PENDING status during an Amazon ECS deployment. A task in the PENDING state is preparing to enter the RUNNING state. A task set enters the PENDING status when it launches for the first time, or when it is restarted after being in the STOPPED state.

deployment_target.ecs_target.task_sets_info[].running_count

The number of tasks in the task set that are in the RUNNING status during an Amazon ECS deployment. A task in the RUNNING state is running and ready for use.

deployment_target.ecs_target.task_sets_info[].status

The status of the task set. There are three valid task set statuses:

  • PRIMARY: Indicates the task set is serving production traffic.

  • ACTIVE: Indicates the task set is not serving production traffic.

  • DRAINING: Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group.

deployment_target.ecs_target.task_sets_info[].target_group

The target group associated with the task set. The target group is used by CodeDeploy to manage traffic to a task set.

Show child fields
deployment_target.ecs_target.task_sets_info[].target_group.name

For blue/green deployments, the name of the target group that instances in the original environment are deregistered from, and instances in the replacement environment are registered with. For in-place deployments, the name of the target group that instances are deregistered from, so they are not serving traffic during a deployment, and then re-registered with after the deployment is complete.

deployment_target.ecs_target.task_sets_info[].task_set_label

A label that identifies whether the ECS task set is an original target (BLUE) or a replacement target (GREEN).

deployment_target.ecs_target.task_sets_info[].traffic_weight

The percentage of traffic served by this task set.

deployment_target.instance_target

Information about the target for a deployment that uses the EC2/On-premises compute platform.

Show child fields
deployment_target.instance_target.deployment_id

The unique ID of a deployment.

deployment_target.instance_target.instance_label

A label that identifies whether the instance is an original target (BLUE) or a replacement target (GREEN).

deployment_target.instance_target.last_updated_at

The date and time when the target instance was updated by a deployment.

deployment_target.instance_target.lifecycle_events[]
Show child fields
deployment_target.instance_target.lifecycle_events[].diagnostics

Diagnostic information about the deployment lifecycle event.

Show child fields
deployment_target.instance_target.lifecycle_events[].diagnostics.error_code

The associated error code:

  • Success: The specified script ran.

  • ScriptMissing: The specified script was not found in the specified location.

  • ScriptNotExecutable: The specified script is not a recognized executable file type.

  • ScriptTimedOut: The specified script did not finish running in the specified time period.

  • ScriptFailed: The specified script failed to run as expected.

  • UnknownError: The specified script did not run for an unknown reason.

deployment_target.instance_target.lifecycle_events[].diagnostics.log_tail

The last portion of the diagnostic log.

If available, CodeDeploy returns up to the last 4 KB of the diagnostic log.

deployment_target.instance_target.lifecycle_events[].diagnostics.message

The message associated with the error.

deployment_target.instance_target.lifecycle_events[].diagnostics.script_name

The name of the script.

deployment_target.instance_target.lifecycle_events[].end_time

A timestamp that indicates when the deployment lifecycle event ended.

deployment_target.instance_target.lifecycle_events[].lifecycle_event_name

The deployment lifecycle event name, such as ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart, or ValidateService.

deployment_target.instance_target.lifecycle_events[].start_time

A timestamp that indicates when the deployment lifecycle event started.

deployment_target.instance_target.lifecycle_events[].status

The deployment lifecycle event status:

  • Pending: The deployment lifecycle event is pending.

  • InProgress: The deployment lifecycle event is in progress.

  • Succeeded: The deployment lifecycle event ran successfully.

  • Failed: The deployment lifecycle event has failed.

  • Skipped: The deployment lifecycle event has been skipped.

  • Unknown: The deployment lifecycle event is unknown.

deployment_target.instance_target.status

The status an EC2/On-premises deployment's target instance.

deployment_target.instance_target.target_arn

The Amazon Resource Name (ARN) of the target.

deployment_target.instance_target.target_id

The unique ID of a deployment target that has a type of instanceTarget.

deployment_target.lambda_target

Information about the target for a deployment that uses the Lambda compute platform.

Show child fields
deployment_target.lambda_target.deployment_id

The unique ID of a deployment.

deployment_target.lambda_target.lambda_function_info

A LambdaFunctionInfo object that describes a target Lambda function.

Show child fields
deployment_target.lambda_target.lambda_function_info.current_version

The version of a Lambda function that production traffic points to.

deployment_target.lambda_target.lambda_function_info.function_alias

The alias of a Lambda function. For more information, see Lambda Function Aliases in the Lambda Developer Guide.

deployment_target.lambda_target.lambda_function_info.function_name

The name of a Lambda function.

deployment_target.lambda_target.lambda_function_info.target_version

The version of a Lambda function that production traffic points to after the Lambda function is deployed.

deployment_target.lambda_target.lambda_function_info.target_version_weight

The percentage of production traffic that the target version of a Lambda function receives.

deployment_target.lambda_target.last_updated_at

The date and time when the target Lambda function was updated by a deployment.

deployment_target.lambda_target.lifecycle_events[]
Show child fields
deployment_target.lambda_target.lifecycle_events[].diagnostics

Diagnostic information about the deployment lifecycle event.

Show child fields
deployment_target.lambda_target.lifecycle_events[].diagnostics.error_code

The associated error code:

  • Success: The specified script ran.

  • ScriptMissing: The specified script was not found in the specified location.

  • ScriptNotExecutable: The specified script is not a recognized executable file type.

  • ScriptTimedOut: The specified script did not finish running in the specified time period.

  • ScriptFailed: The specified script failed to run as expected.

  • UnknownError: The specified script did not run for an unknown reason.

deployment_target.lambda_target.lifecycle_events[].diagnostics.log_tail

The last portion of the diagnostic log.

If available, CodeDeploy returns up to the last 4 KB of the diagnostic log.

deployment_target.lambda_target.lifecycle_events[].diagnostics.message

The message associated with the error.

deployment_target.lambda_target.lifecycle_events[].diagnostics.script_name

The name of the script.

deployment_target.lambda_target.lifecycle_events[].end_time

A timestamp that indicates when the deployment lifecycle event ended.

deployment_target.lambda_target.lifecycle_events[].lifecycle_event_name

The deployment lifecycle event name, such as ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart, or ValidateService.

deployment_target.lambda_target.lifecycle_events[].start_time

A timestamp that indicates when the deployment lifecycle event started.

deployment_target.lambda_target.lifecycle_events[].status

The deployment lifecycle event status:

  • Pending: The deployment lifecycle event is pending.

  • InProgress: The deployment lifecycle event is in progress.

  • Succeeded: The deployment lifecycle event ran successfully.

  • Failed: The deployment lifecycle event has failed.

  • Skipped: The deployment lifecycle event has been skipped.

  • Unknown: The deployment lifecycle event is unknown.

deployment_target.lambda_target.status

The status an Lambda deployment's target Lambda function.

deployment_target.lambda_target.target_arn

The Amazon Resource Name (ARN) of the target.

deployment_target.lambda_target.target_id

The unique ID of a deployment target that has a type of lambdaTarget.