import.http
import.http retrieves a module from an HTTP server.
Use import.http to load Alloy configuration from a remote HTTP server.
The remote file must define configuration inside a declare block.
Alloy evaluates imported modules as reusable components, so the remote file must not include top-level global configuration blocks such as logging or remotecfg.
Global configuration belongs in the local configuration file that imports the module.
You must configure command-line flags outside the module.
Alloy periodically polls the URL to detect and apply configuration changes.
Refer to Load configuration from remote sources for more information.
Usage
import.http "<LABEL>" {
url = <URL>
}Arguments
You can use the following arguments with import.http:
Blocks
You can use the following blocks with import.http:
The > symbol indicates deeper levels of nesting.
For example, client > basic_auth refers to a basic_auth block defined inside a client block.
client
The client block configures settings for connecting to the HTTP server.
bearer_token, bearer_token_file, basic_auth, authorization, and oauth2 are mutually exclusive, and only one can be provided inside of a http_client_config block.
no_proxy can contain IPs, CIDR notations, and domain names. IP and domain names can contain port numbers.
proxy_url must be configured if no_proxy is configured.
proxy_from_environment uses the environment variables HTTP_PROXY, HTTPS_PROXY, and NO_PROXY (or the lowercase versions thereof).
Requests use the proxy from the environment variable matching their scheme, unless excluded by NO_PROXY.
proxy_url and no_proxy must not be configured if proxy_from_environment is configured.
proxy_connect_header should only be configured if proxy_url or proxy_from_environment are configured.
authorization
The authorization block configures custom authorization for polling the configured URL.