octodns.source.envvar
¶
- exception octodns.source.envvar.EnvironmentVariableNotFoundException(data)[source]¶
Bases:
EnvVarSourceException
- class octodns.source.envvar.EnvVarSource(id, variable, name, ttl=60)[source]¶
Bases:
BaseSource
This source allows for environment variables to be embedded at octodns execution time into zones. Intended to capture artifacts of deployment to facilitate operational objectives.
The TXT record generated will only have a single value.
The record name cannot conflict with any other co-existing sources. If this occurs, an exception will be thrown.
- Possible use cases include:
Embedding a version number into a TXT record to monitor update propagation across authoritative providers.
Capturing identifying information about the deployment process to record where and when the zone was updated.
version: class: octodns.source.envvar.EnvVarSource # The environment variable in question, in this example the username # currently executing octodns variable: USER # The TXT record name to embed the value found at the above # environment variable name: deployuser # The TTL of the TXT record (optional, default 60) ttl: 3600
This source is then combined with other sources in the octodns config file:
zones: netflix.com.: sources: - yaml - version targets: - ultra - ns1
- SUPPORTS_GEO = False¶
- SUPPORTS_DYNAMIC = False¶
- SUPPORTS = {'T', 'X'}¶
- DEFAULT_TTL = 60¶
- populate(zone, target=False, lenient=False)[source]¶
Loads all records the provider knows about for the provided zone
When target is True the populate call is being made to load the current state of the provider.
When lenient is True the populate call may skip record validation and do a “best effort” load of data. That will allow through some common, but not best practices stuff that we otherwise would reject. E.g. no trailing . or missing escapes for ;.
When target is True (loading current state) this method should return True if the zone exists or False if it does not.