In the Terraform docs for aws_api_gateway_deployment
it says:
Note: Depends on having aws_api_gateway_integration inside your rest api (which in turn depends on aws_api_gateway_method). To avoid race conditions you might need to add an explicit depends_on = ["aws_api_gateway_integration.name"].
My aws_api_gateway_deployment
resource lives in the root module but most of the aws_api_gateway_integration
s are created in a child module (this is a local module created by me).
My understanding is that you can't export a resource from a module.
The folder structure is:
- main.tf <-- contains the aws_api_gateway_rest_api and aws_api_gateway_deployment and uses the service_func_lambda module multiple times
- modules/
- service_func_lambda/
- main.tf <-- contains the aws_api_gateway_integration and other bits such as aws_api_gateway_method and aws_api_gateway_resource
How can I reference the aws_api_gateway_integration
that is created inside the module from the calling, root module?