Consul on AWS Elastic Container Service (ECS) Configuration Reference
This topic describes configuration options for the JSON configuration format used
consul-ecs binary. This configuration is passed to the
binary as a string using the
CONSUL_ECS_CONFIG_JSON environment variable.
This configuration format follows a JSON schema that can be used for validation.
mesh-task Terraform module provides input variables for commonly used fields.
The following table shows which Terraform input variables correspond to each field
of the Consul ECS configuration. Refer to the
Terraform registry documentation
for a complete reference of supported input variables for the
|Terraform Input Variable||Consul ECS Config Field|
Each of these Terraform input variables follow the Consul ECS config schema.
The remaining fields of the Consul ECS configuration not listed in this table can be passed
consul_ecs_config input variable.
These are the top-level fields for the Consul ECS configuration format.
|required||The directory at which to mount the shared volume where Envoy bootstrap configuration is written by |
|optional||The file path of the Consul server CA certificate.|
|optional||The HTTP(S) URL of the Consul server. Required when |
|optional||Configuration for logging into the AWS IAM auth method.|
|optional||Configuration for the gateway proxy registration.|
|optional||The names of containers that will have health check status synced from ECS into Consul. Cannot be specified with |
|optional||Sets the log level for the |
|optional||Configuration for the sidecar proxy registration with Consul.|
|optional||Configuration for Consul service registration.|
Configuration for logging into the AWS IAM auth method.
|optional||Enables logging into Consul's AWS IAM auth method to obtain an ACL token. The auth method must be configured on the Consul server and the ECS task role must be trusted by the auth method. After logging in, the token is written to the file |
|optional||Additional CLI flags to pass to the |
|optional||Adds the |
|optional||The name of Consul auth method. This is passed as the |
Configuration for the gateway proxy registration.
|required||Specifies the type of gateway to register. Must be |
|optional||LAN address and port for the gateway. If not specified, defaults to the task/node address.|
|optional||Key-value pairs of metadata to include for the gateway.|
|optional||The name the gateway will be registered as in Consul. Defaults to the Task family name.|
|optional||Enterprise Consul namespace in which the gateway will be registered.|
|optional||Enterprise Consul admin partition in which the gateway will be registered.|
|optional||Object that contains the proxy parameters.|
|optional||List of string values that can be used to add labels to the gateway.|
|optional||WAN address and port for the gateway. If not specified, defaults to the task/node address.|
LAN address and port for the gateway. If not specified, defaults to the task/node address.
Object that contains the proxy parameters.
WAN address and port for the gateway. If not specified, defaults to the task/node address.
Configuration for the sidecar proxy registration with Consul.
|optional||Object value that specifies an opaque JSON configuration. The JSON is stored and returned along with the service instance when called from the API.|
|optional||Specifies the mesh gateway configuration for the proxy.|
|optional||The list of the upstream services that the proxy should create listeners for.|
Specifies the mesh gateway configuration for the proxy.
|required||Specifies how upstreams with a remote destination datacenter are resolved. Must be one of |
The list of the upstream services that the proxy should create listeners for. Each
upstream object may contain the following fields.
|optional||Specifies opaque configuration options that will be provided to the proxy instance for the upstream.|
|optional||Specifies the datacenter to issue the discovery query to.|
|required||Specifies the name of the upstream service or prepared query to route the service mesh to.|
|optional||Enterprise Specifies the namespace containing the upstream service.|
|optional||Enterprise Specifies the name of the admin partition containing the upstream service.|
|optional||Specifies the type of discovery query the proxy should use for finding service mesh instances. Must be one of |
|optional||Specifies the address to bind a local listener to.|
|required||Specifies the port to bind a local listener to. The application will make outbound connections to the upstream from the local port.|
|optional||Specifies the mesh gateway configuration for the proxy for this upstream.|
Specifies the mesh gateway configuration for the proxy for this upstream.
|required||Specifies how the upstream with a remote destination datacenter gets resolved. Must be one of |
Configuration for Consul service registration.
|optional||The list of Consul checks for the service. Cannot be specified with |
|optional||Determines if the anti-entropy feature for the service is enabled|
|optional||Key-value pairs of metadata to include for the Consul service.|
|optional||The name the service will be registered as in Consul. Defaults to the Task family name if empty or null.|
|optional||Enterprise The Consul namespace where the service will be registered.|
|optional||Enterprise The Consul admin partition where the service will be registered.|
|required||Port the application listens on, if any.|
|optional||List of string values that can be used to add service-level labels.|
|optional||Configures the weight of the service in terms of its DNS service (SRV) response.|
Defines the Consul checks for the service. Each
check object may contain the following fields.
|optional||Specifies the ID of the node for an alias check.|
|optional||Specifies the ID of a service for an alias check.|
|optional||Command arguments to run to update the status of the check.|
|optional||Specifies a body that should be sent with |
|optional||The unique ID for this check on the node. Defaults to the check |
|optional||Specifies the number of consecutive unsuccessful results required before check status transitions to critical.|
|optional||Specifies a |
|optional||Specifies whether to use TLS for this gRPC health check.|
|optional||Specifies this is an h2ping check. Must be an address, which will be pinged every |
|optional||Specifies whether TLS is used for an h2ping check.|
|optional||Specifies a set of headers that should be set for HTTP checks. Each header can have multiple values.|
|optional||Specifies this is an HTTP check. Must be a URL against which request is performed every |
|optional||Specifies the frequency at which to run this check. Required for HTTP, TCP, and UDP checks.|
|optional||Specifies the HTTP method to be used for an HTTP check. When no value is specified, |
|optional||The name of the check.|
|optional||Specifies arbitrary information for humans. This is not used by Consul internally.|
|optional||Specifies the name of a service on which to perform an OS service check. The check runs according the frequency specified in the |
|optional||Specifies the initial status the health check. Must be one of |
|optional||Specifies the number of consecutive successful results required before check status transitions to passing.|
|optional||Specifies this is a TCP check. Must be an IP/hostname plus port to which a TCP connection is made every |
|optional||Specifies whether to use TLS for this |
|optional||Specifies a timeout for outgoing connections. Applies to script, HTTP, TCP, UDP, and gRPC checks. Must be a duration string, such as |
|optional||Specifies an optional string used to set the SNI host when connecting via TLS.|
|optional||Specifies if the check should verify the chain and hostname of the certificate presented by the server being checked. Set to |
|optional||Specifies this is a TTL check. Must be a duration string, such as |
|optional||Specifies this is a UDP check. Must be an IP/hostname plus port to which UDP datagrams are sent every |
Configures the weight of the service in terms of its DNS service (SRV) response.
|required||Weight for the service when its health checks are passing.|
|required||Weight for the service when it has health checks in |