Setting default values to those used by HashiCorp in their sample

This commit is contained in:
Tom Archer 2024-02-06 13:49:53 -08:00 committed by lonegunmanb
parent f6f2e9317a
commit d80c430a56
3 changed files with 12 additions and 4 deletions

View File

@ -20,7 +20,7 @@ This template deploys an Azure API Management service, containing an API (based
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `open_api_spec_content_format` | The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link. | "" |
| `open_api_spec_content_value` | The Content from which the API Definition should be imported. When a content_format of *-link-* is specified this must be a URL, otherwise this must be defined inline. | "" |
| `open_api_spec_content_format` | The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link. | swagger-link-json |
| `open_api_spec_content_value` | The Content from which the API Definition should be imported. When a content_format of *-link-* is specified this must be a URL, otherwise this must be defined inline. | http://conferenceapi.azurewebsites.net/?format=json |
## Example

View File

@ -45,6 +45,14 @@ resource "random_string" "api_name" {
upper = false
}
resource "random_string" "content_value" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_api_management_api" "api" {
name = "${random_string.api_name.result}-api"
resource_group_name = azurerm_resource_group.rg.name

View File

@ -12,7 +12,7 @@ variable "resource_group_location" {
variable "open_api_spec_content_format" {
type = string
default = "openapi"
default = "swagger-link-json"
description = "The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link."
validation {
condition = contains(["openapi", "openapi+json", "openapi+json-link", "openapi-link", "swagger-json", "swagger-link-json", "wadl-link-json", "wadl-xml", "wsdl", "wsdl-link"], var.open_api_spec_content_format)
@ -22,6 +22,6 @@ variable "open_api_spec_content_format" {
variable "open_api_spec_content_value" {
type = string
default = ""
default = "http://conferenceapi.azurewebsites.net/?format=json"
description = "The Content from which the API Definition should be imported. When a content_format of *-link-* is specified this must be a URL, otherwise this must be defined inline."
}