I'm kicking off a CodeDeploy deployment with the following command:
aws deploy create-deployment --cli-input-json file://create-deployment.json
My create-deployment.json
file looks like this:
{
"applicationName": "myapp",
"deploymentGroupName": "myapp-test",
"revision": {
"revisionType": "AppSpecContent",
"appSpecContent": {
"content": "appspec.json"
}
}
}
I get a deployment ID response. The deploy is kicked off successfully, but it immediately fails with the error
The deployment failed because the AppSpec file that specifies the deployment configuration is missing or has an invalid configuration. The input AppSpec file is a not well-formed yaml. The template cannot be parsed.
My appspec file is clearly JSON, not YAML. I have successfully launched a deployment with the same appspec.json file from the console, where you can explicitly tell AWS that the appspec is a JSON file. The docs for create-deployment
indicate that a JSON file should be acceptable. There is no option to explicitly state the format of the appspec file if you're using AppSpecContent instead of an S3 Bucket. It seems like CodeDeploy can't actually figure out that it has received a JSON appspec file instead of YAML.
I tried using an YAML file as well, and it also failed with the same error message. I started deploys with the same appspec files (both JSON and YAML) from the console successfully.