github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/circonus/r/metric_cluster.html.markdown (about) 1 --- 2 layout: "circonus" 3 page_title: "Circonus: circonus_metric_cluster" 4 sidebar_current: "docs-circonus-resource-circonus_metric_cluster" 5 description: |- 6 Manages a Circonus Metric Cluster. 7 --- 8 9 # circonus\_metric\_cluster 10 11 The ``circonus_metric_cluster`` resource creates and manages a 12 [Circonus Metric Cluster](https://login.circonus.com/user/docs/Data/View/MetricClusters). 13 14 ## Usage 15 16 ```hcl 17 resource "circonus_metric_cluster" "nomad-job-memory-rss" { 18 name = "My Job's Resident Memory" 19 description = <<-EOF 20 An aggregation of all resident memory metric streams across allocations in a Nomad job. 21 EOF 22 23 query { 24 definition = "*`nomad-jobname`memory`rss" 25 type = "average" 26 } 27 tags = ["source:nomad","resource:memory"] 28 } 29 ``` 30 31 ## Argument Reference 32 33 * `description` - (Optional) A long-form description of the metric cluster. 34 35 * `name` - (Required) The name of the metric cluster. This name must be unique 36 across all metric clusters in a given Circonus Account. 37 38 * `query` - (Required) One or more `query` attributes must be present. Each 39 `query` must contain both a `definition` and a `type`. See below for details 40 on supported attributes. 41 42 * `tags` - (Optional) A list of tags attached to the metric cluster. 43 44 ## Supported Metric Cluster `query` Attributes 45 46 * `definition` - (Required) The definition of a metric cluster [query](https://login.circonus.com/resources/api/calls/metric_cluster). 47 48 * `type` - (Required) The query type to execute per metric cluster. Valid query 49 types are: `average`, `count`, `counter`, `counter2`, `counter2_stddev`, 50 `counter_stddev`, `derive`, `derive2`, `derive2_stddev`, `derive_stddev`, 51 `histogram`, `stddev`, `text`. 52 53 ## Out parameters 54 55 * `id` - ID of the Metric Cluster. 56 57 ## Import Example 58 59 `circonus_metric_cluster` supports importing resources. Supposing the following 60 Terraform: 61 62 ```hcl 63 provider "circonus" { 64 alias = "b8fec159-f9e5-4fe6-ad2c-dc1ec6751586" 65 } 66 67 resource "circonus_metric_cluster" "mymetriccluster" { 68 name = "Metric Cluster for a particular metric in a job" 69 70 query { 71 definition = "*`nomad-jobname`memory`rss" 72 type = "average" 73 } 74 } 75 ``` 76 77 It is possible to import a `circonus_metric_cluster` resource with the following 78 command: 79 80 ``` 81 $ terraform import circonus_metric_cluster.mymetriccluster ID 82 ``` 83 84 Where `ID` is the `_cid` or Circonus ID of the Metric Cluster 85 (e.g. `/metric_cluster/12345`) and `circonus_metric_cluster.mymetriccluster` is the 86 name of the resource whose state will be populated as a result of the command.