There's no actual guide to integrating specifically API gateway and Codebuild, so I'm looking at several and trying to adapt.
I have my roles and policies set up per this documentation and have my CodeBuild project setup and running successfully.
I've set up a POST endpoint as such, referring to the actions from the CodeBuild API documentation:
And I am using the test tab for the endpoint to send
{ "project": "my-project" }
but am getting this response
{
"Output": {
"__type": "com.amazon.coral.service#UnknownOperationException",
"message": null
},
"Version": "1.0"
}
Logs
Execution log for request b0ee0d54-c1d0-11e9-9ff3-e9448aaf711c
Sun Aug 18 15:56:07 UTC 2019 : Starting execution for request: b0ee0d54-c1d0-11e9-9ff3-e9448aaf711c
Sun Aug 18 15:56:07 UTC 2019 : HTTP Method: POST, Resource Path: /vegankit/stage
Sun Aug 18 15:56:07 UTC 2019 : Method request path: {}
Sun Aug 18 15:56:07 UTC 2019 : Method request query string: {}
Sun Aug 18 15:56:07 UTC 2019 : Method request headers: {}
Sun Aug 18 15:56:07 UTC 2019 : Method request body before transformations: { "project": "stage-vegankit-com" }
Sun Aug 18 15:56:07 UTC 2019 : Endpoint request URI: https://codebuild.us-east-1.amazonaws.com/?Action=StartBuild
Sun Aug 18 15:56:07 UTC 2019 : Endpoint request headers: {Authorization=****************************************************************************************************************************************************************************************************************************************************************************388440, X-Amz-Date=20190818T155607Z, x-amzn-apigateway-api-id=[redacted], Accept=application/json, User-Agent=AmazonAPIGateway_[redacted], X-Amz-Security-Token=[redacted] [TRUNCATED]
Sun Aug 18 15:56:07 UTC 2019 : Endpoint request body after transformations: { "project": "my-project" }
Sun Aug 18 15:56:07 UTC 2019 : Sending request to https://codebuild.us-east-1.amazonaws.com/?Action=StartBuild
Sun Aug 18 15:56:08 UTC 2019 : Received response. Status: 200, Integration latency: 360 ms
Sun Aug 18 15:56:08 UTC 2019 : Endpoint response headers: {x-amzn-RequestId=7afcfc90-de3e-424a-b7d9-b47ff926c1d0, Content-Type=application/json, Content-Length=105, Date=Sun, 18 Aug 2019 15:56:08 GMT}
Sun Aug 18 15:56:08 UTC 2019 : Endpoint response body before transformations: {"Output":{"__type":"com.amazon.coral.service#UnknownOperationException","message":null},"Version":"1.0"}
Sun Aug 18 15:56:08 UTC 2019 : Method response body after transformations: {"Output":{"__type":"com.amazon.coral.service#UnknownOperationException","message":null},"Version":"1.0"}
Sun Aug 18 15:56:08 UTC 2019 : Method response headers: {X-Amzn-Trace-Id=Root=[redacted], Content-Type=application/json}
Sun Aug 18 15:56:08 UTC 2019 : Successfully completed execution
Sun Aug 18 15:56:08 UTC 2019 : Method completed with status: 200