I'm currently creating an AWS API Gateway with terraform by using an open api spec from a json file.
resource "aws_api_gateway_rest_api" "my_test_gateway" {
name = "test_gateway"
description = "test gateway"
body = "${file("assets/test_openapi_spc.json")}"
}
I need to map the api resources that are created by said openAPI spec to AWS Step Functions. How can i reference a API Gateway resource created by the openAPI spec to be able to create a new aws_api_gateway_integration? Normally you would do something like this and describe the resources in terraform
resource "aws_api_gateway_integration" "test" {
resource_id = "${aws_api_gateway_resource.my_resource.id}"
}
In my case, however, i don't have a resource id defined in my terraform scripts because they get created by the openAPI spec.
Is there some way of extracting all the resources of an api gateway that were created as terraform data source so that i can reference them? Not sure if i'm missing something major here.