2016-01-25 01:15:09 +01:00
---
layout: "consul"
page_title: "Consul: consul_agent_service"
sidebar_current: "docs-consul-resource-agent-service"
description: |-
Provides access to Agent Service data in Consul. This can be used to define a service associated with a particular agent. Currently, defining health checks for an agent service is not supported.
---
# consul\_agent\_service
2016-11-08 15:43:00 +01:00
Provides access to the agent service data in Consul. This can be used to
define a service associated with a particular agent. Currently, defining
health checks for an agent service is not supported.
2016-01-25 01:15:09 +01:00
## Example Usage
```
resource "consul_agent_service" "app" {
2017-02-18 23:48:50 +01:00
address = "www.google.com"
name = "google"
port = 80
tags = ["tag0", "tag1"]
2016-01-25 01:15:09 +01:00
}
```
## Argument Reference
The following arguments are supported:
* `address` - (Optional) The address of the service. Defaults to the
address of the agent.
* `name` - (Required) The name of the service.
* `port` - (Optional) The port of the service.
* `tags` - (Optional) A list of values that are opaque to Consul,
but can be used to distinguish between services or nodes.
## Attributes Reference
The following attributes are exported:
* `address` - The address of the service.
2016-11-08 15:43:00 +01:00
* `id` - The ID of the service, defaults to the value of `name` .
2016-01-25 01:15:09 +01:00
* `name` - The name of the service.
* `port` - The port of the service.
* `tags` - The tags of the service.