azurermApplicationGateway
Manages an Application Gateway.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
this,
"example_1",
{
address_space: ["10.254.0.0/16"],
location: azurermResourceGroupExample.location,
name: "example-network",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const backendAddressPoolName = `\${${azurermVirtualNetworkExample.name}}-beap`;
const frontendIpConfigurationName = `\${${azurermVirtualNetworkExample.name}}-feip`;
const frontendPortName = `\${${azurermVirtualNetworkExample.name}}-feport`;
const httpSettingName = `\${${azurermVirtualNetworkExample.name}}-be-htst`;
const listenerName = `\${${azurermVirtualNetworkExample.name}}-httplstn`;
const requestRoutingRuleName = `\${${azurermVirtualNetworkExample.name}}-rqrt`;
const azurermPublicIpExample = new azurerm.publicIp.PublicIp(
this,
"example_2",
{
allocation_method: "Dynamic",
location: azurermResourceGroupExample.location,
name: "example-pip",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPublicIpExample.overrideLogicalId("example");
new azurerm.subnet.Subnet(this, "backend", {
address_prefixes: ["10.254.2.0/24"],
name: "backend",
resource_group_name: azurermResourceGroupExample.name,
virtual_network_name: azurermVirtualNetworkExample.name,
});
const azurermSubnetFrontend = new azurerm.subnet.Subnet(this, "frontend", {
address_prefixes: ["10.254.0.0/24"],
name: "frontend",
resource_group_name: azurermResourceGroupExample.name,
virtual_network_name: azurermVirtualNetworkExample.name,
});
new azurerm.applicationGateway.ApplicationGateway(this, "network", {
backend_address_pool: [
{
name: backendAddressPoolName,
},
],
backend_http_settings: [
{
cookie_based_affinity: "Disabled",
name: httpSettingName,
path: "/path1/",
port: 80,
protocol: "Http",
request_timeout: 60,
},
],
frontend_ip_configuration: [
{
name: frontendIpConfigurationName,
public_ip_address_id: azurermPublicIpExample.id,
},
],
frontend_port: [
{
name: frontendPortName,
port: 80,
},
],
gateway_ip_configuration: [
{
name: "my-gateway-ip-configuration",
subnet_id: azurermSubnetFrontend.id,
},
],
http_listener: [
{
frontend_ip_configuration_name: frontendIpConfigurationName,
frontend_port_name: frontendPortName,
name: listenerName,
protocol: "Http",
},
],
location: azurermResourceGroupExample.location,
name: "example-appgateway",
request_routing_rule: [
{
backend_address_pool_name: backendAddressPoolName,
backend_http_settings_name: httpSettingName,
http_listener_name: listenerName,
name: requestRoutingRuleName,
rule_type: "Basic",
},
],
resource_group_name: azurermResourceGroupExample.name,
sku: [
{
capacity: 2,
name: "Standard_Small",
tier: "Standard",
},
],
});
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the Application Gateway. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the resource group in which to the Application Gateway should exist. Changing this forces a new resource to be created. -
location
- (Required) The Azure region where the Application Gateway should exist. Changing this forces a new resource to be created. -
backendAddressPool
- (Required) One or morebackendAddressPool
blocks as defined below. -
backendHttpSettings
- (Required) One or morebackendHttpSettings
blocks as defined below. -
frontendIpConfiguration
- (Required) One or morefrontendIpConfiguration
blocks as defined below. -
frontendPort
- (Required) One or morefrontendPort
blocks as defined below. -
gatewayIpConfiguration
- (Required) One or moregatewayIpConfiguration
blocks as defined below. -
httpListener
- (Required) One or morehttpListener
blocks as defined below. -
fipsEnabled
- (Optional) Is FIPS enabled on the Application Gateway? -
global
- (Optional) Aglobal
block as defined below. -
identity
- (Optional) Anidentity
block as defined below. -
privateLinkConfiguration
- (Optional) One or moreprivateLinkConfiguration
blocks as defined below. -
requestRoutingRule
- (Required) One or morerequestRoutingRule
blocks as defined below. -
sku
- (Required) Asku
block as defined below. -
zones
- (Optional) Specifies a list of Availability Zones in which this Application Gateway should be located. Changing this forces a new Application Gateway to be created. -
trustedClientCertificate
- (Optional) One or moretrustedClientCertificate
blocks as defined below. -
sslProfile
- (Optional) One or moresslProfile
blocks as defined below.
-> Please Note: Availability Zones are only supported in several regions at this time. They are also only supported for v2 SKUs
-
authenticationCertificate
- (Optional) One or moreauthenticationCertificate
blocks as defined below. -
trustedRootCertificate
- (Optional) One or moretrustedRootCertificate
blocks as defined below. -
sslPolicy
- (Optional) asslPolicy
block as defined below. -
enableHttp2
- (Optional) Is HTTP2 enabled on the application gateway resource? Defaults tofalse
. -
forceFirewallPolicyAssociation
- (Optional) Is the Firewall Policy associated with the Application Gateway? -
probe
- (Optional) One or moreprobe
blocks as defined below. -
sslCertificate
- (Optional) One or moresslCertificate
blocks as defined below. -
tags
- (Optional) A mapping of tags to assign to the resource. -
urlPathMap
- (Optional) One or moreurlPathMap
blocks as defined below. -
wafConfiguration
- (Optional) AwafConfiguration
block as defined below. -
customErrorConfiguration
- (Optional) One or morecustomErrorConfiguration
blocks as defined below. -
firewallPolicyId
- (Optional) The ID of the Web Application Firewall Policy. -
redirectConfiguration
- (Optional) One or moreredirectConfiguration
blocks as defined below. -
autoscaleConfiguration
- (Optional) AautoscaleConfiguration
block as defined below. -
rewriteRuleSet
- (Optional) One or morerewriteRuleSet
blocks as defined below. Only valid for v2 SKUs.
A authenticationCertificate
block supports the following:
-
name
- (Required) The Name of the Authentication Certificate to use. -
data
- (Required) The contents of the Authentication Certificate which should be used.
A trustedRootCertificate
block supports the following:
-
name
- (Required) The Name of the Trusted Root Certificate to use. -
data
- (Optional) The contents of the Trusted Root Certificate which should be used. Required ifkeyVaultSecretId
is not set. -
keyVaultSecretId
- (Optional) The Secret ID of (base-64 encoded unencrypted pfx)secret
orcertificate
object stored in Azure KeyVault. You need to enable soft delete for the Key Vault to use this feature. Required ifdata
is not set.
-> NOTE: TLS termination with Key Vault certificates is limited to the v2 SKUs.
-> NOTE: For TLS termination with Key Vault certificates to work properly existing user-assigned managed identity, which Application Gateway uses to retrieve certificates from Key Vault, should be defined via identity
block. Additionally, access policies in the Key Vault to allow the identity to be granted get access to the secret should be defined.
A authenticationCertificate
block, within the backendHttpSettings
block supports the following:
name
- (Required) The name of the Authentication Certificate.
A backendAddressPool
block supports the following:
-
name
- (Required) The name of the Backend Address Pool. -
fqdns
- (Optional) A list of FQDN's which should be part of the Backend Address Pool. -
ipAddresses
- (Optional) A list of IP Addresses which should be part of the Backend Address Pool.
A backendHttpSettings
block supports the following:
-
cookieBasedAffinity
- (Required) Is Cookie-Based Affinity enabled? Possible values areenabled
anddisabled
. -
affinityCookieName
- (Optional) The name of the affinity cookie. -
name
- (Required) The name of the Backend HTTP Settings Collection. -
path
- (Optional) The Path which should be used as a prefix for all HTTP requests. -
port
- (Required) The port which should be used for this Backend HTTP Settings Collection. -
probeName
- (Optional) The name of an associated HTTP Probe. -
protocol
- (Required) The Protocol which should be used. Possible values arehttp
andhttps
. -
requestTimeout
- (Optional) The request timeout in seconds, which must be between 1 and 86400 seconds. Defaults to30
. -
hostName
- (Optional) Host header to be sent to the backend servers. Cannot be set ifpickHostNameFromBackendAddress
is set totrue
. -
pickHostNameFromBackendAddress
- (Optional) Whether host header should be picked from the host name of the backend server. Defaults tofalse
. -
authenticationCertificate
- (Optional) One or moreauthenticationCertificate
blocks as defined below. -
trustedRootCertificateNames
- (Optional) A list oftrustedRootCertificate
names. -
connectionDraining
- (Optional) AconnectionDraining
block as defined below.
A connectionDraining
block supports the following:
-
enabled
- (Required) If connection draining is enabled or not. -
drainTimeoutSec
- (Required) The number of seconds connection draining is active. Acceptable values are from1
second to3600
seconds.
A frontendIpConfiguration
block supports the following:
-
name
- (Required) The name of the Frontend IP Configuration. -
subnetId
- (Optional) The ID of the Subnet. -
privateIpAddress
- (Optional) The Private IP Address to use for the Application Gateway. -
publicIpAddressId
- (Optional) The ID of a Public IP Address which the Application Gateway should use. The allocation method for the Public IP Address depends on thesku
of this Application Gateway. Please refer to the Azure documentation for public IP addresses for details. -
privateIpAddressAllocation
- (Optional) The Allocation Method for the Private IP Address. Possible values aredynamic
andstatic
. -
privateLinkConfigurationName
- (Optional) The name of the private link configuration to use for this frontend IP configuration.
A frontendPort
block supports the following:
-
name
- (Required) The name of the Frontend Port. -
port
- (Required) The port used for this Frontend Port.
A gatewayIpConfiguration
block supports the following:
-
name
- (Required) The Name of this Gateway IP Configuration. -
subnetId
- (Required) The ID of the Subnet which the Application Gateway should be connected to.
A httpListener
block supports the following:
-
name
- (Required) The Name of the HTTP Listener. -
frontendIpConfigurationName
- (Required) The Name of the Frontend IP Configuration used for this HTTP Listener. -
frontendPortName
- (Required) The Name of the Frontend Port use for this HTTP Listener. -
hostName
- (Optional) The Hostname which should be used for this HTTP Listener. Setting this value changes Listener Type to 'Multi site'. -
hostNames
- (Optional) A list of Hostname(s) should be used for this HTTP Listener. It allows special wildcard characters.
-> NOTE The hostNames
and hostName
are mutually exclusive and cannot both be set.
-
protocol
- (Required) The Protocol to use for this HTTP Listener. Possible values arehttp
andhttps
. -
requireSni
- (Optional) Should Server Name Indication be Required? -
sslCertificateName
- (Optional) The name of the associated SSL Certificate which should be used for this HTTP Listener. -
customErrorConfiguration
- (Optional) One or morecustomErrorConfiguration
blocks as defined below. -
firewallPolicyId
- (Optional) The ID of the Web Application Firewall Policy which should be used for this HTTP Listener. -
sslProfileName
- (Optional) The name of the associated SSL Profile which should be used for this HTTP Listener.
An identity
block supports the following:
-
type
- (Required) Specifies the type of Managed Service Identity that should be configured on this Application Gateway. Only possible value isuserAssigned
. -
identityIds
- (Required) Specifies a list of User Assigned Managed Identity IDs to be assigned to this Application Gateway.
A privateLinkConfiguration
block supports the following:
-
name
- (Required) The name of the private link configuration. -
ipConfiguration
- (Required) One or moreipConfiguration
blocks as defined below.
-> Please Note: The allowApplicationGatewayPrivateLink
feature must be registered on the subscription before enabling private link
An ipConfiguration
block supports the following:
-
name
- (Required) The name of the IP configuration. -
subnetId
- (Required) The ID of the subnet the private link configuration should connect to. -
privateIpAddressAllocation
- (Required) The allocation method used for the Private IP Address. Possible values aredynamic
andstatic
. -
primary
- (Required) Is this the Primary IP Configuration? -
privateIpAddress
- (Optional) The Static IP Address which should be used.
A match
block supports the following:
-
body
- (Optional) A snippet from the Response Body which must be present in the Response. -
statusCode
- (Required) A list of allowed status codes for this Health Probe.
A pathRule
block supports the following:
-
name
- (Required) The Name of the Path Rule. -
paths
- (Required) A list of Paths used in this Path Rule. -
backendAddressPoolName
- (Optional) The Name of the Backend Address Pool to use for this Path Rule. Cannot be set ifredirectConfigurationName
is set. -
backendHttpSettingsName
- (Optional) The Name of the Backend HTTP Settings Collection to use for this Path Rule. Cannot be set ifredirectConfigurationName
is set. -
redirectConfigurationName
- (Optional) The Name of a Redirect Configuration to use for this Path Rule. Cannot be set ifbackendAddressPoolName
orbackendHttpSettingsName
is set. -
rewriteRuleSetName
- (Optional) The Name of the Rewrite Rule Set which should be used for this URL Path Map. Only valid for v2 SKUs. -
firewallPolicyId
- (Optional) The ID of the Web Application Firewall Policy which should be used as a HTTP Listener.
A probe
block support the following:
-
host
- (Optional) The Hostname used for this Probe. If the Application Gateway is configured for a single site, by default the Host name should be specified as ‘127.0.0.1’, unless otherwise configured in custom probe. Cannot be set ifpickHostNameFromBackendHttpSettings
is set totrue
. -
interval
- (Required) The Interval between two consecutive probes in seconds. Possible values range from 1 second to a maximum of 86,400 seconds. -
name
- (Required) The Name of the Probe. -
protocol
- (Required) The Protocol used for this Probe. Possible values arehttp
andhttps
. -
path
- (Required) The Path used for this Probe. -
timeout
- (Required) The Timeout used for this Probe, which indicates when a probe becomes unhealthy. Possible values range from 1 second to a maximum of 86,400 seconds. -
unhealthyThreshold
- (Required) The Unhealthy Threshold for this Probe, which indicates the amount of retries which should be attempted before a node is deemed unhealthy. Possible values are from 1 to 20. -
port
- (Optional) Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from HTTP settings will be used. This property is valid for Standard_v2 and WAF_v2 only. -
pickHostNameFromBackendHttpSettings
- (Optional) Whether the host header should be picked from the backend HTTP settings. Defaults tofalse
. -
match
- (Optional) Amatch
block as defined above. -
minimumServers
- (Optional) The minimum number of servers that are always marked as healthy. Defaults to0
.
A requestRoutingRule
block supports the following:
-
name
- (Required) The Name of this Request Routing Rule. -
ruleType
- (Required) The Type of Routing that should be used for this Rule. Possible values arebasic
andpathBasedRouting
. -
httpListenerName
- (Required) The Name of the HTTP Listener which should be used for this Routing Rule. -
backendAddressPoolName
- (Optional) The Name of the Backend Address Pool which should be used for this Routing Rule. Cannot be set ifredirectConfigurationName
is set. -
backendHttpSettingsName
- (Optional) The Name of the Backend HTTP Settings Collection which should be used for this Routing Rule. Cannot be set ifredirectConfigurationName
is set. -
redirectConfigurationName
- (Optional) The Name of the Redirect Configuration which should be used for this Routing Rule. Cannot be set if eitherbackendAddressPoolName
orbackendHttpSettingsName
is set. -
rewriteRuleSetName
- (Optional) The Name of the Rewrite Rule Set which should be used for this Routing Rule. Only valid for v2 SKUs.
-> NOTE: backendAddressPoolName
, backendHttpSettingsName
, redirectConfigurationName
, and rewriteRuleSetName
are applicable only when ruleType
is basic
.
-
urlPathMapName
- (Optional) The Name of the URL Path Map which should be associated with this Routing Rule. -
priority
- (Optional) Rule evaluation order can be dictated by specifying an integer value from1
to20000
with1
being the highest priority and20000
being the lowest priority.
-> NOTE: priority
is required when sku0Tier
is set to *V2
.
A global
block supports the following:
-
requestBufferingEnabled
- (Required) Whether Application Gateway's Request buffer is enabled. -
responseBufferingEnabled
- (Required) Whether Application Gateway's Response buffer is enabled.
A sku
block supports the following:
-
name
- (Required) The Name of the SKU to use for this Application Gateway. Possible values arestandardSmall
,standardMedium
,standardLarge
,standardV2
,wafMedium
,wafLarge
, andwafV2
. -
tier
- (Required) The Tier of the SKU to use for this Application Gateway. Possible values arestandard
,standardV2
,waf
andwafV2
. -
capacity
- (Optional) The Capacity of the SKU to use for this Application Gateway. When using a V1 SKU this value must be between 1 and 32, and 1 to 125 for a V2 SKU. This property is optional ifautoscaleConfiguration
is set.
A sslCertificate
block supports the following:
-
name
- (Required) The Name of the SSL certificate that is unique within this Application Gateway -
data
- (Optional) PFX certificate. Required ifkeyVaultSecretId
is not set. -
password
- (Optional) Password for the pfx file specified in data. Required ifdata
is set. -
keyVaultSecretId
- (Optional) Secret Id of (base-64 encoded unencrypted pfx)secret
orcertificate
object stored in Azure KeyVault. You need to enable soft delete for keyvault to use this feature. Required ifdata
is not set.
-> NOTE: TLS termination with Key Vault certificates is limited to the v2 SKUs.
-> NOTE: For TLS termination with Key Vault certificates to work properly existing user-assigned managed identity, which Application Gateway uses to retrieve certificates from Key Vault, should be defined via identity
block. Additionally, access policies in the Key Vault to allow the identity to be granted get access to the secret should be defined.
A urlPathMap
block supports the following:
-
name
- (Required) The Name of the URL Path Map. -
defaultBackendAddressPoolName
- (Optional) The Name of the Default Backend Address Pool which should be used for this URL Path Map. Cannot be set ifdefaultRedirectConfigurationName
is set. -
defaultBackendHttpSettingsName
- (Optional) The Name of the Default Backend HTTP Settings Collection which should be used for this URL Path Map. Cannot be set ifdefaultRedirectConfigurationName
is set. -
defaultRedirectConfigurationName
- (Optional) The Name of the Default Redirect Configuration which should be used for this URL Path Map. Cannot be set if eitherdefaultBackendAddressPoolName
ordefaultBackendHttpSettingsName
is set.
-> NOTE: Both defaultBackendAddressPoolName
and defaultBackendHttpSettingsName
or defaultRedirectConfigurationName
should be specified.
-
defaultRewriteRuleSetName
- (Optional) The Name of the Default Rewrite Rule Set which should be used for this URL Path Map. Only valid for v2 SKUs. -
pathRule
- (Required) One or morepathRule
blocks as defined above.
A trustedClientCertificate
block supports the following:
-
name
- (Required) The name of the Trusted Client Certificate that is unique within this Application Gateway. -
data
- (Required) The base-64 encoded certificate.
A sslProfile
block supports the following:
-
name
- (Required) The name of the SSL Profile that is unique within this Application Gateway. -
trustedClientCertificateNames
- (Optional) The name of the Trusted Client Certificate that will be used to authenticate requests from clients. -
verifyClientCertIssuerDn
- (Optional) Should client certificate issuer DN be verified? Defaults tofalse
. -
sslPolicy
- (Optional) asslPolicy
block as defined below.
A sslPolicy
block supports the following:
disabledProtocols
- (Optional) A list of SSL Protocols which should be disabled on this Application Gateway. Possible values aretlSv10
,tlSv11
,tlSv12
andtlSv13
.
\~> NOTE: disabledProtocols
cannot be set when policyName
or policyType
are set.
policyType
- (Optional) The Type of the Policy. Possible values arepredefined
,custom
andcustomV2
.
\~> NOTE: policyType
is Required when policyName
is set - cannot be set if disabledProtocols
is set.
When using a policyType
of predefined
the following fields are supported:
policyName
- (Optional) The Name of the Policy e.g AppGwSslPolicy20170401S. Required ifpolicyType
is set topredefined
. Possible values can change over time and are published here https://docs.microsoft.com/azure/application-gateway/application-gateway-ssl-policy-overview. Not compatible withdisabledProtocols
.
When using a policyType
of custom
the following fields are supported:
-
cipherSuites
- (Optional) A List of accepted cipher suites. Possible values are:tlsDheDssWith3DesEdeCbcSha
,tlsDheDssWithAes128CbcSha
,tlsDheDssWithAes128CbcSha256
,tlsDheDssWithAes256CbcSha
,tlsDheDssWithAes256CbcSha256
,tlsDheRsaWithAes128CbcSha
,tlsDheRsaWithAes128GcmSha256
,tlsDheRsaWithAes256CbcSha
,tlsDheRsaWithAes256GcmSha384
,tlsEcdheEcdsaWithAes128CbcSha
,tlsEcdheEcdsaWithAes128CbcSha256
,tlsEcdheEcdsaWithAes128GcmSha256
,tlsEcdheEcdsaWithAes256CbcSha
,tlsEcdheEcdsaWithAes256CbcSha384
,tlsEcdheEcdsaWithAes256GcmSha384
,tlsEcdheRsaWithAes128CbcSha
,tlsEcdheRsaWithAes128CbcSha256
,tlsEcdheRsaWithAes128GcmSha256
,tlsEcdheRsaWithAes256CbcSha
,tlsEcdheRsaWithAes256CbcSha384
,tlsEcdheRsaWithAes256GcmSha384
,tlsRsaWith3DesEdeCbcSha
,tlsRsaWithAes128CbcSha
,tlsRsaWithAes128CbcSha256
,tlsRsaWithAes128GcmSha256
,tlsRsaWithAes256CbcSha
,tlsRsaWithAes256CbcSha256
andtlsRsaWithAes256GcmSha384
. -
minProtocolVersion
- (Optional) The minimal TLS version. Possible values aretlSv10
,tlSv11
,tlSv12
andtlSv13
.
A wafConfiguration
block supports the following:
-
enabled
- (Required) Is the Web Application Firewall enabled? -
firewallMode
- (Required) The Web Application Firewall Mode. Possible values aredetection
andprevention
. -
ruleSetType
- (Optional) The Type of the Rule Set used for this Web Application Firewall. Possible values areowasp
andmicrosoftBotManagerRuleSet
. -
ruleSetVersion
- (Required) The Version of the Rule Set used for this Web Application Firewall. Possible values are01
,10
,229
,30
,31
and32
. -
disabledRuleGroup
- (Optional) one or moredisabledRuleGroup
blocks as defined below. -
fileUploadLimitMb
- (Optional) The File Upload Limit in MB. Accepted values are in the range1
MB to750
MB for thewafV2
SKU, and1
MB to500
MB for all other SKUs. Defaults to100
MB. -
requestBodyCheck
- (Optional) Is Request Body Inspection enabled? Defaults totrue
. -
maxRequestBodySizeKb
- (Optional) The Maximum Request Body Size in KB. Accepted values are in the range1
KB to128
KB. Defaults to128
KB. -
exclusion
- (Optional) one or moreexclusion
blocks as defined below.
A disabledRuleGroup
block supports the following:
-
ruleGroupName
- (Required) The rule group where specific rules should be disabled. Possible values arebadBots
,crs20ProtocolViolations
,crs21ProtocolAnomalies
,crs23RequestLimits
,crs30HttpPolicy
,crs35BadRobots
,crs40GenericAttacks
,crs41SqlInjectionAttacks
,crs41XssAttacks
,crs42TightSecurity
,crs45Trojans
,general
,goodBots
,knownCvEs
,request911MethodEnforcement
,request913ScannerDetection
,request920ProtocolEnforcement
,request921ProtocolAttack
,request930ApplicationAttackLfi
,request931ApplicationAttackRfi
,request932ApplicationAttackRce
,request933ApplicationAttackPhp
,request941ApplicationAttackXss
,request942ApplicationAttackSqli
,request943ApplicationAttackSessionFixation
,request944ApplicationAttackJava
andunknownBots
. -
rules
- (Optional) A list of rules which should be disabled in that group. Disables all rules in the specified group ifrules
is not specified.
A exclusion
block supports the following:
-
matchVariable
- (Required) Match variable of the exclusion rule to exclude header, cookie or GET arguments. Possible values arerequestArgKeys
,requestArgNames
,requestArgValues
,requestCookieKeys
,requestCookieNames
,requestCookieValues
,requestHeaderKeys
,requestHeaderNames
andrequestHeaderValues
-
selectorMatchOperator
- (Optional) Operator which will be used to search in the variable content. Possible values arecontains
,endsWith
,equals
,equalsAny
andstartsWith
. If empty will exclude all traffic on thismatchVariable
-
selector
- (Optional) String value which will be used for the filter operation. If empty will exclude all traffic on thismatchVariable
A customErrorConfiguration
block supports the following:
-
statusCode
- (Required) Status code of the application gateway customer error. Possible values arehttpStatus403
andhttpStatus502
-
customErrorPageUrl
- (Required) Error page URL of the application gateway customer error.
A redirectConfiguration
block supports the following:
-
name
- (Required) Unique name of the redirect configuration block -
redirectType
- (Required) The type of redirect. Possible values arepermanent
,temporary
,found
andseeOther
-
targetListenerName
- (Optional) The name of the listener to redirect to. Cannot be set iftargetUrl
is set. -
targetUrl
- (Optional) The Url to redirect the request to. Cannot be set iftargetListenerName
is set. -
includePath
- (Optional) Whether or not to include the path in the redirected Url. Defaults tofalse
-
includeQueryString
- (Optional) Whether or not to include the query string in the redirected Url. Default tofalse
A autoscaleConfiguration
block supports the following:
-
minCapacity
- (Required) Minimum capacity for autoscaling. Accepted values are in the range0
to100
. -
maxCapacity
- (Optional) Maximum capacity for autoscaling. Accepted values are in the range2
to125
.
A rewriteRuleSet
block supports the following:
-
name
- (Required) Unique name of the rewrite rule set block -
rewriteRule
- (Optional) One or morerewriteRule
blocks as defined above.
A rewriteRule
block supports the following:
-
name
- (Required) Unique name of the rewrite rule block -
ruleSequence
- (Required) Rule sequence of the rewrite rule that determines the order of execution in a set. -
condition
- (Optional) One or morecondition
blocks as defined above. -
requestHeaderConfiguration
- (Optional) One or morerequestHeaderConfiguration
blocks as defined above. -
responseHeaderConfiguration
- (Optional) One or moreresponseHeaderConfiguration
blocks as defined above. -
url
- (Optional) Oneurl
block as defined below
A condition
block supports the following:
-
variable
- (Required) The variable of the condition. -
pattern
- (Required) The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. -
ignoreCase
- (Optional) Perform a case in-sensitive comparison. Defaults tofalse
-
negate
- (Optional) Negate the result of the condition evaluation. Defaults tofalse
A requestHeaderConfiguration
block supports the following:
-
headerName
- (Required) Header name of the header configuration. -
headerValue
- (Required) Header value of the header configuration. To delete a request header set this property to an empty string.
A responseHeaderConfiguration
block supports the following:
-
headerName
- (Required) Header name of the header configuration. -
headerValue
- (Required) Header value of the header configuration. To delete a response header set this property to an empty string.
A url
block supports the following:
-
path
- (Optional) The URL path to rewrite. -
queryString
- (Optional) The query string to rewrite. -
components
- (Optional) The components used to rewrite the URL. Possible values arepathOnly
andqueryStringOnly
to limit the rewrite to the URL Path or URL Query String only.
\~> Note: One or both of path
and queryString
must be specified. If one of these is not specified, it means the value will be empty. If you only want to rewrite path
or queryString
, use components
.
reroute
- (Optional) Whether the URL path map should be reevaluated after this rewrite has been applied. More info on rewrite configutation
Attributes Reference
The following attributes are exported:
-
id
- The ID of the Application Gateway. -
authenticationCertificate
- A list ofauthenticationCertificate
blocks as defined below. -
backendAddressPool
- A list ofbackendAddressPool
blocks as defined below. -
backendHttpSettings
- A list ofbackendHttpSettings
blocks as defined below. -
frontendIpConfiguration
- A list offrontendIpConfiguration
blocks as defined below. -
frontendPort
- A list offrontendPort
blocks as defined below. -
gatewayIpConfiguration
- A list ofgatewayIpConfiguration
blocks as defined below. -
enableHttp2
- (Optional) Is HTTP2 enabled on the application gateway resource? -
httpListener
- A list ofhttpListener
blocks as defined below. -
privateEndpointConnection
- A list ofprivateEndpointConnection
blocks as defined below. -
privateLinkConfiguration
- A list ofprivateLinkConfiguration
blocks as defined below. -
probe
- Aprobe
block as defined below. -
requestRoutingRule
- A list ofrequestRoutingRule
blocks as defined below. -
sslCertificate
- A list ofsslCertificate
blocks as defined below. -
urlPathMap
- A list ofurlPathMap
blocks as defined below. -
customErrorConfiguration
- A list ofcustomErrorConfiguration
blocks as defined below. -
redirectConfiguration
- A list ofredirectConfiguration
blocks as defined below.
A authenticationCertificate
block exports the following:
id
- The ID of the Authentication Certificate.
A authenticationCertificate
block, within the backendHttpSettings
block exports the following:
id
- The ID of the Authentication Certificate.
A backendAddressPool
block exports the following:
id
- The ID of the Backend Address Pool.
A backendHttpSettings
block exports the following:
-
id
- The ID of the Backend HTTP Settings Configuration. -
probeId
- The ID of the associated Probe.
A frontendIpConfiguration
block exports the following:
-
id
- The ID of the Frontend IP Configuration. -
privateLinkConfigurationId
- The ID of the associated private link configuration.
A frontendPort
block exports the following:
id
- The ID of the Frontend Port.
A gatewayIpConfiguration
block exports the following:
id
- The ID of the Gateway IP Configuration.
A httpListener
block exports the following:
-
id
- The ID of the HTTP Listener. -
frontendIpConfigurationId
- The ID of the associated Frontend Configuration. -
frontendPortId
- The ID of the associated Frontend Port. -
sslCertificateId
- The ID of the associated SSL Certificate. -
sslProfileId
- The ID of the associated SSL Profile.
A pathRule
block exports the following:
-
id
- The ID of the Path Rule. -
backendAddressPoolId
- The ID of the Backend Address Pool used in this Path Rule. -
backendHttpSettingsId
- The ID of the Backend HTTP Settings Collection used in this Path Rule. -
redirectConfigurationId
- The ID of the Redirect Configuration used in this Path Rule. -
rewriteRuleSetId
- The ID of the Rewrite Rule Set used in this Path Rule.
A privateEndpointConnection
block exports the following:
-
name
- The name of the private endpoint connection. -
id
- The ID of the private endpoint connection.
A privateLinkConfiguration
block exports the following:
id
- The ID of the private link configuration.
A probe
block exports the following:
id
- The ID of the Probe.
A requestRoutingRule
block exports the following:
-
id
- The ID of the Request Routing Rule. -
httpListenerId
- The ID of the associated HTTP Listener. -
backendAddressPoolId
- The ID of the associated Backend Address Pool. -
backendHttpSettingsId
- The ID of the associated Backend HTTP Settings Configuration. -
redirectConfigurationId
- The ID of the associated Redirect Configuration. -
rewriteRuleSetId
- The ID of the associated Rewrite Rule Set. -
urlPathMapId
- The ID of the associated URL Path Map.
A sslCertificate
block exports the following:
-
id
- The ID of the SSL Certificate. -
publicCertData
- The Public Certificate Data associated with the SSL Certificate.
A urlPathMap
block exports the following:
-
id
- The ID of the URL Path Map. -
defaultBackendAddressPoolId
- The ID of the Default Backend Address Pool. -
defaultBackendHttpSettingsId
- The ID of the Default Backend HTTP Settings Collection. -
defaultRedirectConfigurationId
- The ID of the Default Redirect Configuration. -
pathRule
- (Required) A list ofpathRule
blocks as defined above.
A customErrorConfiguration
block exports the following:
id
- The ID of the Custom Error Configuration.
A redirectConfiguration
block exports the following:
id
- The ID of the Redirect Configuration.
A rewriteRuleSet
block exports the following:
id
- The ID of the Rewrite Rule Set
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 90 minutes) Used when creating the Application Gateway.update
- (Defaults to 90 minutes) Used when updating the Application Gateway.read
- (Defaults to 5 minutes) Used when retrieving the Application Gateway.delete
- (Defaults to 90 minutes) Used when deleting the Application Gateway.
Import
Application Gateway's can be imported using the resourceId
, e.g.