discovery.scaleway
discovery.scaleway
discovers targets from Scaleway instances and bare metal services.
Usage
discovery.scaleway "<LABEL>" {
project_id = "<SCALEWAY_PROJECT_ID>"
role = "<SCALEWAY_PROJECT_ROLE>"
access_key = "<SCALEWAY_ACCESS_KEY>"
secret_key = "<SCALEWAY_SECRET_KEY>"
}
Arguments
You can use the following arguments with discovery.scaleway
:
Name | Type | Description | Default | Required |
---|---|---|---|---|
access_key | string | Access key for the Scaleway API. | yes | |
project_id | string | Scaleway project ID of targets. | yes | |
role | string | Role of targets to retrieve. | yes | |
secret_key_file | string | Path to file containing secret key for the Scaleway API. | conditional | |
secret_key | secret | Secret key for the Scaleway API. | conditional | |
api_url | string | Scaleway API URL. | "https://api.scaleway.com" | no |
enable_http2 | bool | Whether HTTP2 is supported for requests. | true | no |
follow_redirects | bool | Whether redirects returned by the server should be followed. | true | no |
name_filter | string | Name filter to apply against the listing request. | no | |
no_proxy | string | Comma-separated list of IP addresses, CIDR notations, and domain names to exclude from proxying. | no | |
port | number | Default port on servers to associate with generated targets. | 80 | no |
proxy_connect_header | map(list(secret)) | Specifies headers to send to proxies during CONNECT requests. | no | |
proxy_from_environment | bool | Use the proxy URL indicated by environment variables. | false | no |
proxy_url | string | HTTP proxy to send requests through. | no | |
refresh_interval | duration | Frequency to rediscover targets. | "60s" | no |
tags_filter | list(string) | List of tags to search for. | no | |
zone | string | Availability zone of targets. | "fr-par-1" | no |
The role
argument determines what type of Scaleway machines to discover.
It must be set to one of the following:
"baremetal"
: Discover bare metal Scaleway machines."instance"
: Discover virtual Scaleway instances.
The name_filter
and tags_filter
arguments can be used to filter the set of discovered servers.
name_filter
returns machines matching a specific name, while tags_filter
returns machines who contain all the tags listed in the tags_filter
argument.
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.
Blocks
You can use the following blocks with discovery.scaleway
:
Block | Description | Required |
---|---|---|
tls_config | Configure TLS settings for connecting to the endpoint. | no |
tls_config
The tls_config
block configures TLS settings for connecting to the endpoint.
Name | Type | Description | Default | Required |
---|---|---|---|---|
ca_pem | string | CA PEM-encoded text to validate the server with. | no | |
ca_file | string | CA certificate to validate the server with. | no | |
cert_pem | string | Certificate PEM-encoded text for client authentication. | no | |
cert_file | string | Certificate file for client authentication. | no | |
insecure_skip_verify | bool | Disables validation of the server certificate. | no | |
key_file | string | Key file for client authentication. | no | |
key_pem | secret | Key PEM-encoded text for client authentication. | no | |
min_version | string | Minimum acceptable TLS version. | no | |
server_name | string | ServerName extension to indicate the name of the server. | no |
The following pairs of arguments are mutually exclusive and can’t both be set simultaneously:
ca_pem
andca_file
cert_pem
andcert_file
key_pem
andkey_file
When configuring client authentication, both the client certificate (using cert_pem
or cert_file
) and the client key (using key_pem
or key_file
) must be provided.
When min_version
isn’t provided, the minimum acceptable TLS version is inherited from Go’s default minimum version, TLS 1.2.
If min_version
is provided, it must be set to one of the following strings:
"TLS10"
(TLS 1.0)"TLS11"
(TLS 1.1)"TLS12"
(TLS 1.2)"TLS13"
(TLS 1.3)
Exported fields
The following fields are exported and can be referenced by other components:
Name | Type | Description |
---|---|---|
targets | list(map(string)) | The set of targets discovered from the Consul catalog API. |
When role
is baremetal
, discovered targets include the following labels:
__meta_scaleway_baremetal_id
: The ID of the server.__meta_scaleway_baremetal_name
: The name of the server.__meta_scaleway_baremetal_os_name
: The operating system name of the server.__meta_scaleway_baremetal_os_version
: The operating system version of the server.__meta_scaleway_baremetal_project_id
: The project ID the server belongs to.__meta_scaleway_baremetal_public_ipv4
: The public IPv4 address of the server.__meta_scaleway_baremetal_public_ipv6
: The public IPv6 address of the server.__meta_scaleway_baremetal_status
: The current status of the server.__meta_scaleway_baremetal_tags
: The list of tags associated with the server concatenated with a,
.__meta_scaleway_baremetal_type
: The commercial type of the server.__meta_scaleway_baremetal_zone
: The availability zone of the server.
When role
is instance
, discovered targets include the following labels:
__meta_scaleway_instance_boot_type
: The boot type of the server.__meta_scaleway_instance_hostname
: The hostname of the server.__meta_scaleway_instance_id
: The ID of the server.__meta_scaleway_instance_image_arch
: The architecture of the image the server is running.__meta_scaleway_instance_image_id
: The ID of the image the server is running.__meta_scaleway_instance_image_name
: The name of the image the server is running.__meta_scaleway_instance_location_cluster_id
: The ID of the cluster for the server’s location.__meta_scaleway_instance_location_hypervisor_id
: The hypervisor ID for the server’s location.__meta_scaleway_instance_location_node_id
: The node ID for the server’s location.__meta_scaleway_instance_name
: The name of the server.__meta_scaleway_instance_organization_id
: The organization ID that the server belongs to.__meta_scaleway_instance_private_ipv4
: The private IPv4 address of the server.__meta_scaleway_instance_project_id
: The project ID the server belongs to.__meta_scaleway_instance_public_ipv4
: The public IPv4 address of the server.__meta_scaleway_instance_public_ipv6
: The public IPv6 address of the server.__meta_scaleway_instance_region
: The region of the server.__meta_scaleway_instance_security_group_id
: The ID of the security group the server is assigned to.__meta_scaleway_instance_security_group_name
: The name of the security group the server is assigned to.__meta_scaleway_instance_status
: The current status of the server.__meta_scaleway_instance_tags
: The list of tags associated with the server concatenated with a,
.__meta_scaleway_instance_type
: The commercial type of the server.__meta_scaleway_instance_zone
: The availability zone of the server.
Component health
discovery.scaleway
is only reported as unhealthy when given an invalid configuration.
In those cases, exported fields retain their last healthy values.
Debug information
discovery.scaleway
doesn’t expose any component-specific debug information.
Debug metrics
discovery.scaleway
doesn’t expose any component-specific debug metrics.
Example
discovery.scaleway "example" {
project_id = "<SCALEWAY_PROJECT_ID>"
role = "<SCALEWAY_PROJECT_ROLE>"
access_key = "<SCALEWAY_ACCESS_KEY>"
secret_key = "<SCALEWAY_SECRET_KEY>"
}
prometheus.scrape "demo" {
targets = discovery.scaleway.example.targets
forward_to = [prometheus.remote_write.demo.receiver]
}
prometheus.remote_write "demo" {
endpoint {
url = "<PROMETHEUS_REMOTE_WRITE_URL>"
basic_auth {
username = "<USERNAME>"
password = "<PASSWORD>"
}
}
}
Replace the following:
<SCALEWAY_PROJECT_ID>
: The project ID of your Scaleway machines.<SCALEWAY_PROJECT_ROLE>
: Set tobaremetal
to discover bare metal machines orinstance
to discover virtual instances.<SCALEWAY_ACCESS_KEY>
: Your Scaleway API access key.<SCALEWAY_SECRET_KEY>
: Your Scaleway API secret key.<PROMETHEUS_REMOTE_WRITE_URL>
: The URL of the Prometheus remote_write-compatible server to send metrics to.<USERNAME>
: The username to use for authentication to theremote_write
API.<PASSWORD>
: The password to use for authentication to theremote_write
API.
Compatible components
discovery.scaleway
has exports that can be consumed by the following components:
- Components that consume Targets
Note
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.