Sometimes in your IaC, you may need to get the API definitions from the backend AppService. At the same time, you may need to restrict access to the AppService based on the source IP address:
Create two modules:[code_snippet_source id=1 line_numbers=true]
….
data “http” “swagger” {
url = “${var.service_url}/swagger/v1/swagger.json”
request_headers = {
Accept = “application/json”
}
}
…
…