AWS CodeDeploy
User Guide (API Version 2014-10-06)

JSON Data Formats for CodeDeploy Triggers

You can use the JSON output that is created when a trigger for a deployment or instance is activated in a custom notification workflow, such as sending messages to Amazon SQS queues or invoking a function in AWS Lambda.


This guide does not address how to configure notifications using JSON. For information about using Amazon SNS to send messages to Amazon SQS queues, see Sending Amazon SNS Messages to Amazon SQS Queues. For information about using Amazon SNS to invoke a Lambda function, see Invoking Lambda Functions Using Amazon SNS Notifications.

The following examples show the structure of the JSON output available with CodeDeploy triggers.

Sample JSON Output for Instance-Based Triggers

{ "region": "us-east-2", "accountId": "111222333444", "eventTriggerName": "trigger-group-us-east-instance-succeeded", "deploymentId": "d-75I7MBT7C", "instanceId": "arn:aws:ec2:us-east-2:444455556666:instance/i-496589f7", "lastUpdatedAt": "1446744207.564", "instanceStatus": "Succeeded", "lifecycleEvents": [ { "LifecycleEvent": "ApplicationStop", "LifecycleEventStatus": "Succeeded", "StartTime": "1446744188.595", "EndTime": "1446744188.711" }, { "LifecycleEvent": "BeforeInstall", "LifecycleEventStatus": "Succeeded", "StartTime": "1446744189.827", "EndTime": "1446744190.402" } //More lifecycle events might be listed here ] }

Sample JSON Output for Deployment-Based Triggers

{ "region": "us-west-1", "accountId": "111222333444", "eventTriggerName": "Trigger-group-us-west-3-deploy-failed", "applicationName": "ProductionApp-us-west-3", "deploymentId": "d-75I7MBT7C", "deploymentGroupName": "dep-group-def-456", "createTime": "1446744188.595", "completeTime": "1446744190.402", "deploymentOverview": { "Failed": "10", "InProgress": "0", "Pending": "0", "Skipped": "0", "Succeeded": "0" }, "status": "Failed", "errorInformation": { "ErrorCode": "IAM_ROLE_MISSING", "ErrorMessage": "IAM Role is missing for deployment group: dep-group-def-456" } }