0

I want to add a trigger to an existing DeploymentGroup. When I tried to execute the below update-deployment-group CLI command, it is giving me an error.

Error Message :

Expecting ':' delimiter: line 1 column 160 (char 159)

aws deploy update-deployment-group --application-name CodeDeployDemo --current-deployment-group-name CDPerf
--trigger-configurations '[{"triggerName":"CodeDeployPerf","triggerTargetArn":"arn:aws:sns:us-west-2:xxxxxxxxx:tname","triggerEvents":{"DEPLOYMENT_START"}}]'

I've tried to follow what is in Page 183 of the CodeDeploy user guide

Paul
  • 10,381
  • 13
  • 48
  • 86
Raj R
  • 63
  • 1
  • 1
  • 8

2 Answers2

0

I guess this is a documentation bug.

As described in the API doc, "triggerEvents":{"DEPLOYMENT_START"} should be "triggerEvents":["DEPLOYMENT_START"]. So the whole command would be

$ aws deploy update-deployment-group --application-name CodeDeployDemo --current-deployment-group-name CDPerf --trigger-configurations '[{"triggerName":"CodeDeployPerf","triggerTargetArn":"arn:aws:sns:us-west-2:xxxxxxxxx:tname","triggerEvents":["DEPLOYMENT_START"]}]'
quiver
  • 4,230
  • 1
  • 22
  • 20
  • Also triggerEvents should be represented as, "triggerEvents":["DeploymentStart","DeploymentSuccess","DeploymentFailure","DeploymentStop"] . Otherwise, an error will come up - "A client error (InvalidTriggerConfigException) occurred when calling the UpdateDeploymentGroup operation: Invalid Trigger event type" – Raj R Apr 14 '16 at 07:04
0

Yeah, the API doc @quiver suggests is the right version, and CodeDeploy user guide has a typo there. I've informed our doc write to help make it right. Basically everything inside {} is an object, and everything inside [] is a list of strings/objects etc.

Thanks for sharing your questions!

binbinlu
  • 416
  • 2
  • 5