AWS CodeDeploy
User Guide (API Version 2014-10-06)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

AWS CodeDeploy 触发器的 JSON 数据格式

您可以使用在自定义通知工作流程中激活部署或实例的触发器时创建的 JSON 输出,例如发送消息到 Amazon SQS 队列或调用 AWS Lambda 中的函数。

注意

本指南不解决如何使用 JSON 配置通知的问题。有关使用 Amazon SNS 将消息发送到 Amazon SQS 队列的信息,请参阅将 Amazon SNS 消息发送到 Amazon SQS 队列。有关使用 Amazon SNS 调用 Lambda 函数的信息,请参阅使用 Amazon SNS 通知调用 Lambda 函数

以下示例将显示适用于 AWS CodeDeploy 触发器的 JSON 输出的结构。

适用于基于实例的触发器的示例 JSON 输出

Copy
{ "region": "us-east-1", "accountId": "111222333444", "eventTriggerName": "trigger-group-us-east-instance-succeeded", "deploymentId": "d-75I7MBT7C", "instanceId": "arn:aws:ec2:us-east-1: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 ] }

适用于基于部署的触发器的示例 JSON 输出

Copy
{ "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" } }