What should be service api for aws_api_gateway_integration with firehose in terraform
Asked Answered
W

2

6

As per terraform doc, uri for the aws_api_gateway_integration should be

resource "aws_api_gateway_integration" "integration" {

    ...
    ...
    uri = "arn:aws:apigateway:{region}:firehose:PutRecord/{service_api}"

}   

I am not able to figure out what the service_api should be. Can you please help?

https://www.terraform.io/docs/providers/aws/r/api_gateway_integration.html

Wagonage answered 21/10, 2017 at 1:3 Comment(1)
Have you found an answer to this question? I have the same problem and I am stuck at this point.Dede
W
5
  type = "AWS"
  integration_http_method = "POST"
  uri = "arn:aws:apigateway:${var.aws_region}:firehose:action/PutRecord"
Wagonage answered 8/1, 2018 at 7:29 Comment(3)
beware copy+pasting the URI above - it contains zero-width whitespace characters - it prints like it should but it really is arn:aws:apigateway:us-east-1:firehose:action/PutRec\u200c\u200bord and that will lead to an UnknownOperationException on API Gateway - cost me hours.Jumpoff
@Jumpoff It looks like the original answer was edited to remove the zero width whitespace. Can you verify for future users?Dummy
@Dummy yes, I can confirm that the zero-width whitespace characters were removed from this answer, so copying it should work now.Jumpoff
V
2

I found an example here:

type                    = "AWS"
integration_http_method = "POST"
uri                     = "arn:aws:apigateway:${var.aws_region}:kinesis:action/DescribeStream"

Example taken from here:

Vivian answered 2/11, 2017 at 10:0 Comment(1)
Soren, I was able to get it working using "arn:aws:apigateway:${var.aws_region}:firehose:action/PutRecord". Hope it helps. Also i got the entire serverless stack working using api gateway and firehose. You can ask me if you have any other questions.Wagonage

© 2022 - 2024 — McMap. All rights reserved.