Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Files

Latest commit

da26038 · Aug 31, 2020

History

History
53 lines (41 loc) · 1.6 KB

database.html.md

File metadata and controls

53 lines (41 loc) · 1.6 KB
layout page_title sidebar_current description
influxdb
InfluxDB: influxdb_database
docs-influxdb-resource-database
The influxdb_database resource allows an InfluxDB database to be created.

influxdb_database

The database resource allows a database to be created on an InfluxDB server.

Example Usage

resource "influxdb_database" "metrics" {
  name = "awesome_app"
}

resource "influxdb_database" "metrics_aggregation" {
  name = "testdb11"
  retention_policies {
    name = "52weeks"
    duration = "52w"
    default = "true"
  }
  retention_policies {
    name = "104weeks"
    duration = "104w"
    shardgroupduration = "3d"
  }
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name for the database. This must be unique on the InfluxDB server.
  • retention_policies - (Optional) A list of retention policies for specified database

Each retention_policies supports the following:

  • name - (Required) The name of the retention policy
  • duration - (Required) The duration for retention policy, format of duration can be found at InfluxDB Documentation.
  • replication - (Optional) Determines how many copies of data points are stored in a cluster. Not applicable for single node / Open Source version of InfluxDB. Default value of 1.
  • shardgroupduration - (Optional) Determines how much time each shard group spans. How and why to modify can be found at InfluxDB Documentation.
  • default - (Optional) Marks current retention policy as default. Default value is false.

Attributes Reference

This resource exports no further attributes.