I'm using terraform to manage ibm cloud resources. I'm creating apis for api gate way.
However, resource requires a json file and its path. I have to modify json file for all different environments and regions.
resource "ibm_api_gateway_endpoint" "endpoint"{
service_instance_crn = ibm_resource_instance.apigateway.id
open_api_doc_name = "${path.module}/${var.environment}-api-definitions.yaml"
}
It works this way with a yml (or json) file. If i use jsonencode or tempfile for open_api_doc i got an error that states open_api_doc_name requires a json,yml file. Is there a way to convert jsonencode to a file path?
open_api_doc_name
attribute inibm_api_gateway_endpoint
resource doesn't accept file as a string.. It accepts only file path/location If you want to use jsonencode, may be you can make use oflocal_file
resource to create a file and use that file in endpoint resource.. some thing like..