I’ve worked out why this is failing; Firehose has started rejecting the content-type header “application/x-amz-json-1.0”. I’ve filed a ticket with Amazon asking why, as this seems like an API they shouldn’t be breaking.
Other people using our AWSrequest class for SQS, SNS, kinesis (not firehose), sdb, lambda, dynamoDB, etc aren’t having issues so it would appear to just be kinesis firehose that’s affected.
The workaround right now is to override the content type header in the library. You’ll need to grab the firehose class from https://github.com/electricimp/AWSKinesisFirehose/tree/v1.0.1 and paste it into your code (after the include of the requestV4 library), then modify the header setup in putRecord and putRecords from:
local headers = { "X-Amz-Target": format("%s.PutRecordBatch", TARGET_PREFIX) };
…to…
local headers = { "X-Amz-Target": format("%s.PutRecordBatch", TARGET_PREFIX) "Content-Type": "application/x-amz-json-1.1" };
…then you should see requests work fine.
I’ll update this thread when Amazon reply - this seems like a problem on their end, and given that I can’t find any documentation on exactly what the x-amz-json versions mean (they only mention 1.0 here https://docs.aws.amazon.com/apigateway/api-reference/making-http-requests/ ), it’s all very opaque.