### Installing Pre-commit with pipx (Bash) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/CONTRIBUTING.md This snippet demonstrates how to install the `pre-commit` tool globally using `pipx`. `pipx` installs applications in isolated environments, preventing dependency conflicts. This is a prerequisite for enabling the project's code style and linting hooks. ```bash $ pipx install pre-commit ``` -------------------------------- ### Installing Pre-commit with pip3 (Bash) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/CONTRIBUTING.md This snippet provides an alternative method to install the `pre-commit` tool using `pip3` for the current user. This approach is useful if `pipx` is not available or preferred. `pre-commit` is essential for enforcing code style and running linting checks before commits. ```bash $ pip3 install pre-commit --user ``` -------------------------------- ### Configuring Pre-commit Hooks for Terraform Module (Bash) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/CONTRIBUTING.md This snippet shows how to navigate into the cloned module directory and then install the `pre-commit` hooks. Running `pre-commit install` sets up the Git hooks, ensuring that configured checks (like formatting, linting, and documentation generation) are automatically triggered on every `git commit`. ```bash $ cd path_to_the_git_cloned_module/ $ pre-commit install ``` -------------------------------- ### Example Availability Zones List in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet provides an example list of numbers representing Availability Zones. This list is typically used with the `zones` input variable to specify in which Azure Availability Zones the API Management service should be located, primarily supported in the Premium Tier. ```HCL [ 1, 2, 3 ] ``` -------------------------------- ### Defining Product Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet defines the structure for `products`, a list of objects used to create and configure API Management products. It includes various attributes such as product ID, display name, description, terms, subscription requirements, approval settings, publication status, subscription limits, associated group names, and an optional policy. ```HCL list(object({ product_id = optional(string) display_name = string description = optional(string) terms = optional(string) subscription_required = optional(bool, true) approval_required = optional(bool, false) published = optional(bool, true) subscriptions_limit = optional(number, 1) groups_names = optional(list(string), []) policy = optional(string) })) ``` -------------------------------- ### Deploying Azure API Management with Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL code block demonstrates how to use the `claranet/api-management/azurerm` Terraform module to deploy an Azure API Management instance. It configures basic properties like location, client name, environment, stack, resource group, SKU, publisher details, named values, and additional locations for multi-region deployments. It also integrates with diagnostic settings by referencing `logs_destinations_ids`. ```HCL module "apim" { source = "claranet/api-management/azurerm" version = "x.x.x" location = module.azure_region.location location_short = module.azure_region.location_short client_name = var.client_name environment = var.environment stack = var.stack resource_group_name = module.rg.name sku_tier = "Standard" sku_capacity = 1 publisher_name = "Contoso ApiManager" publisher_email = "api_manager@test.com" named_values = [ { name = "my_named_value" value = "my_secret_value" secret = true }, { display_name = "My second value explained" name = "my_second_value" value = "my_not_secret_value" } ] additional_locations = [{ location = "eastus2" subnet_id = var.subnet_id }] logs_destinations_ids = [ module.logs.storage_account_id, module.logs.id ] } ``` -------------------------------- ### Defining Policy Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet defines the structure for `policy_configurations`, a list of objects used to apply policies at various scopes within the API Management service. Each policy configuration can specify a name, inline XML content for the policy, or a link to an external XML policy file. ```HCL list(object({ name = optional(string, "default") xml_content = optional(string) xml_link = optional(string) })) ``` -------------------------------- ### Defining API Management Backend Configurations (HCL) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL object type specifies the schema for configuring backend services for the API Management instance. It includes details such as name, protocol, URL, description, resource ID, title, and optional nested configurations for credentials, proxy settings, and TLS validation. ```HCL list(object({ name = string protocol = string url = string description = optional(string) resource_id = optional(string) title = optional(string) credentials = optional(object({ authorization = optional(object({ parameter = string scheme = string })) certificate = optional(list(string)) header = optional(map(string)) query = optional(map(string)) })) proxy = optional(object({ url = string username = string password = string })) tls = optional(object({ validate_certificate_chain = optional(bool) validate_certificate_name = optional(bool) })) })) ``` -------------------------------- ### Defining Legacy Portal Hostname Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet outlines the structure for `portal_hostname_configurations`, a list of objects for configuring custom hostnames for the legacy developer portal of the Azure API Management service. It includes fields for the hostname, optional Key Vault ID for certificates, certificate content, password, and client certificate negotiation settings. ```HCL list(object({ host_name = string key_vault_id = optional(string) certificate = optional(string) certificate_password = optional(string) negotiate_client_certificate = optional(bool, false) })) ``` -------------------------------- ### Setting Developer Portal Hostname Configurations (HCL) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL object type outlines the configuration for the Developer Portal's hostname. It includes properties for the hostname itself, Key Vault ID for certificates, certificate content, certificate password, and an option to negotiate client certificates. ```HCL list(object({ host_name = string key_vault_id = optional(string) certificate = optional(string) certificate_password = optional(string) negotiate_client_certificate = optional(bool, false) })) ``` -------------------------------- ### Defining SCM Hostname Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet outlines the structure for `scm_hostname_configurations`, a list of objects for configuring custom hostnames for the SCM (Source Control Management) endpoint of the Azure API Management service. It includes fields for the hostname, optional Key Vault ID for certificates, certificate content, password, and client certificate negotiation settings. ```HCL list(object({ host_name = string key_vault_id = optional(string) certificate = optional(string) certificate_password = optional(string) negotiate_client_certificate = optional(bool, false) })) ``` -------------------------------- ### Defining Proxy Hostname Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet specifies the structure for `proxy_hostname_configurations`, a list of objects for configuring custom hostnames for the proxy endpoint of the Azure API Management service. It includes fields for the hostname, optional Key Vault ID for certificates, certificate content, password, default SSL binding, and client certificate negotiation settings. ```HCL list(object({ host_name = string key_vault_id = optional(string) certificate = optional(string) certificate_password = optional(string) default_ssl_binding = optional(bool, false) negotiate_client_certificate = optional(bool, false) })) ``` -------------------------------- ### Defining Security Configuration Object in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet defines the structure for the `security_configuration` input variable, which is an object type. It specifies various boolean flags for enabling or disabling SSL/TLS versions and specific cipher suites for both backend and frontend connections within Azure API Management. All fields are optional and default to `false`. ```HCL object({ backend_ssl30_enabled = optional(bool, false) backend_tls10_enabled = optional(bool, false) backend_tls11_enabled = optional(bool, false) frontend_ssl30_enabled = optional(bool, false) frontend_tls10_enabled = optional(bool, false) frontend_tls11_enabled = optional(bool, false) tls_ecdhe_ecdsa_with_aes128_cbc_sha_ciphers_enabled = optional(bool, false) tls_ecdhe_ecdsa_with_aes256_cbc_sha_ciphers_enabled = optional(bool, false) tls_ecdhe_rsa_with_aes128_cbc_sha_ciphers_enabled = optional(bool, false) tls_ecdhe_rsa_with_aes256_cbc_sha_ciphers_enabled = optional(bool, false) tls_rsa_with_aes128_cbc_sha256_ciphers_enabled = optional(bool, false) tls_rsa_with_aes128_cbc_sha_ciphers_enabled = optional(bool, false) tls_rsa_with_aes128_gcm_sha256_ciphers_enabled = optional(bool, false) tls_rsa_with_aes256_cbc_sha256_ciphers_enabled = optional(bool, false) tls_rsa_with_aes256_cbc_sha_ciphers_enabled = optional(bool, false) triple_des_ciphers_enabled = optional(bool, false) }) ``` -------------------------------- ### Defining Management Hostname Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet defines the structure for `management_hostname_configurations`, a list of objects used to configure custom hostnames for the management endpoint of the Azure API Management service. It includes fields for the hostname, optional Key Vault ID for certificates, certificate content, password, and client certificate negotiation settings. ```HCL list(object({ host_name = string key_vault_id = optional(string) certificate = optional(string) certificate_password = optional(string) negotiate_client_certificate = optional(bool, false) })) ``` -------------------------------- ### Defining Terms of Service Configuration Object in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet defines the structure for the `terms_of_service_configuration` input variable, an object type. It includes boolean flags for `consent_required` and `enabled`, and a string field for the `text` of the terms of service. All fields are optional, with `consent_required` and `enabled` defaulting to `false`, and `text` defaulting to an empty string. ```HCL object({ consent_required = optional(bool, false) enabled = optional(bool, false) text = optional(string, "") }) ``` -------------------------------- ### Defining Named Values Configurations in Terraform Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL snippet specifies the structure for `named_values`, a list of objects representing named values within the API Management service. Each named value includes a unique name, an optional display name, its actual value, and a flag indicating if it's a secret. ```HCL list(object({ name = string display_name = optional(string) value = string secret = optional(bool, false) })) ``` -------------------------------- ### Specifying API Management Certificate Configurations (HCL) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL object type defines the structure for providing certificate configurations to the API Management service. It requires an encoded certificate string, and optionally allows specifying a certificate password and the certificate store name. ```HCL list(object({ encoded_certificate = string certificate_password = optional(string) store_name = string })) ``` -------------------------------- ### Configuring Additional API Management Locations (HCL) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL object type defines the structure for specifying additional Azure regions where the API Management service should be expanded. It includes properties for location, capacity, availability zones, public IP address ID, and subnet ID. ```HCL list(object({ location = string capacity = optional(number) zones = optional(list(number), [1, 2, 3]) public_ip_address_id = optional(string) subnet_id = optional(string) })) ``` -------------------------------- ### Defining API Management User Groups (HCL) Source: https://github.com/claranet/terraform-azurerm-api-management/blob/master/README.md This HCL object type specifies the schema for creating user groups within the API Management service. It allows defining the group's name, display name, description, type, and an optional external ID for integration with external identity providers. ```HCL list(object({ name = optional(string) display_name = string description = optional(string) type = optional(string) external_id = optional(string) })) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.