Azion IaC

O arquivo azion.config.js é um arquivo de configuração de IaC criado durante o processo de build da aplicação, com base no preset selecionado, e serve como a fonte de verdade para a configuração. Cada preset fornece um conjunto de configurações padrão, que podem ser substituídas pelo usuário. Se o arquivo for excluído, a configuração padrão será recriada na próxima vez que o processo de build for disparado.

As configurações definidas por este arquivo incluem:

  • Origins
  • Cache Settings
  • Rules Engine
  • Network List

As tabelas a seguir explicam as propriedades deste arquivo de configuração.


domain

PropriedadeTipoValores esperadosMensagem de erro
namestring
cnameAccessOnlyboolean
cnamesarray
edgeApplicationIdnumber
edgeFirewallIdnumber
digitalCertificateIdstring, nulllets_encrypt or null
mtlsobject
mtls -> verificationstringenforce or permissive
mtls -> trustedCaCertificateIdnumber
mtls -> crlListarray

origin

PropriedadeTipoValores esperadosMensagem de erro
namestringThe ‘name’ field must be a string
typestringsingle_origin (default)
load_balancer
live_ingest**
object_storage
The ‘type’ field must be a string
bucketstring, nullThe ‘bucket’ field must be a string or null
prefixstring, nullThe ‘prefix’ field must be a string or null
addressesarrayThe ‘address’ field must be a string
hostHeaderstringThe ‘hostHeader’ field must be a string
additionalPropertiesbooleanNo additional properties are allowed in origin item objects
protocolPolicystringpreserve (default)
https
http
The ‘protocolPolicy’ field must be a string
hostHeaderstringThe ‘hostHeader’ field must be a string
connectionTimeoutnumberThe ‘connectionTimeout’ field must be a number
timeoutBetweenBytesnumberThe ‘timeoutBetweenBytes’ field must be a number
redirectionbooleanThe ‘redirection’ field must be a boolean
hmacobjectThe ‘hmac’ field must be an object
hmac -> regionstringThe ‘region’ field must be a string
hmac -> accessKeystringThe ‘accessKey’ field must be a string
hmac -> secretKeystringThe ‘secretKey’ field must be a string
bucketstring, nullThe ‘bucket’ field must be a string or null
prefixstring, nullThe ‘prefix’ field must be a string or null
additionalPropertiesbooleanNo additional properties are allowed in origin item objects

cache

PropriedadeTipoValores esperadosMensagem de erro
namestringThe ‘name’ field must be a string
stalebooleanThe ‘stale’ field must be a boolean
queryStringSortbooleanThe ‘queryStringSort’ field must be a boolean
methods -> postbooleanThe ‘post’ field must be a boolean
methods -> optionsbooleanThe ‘options’ field must be a boolean
methods -> additionalPropertiesbooleanNo additional properties are allowed in the ‘methods’ object
browser -> maxAgeSecondsnumber OR string (mathematical expression)0 ≤ value ≥ 31536000The ‘maxAgeSeconds’ field must be a number or a valid mathematical expression
browser -> additionalPropertiesbooleanNo additional properties are allowed in the ‘browser’ object
browser -> requiredarrayThe ‘maxAgeSeconds’ field is required in the ‘browser’ object
edge -> maxAgeSecondsnumber OR string (a mathematical expression)60 ≤ value ≥ 31536000The ‘maxAgeSeconds’ field must be a number or a valid mathematical expression
edge -> additionalPropertiesbooleanNo additional properties are allowed in the ‘edge’ object
edge -> requiredarrayThe ‘maxAgeSeconds’ field is required in the ‘edge’ object

rules

Request rules

| Propriedade | Tipo | Valores esperados | Mensagem de erro | |----------------|----------------|---------------------------------------------------------------------------------------------------------------| | name | string | The ‘name’ field must be a string | | match | string | The ‘match’ field must be a string | | setOrigin -> name | string | The ‘name’ field must be a string | | setOrigin -> type | string | The ‘type’ field must be a string | | setOrigin -> additionalProperties | boolean | No additional properties are allowed in the ‘setOrigin’ object | | setOrigin -> required | array | The ‘name or type’ field is required in the ‘setOrigin’ object | | behavior -> rewrite | function | The behavior of the rewrite | | setHeaders | string, null | The ‘setHeaders’ field must be a string or null | | forwardCookies | boolean, null | The ‘forwardCookies’ field must be a boolean or null | | setCookie | string, null | The ‘setCookie’ field must be a string or null | | deliver | boolean, null | The ‘deliver’ field must be a boolean or null | | runFunction -> path | string | The ‘path’ field must be a string | | runFunction -> name | string, null | The ‘name’ field can be a string or null | | runFunction -> additionalProperties | boolean | No additional properties are allowed in the ‘runFunction’ object | | runFunction -> required | array | The ‘path’ field is required in the ‘runFunction’ object | | cache | string OR object | The ‘cache’ field must be either a string or an object with specified properties | | cache -> name (when cache is an object) | string | The ‘name’ field must be a string | | cache -> browser_cache_settings_maximum_ttl (when cache is an object) | number, null | The ‘browser_cache_settings_maximum_ttl’ field must be a number or null | | cache -> cdn_cache_settings_maximum_ttl (when cache is an object) | number, null | The ‘cdn_cache_settings_maximum_ttl’ field must be a number or null | | cache -> additionalProperties (when cache is an object) | boolean | No additional properties are allowed in the cache object | | cache -> required (when cache is an object) | array | The ‘name’ field is required in the cache object | | redirectTo301 | string | The ‘redirectTo301’ field must be a string | | enableGZIP | boolean | The ‘enableGZIP’ field must be a boolean | | redirectTo302 | string | The ‘redirectTo302’ field must be a string | | filterCookie | string | The ‘filterCookie’ field must be a string | | variable | string | The ‘variable’ field must be a string | | bypassCache | boolean | The ‘bypassCache’ field must be a boolean | | redirectHttps | boolean | The ‘redirectHttps’ field must be a boolean |

Response rules

PropertyTypeError message
namestringThe ‘name’ field must be a string
descriptionstringThe ‘description’ field must be a string
activebooleanThe ‘active’ field must be a boolean
matchstringThe ‘match’ field must be a string
variablestringThe ‘variable’ field must be a string
behavior -> setCookiestring, nullThe ‘setCookie’ field must be a string or null
behavior -> setHeadersarray of stringsEach item in ‘setHeaders’ must be a string
behavior -> deliverboolean, nullThe ‘deliver’ field must be a boolean or null
behavior -> capture -> matchstringThe ‘match’ field must be a string
behavior -> capture -> capturedstringThe ‘captured’ field must be a string
behavior -> capture -> subjectstringThe ‘subject’ field must be a string
behavior -> enableGZIPboolean, nullThe ‘enableGZIP’ field must be a boolean or null
behavior -> filterCookiestring, nullThe ‘filterCookie’ field must be a string or null
behavior -> filterHeaderstring, nullThe ‘filterHeader’ field must be a string or null
behavior -> runFunction -> pathstringThe ‘path’ field must be a string
behavior -> runFunction -> namestring, nullThe ‘name’ field can be a string or null
behavior -> redirectTo301string, nullThe ‘redirectTo301’ field must be a string or null
behavior -> redirectTo302string, nullThe ‘redirectTo302’ field must be a string or null

lista de redes

PropriedadeTipoMensagem de erro
idnúmeroO campo ‘id’ deve ser um número
listTypestringO campo ‘listType’ deve ser uma string
listContentarrayO campo ‘listContent’ deve ser uma array de strings

Para mais informações, acesse o esquema do azion.config.js no repositório Azion Bundler.


purge

PropriedadetipoValores esperadosMensagem de erro
typestringurl, cachekey, wildcard
urlsarray
methodstring

Exemplo

Acesse o arquivo de exemplo do IaC

Contribuidores