I am integrating the AWS Firehose service in the APIGateway, in that I am getting invalid ARN
ERROR:
aws_api_gateway_integration.firehose_integration: Creating…
17╷
18│ Error: creating API Gateway Integration: BadRequestException: Invalid ARN specified in the request
19│
20│ with aws_api_gateway_integration.firehose_integration,
21│ on api-gateway.tf line 46, in resource “aws_api_gateway_integration” “firehose_integration”:
22│ 46: resource “aws_api_gateway_integration” “firehose_integration” {
This is the code:
resource "aws_api_gateway_integration" "firehose_integration" {
rest_api_id = aws_api_gateway_rest_api.nest_data_collector_gateway.id
resource_id = aws_api_gateway_resource.firehose_gateway_resource.id
http_method = aws_api_gateway_method.firehose_gateway_method.http_method
integration_http_method = "ANY"
type = "AWS"
uri = "arn:aws:apigateway:us-east-1:firehose:action/PutRecord"
passthrough_behavior = "WHEN_NO_TEMPLATES"
credentials = aws_iam_role.api_gateway_role.name
# Passthrough the JSON response
request_templates = {
"application/json" = <<EOF
#set($encodedData = $input.path('$.message.data'))
{
#set($data = $util.parseJson($util.base64Decode($encodedData))
{
#set($data.ProgramId = $util.escapeJavaScript($input.params('prgrmId')))
{
"DeliveryStreamName": "${local.resource_group}",
"Record": {
"Data": "$util.base64Encode($data)"
}
}
}
}
EOF
}
}
Please help me to resolve the issue.