influxdb3.Database
Explore with Pulumi AI
Creates and manages a database.
Example Usage
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using InfluxDB3 = KomminarLabs.InfluxDB3;
return await Deployment.RunAsync(() =>
{
var signals = new InfluxDB3.Database("signals", new()
{
RetentionPeriod = 604800,
PartitionTemplates = new[]
{
new InfluxDB3.Inputs.DatabasePartitionTemplateArgs
{
Type = "tag",
Value = "line",
},
new InfluxDB3.Inputs.DatabasePartitionTemplateArgs
{
Type = "tag",
Value = "station",
},
new InfluxDB3.Inputs.DatabasePartitionTemplateArgs
{
Type = "time",
Value = "%Y-%m-%d",
},
new InfluxDB3.Inputs.DatabasePartitionTemplateArgs
{
Type = "bucket",
Value = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["tagName"] = "temperature",
["numberOfBuckets"] = 10,
}),
},
},
});
});
package main
import (
"encoding/json"
"github.com/komminarlabs/pulumi-influxdb3/sdk/go/influxdb3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"tagName": "temperature",
"numberOfBuckets": 10,
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = influxdb3.NewDatabase(ctx, "signals", &influxdb3.DatabaseArgs{
RetentionPeriod: pulumi.Int(604800),
PartitionTemplates: influxdb3.DatabasePartitionTemplateArray{
&influxdb3.DatabasePartitionTemplateArgs{
Type: pulumi.String("tag"),
Value: pulumi.String("line"),
},
&influxdb3.DatabasePartitionTemplateArgs{
Type: pulumi.String("tag"),
Value: pulumi.String("station"),
},
&influxdb3.DatabasePartitionTemplateArgs{
Type: pulumi.String("time"),
Value: pulumi.String("%Y-%m-%d"),
},
&influxdb3.DatabasePartitionTemplateArgs{
Type: pulumi.String("bucket"),
Value: pulumi.String(json0),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.influxdb3.Database;
import com.pulumi.influxdb3.DatabaseArgs;
import com.pulumi.influxdb3.inputs.DatabasePartitionTemplateArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var signals = new Database("signals", DatabaseArgs.builder()
.retentionPeriod(604800)
.partitionTemplates(
DatabasePartitionTemplateArgs.builder()
.type("tag")
.value("line")
.build(),
DatabasePartitionTemplateArgs.builder()
.type("tag")
.value("station")
.build(),
DatabasePartitionTemplateArgs.builder()
.type("time")
.value("%Y-%m-%d")
.build(),
DatabasePartitionTemplateArgs.builder()
.type("bucket")
.value(serializeJson(
jsonObject(
jsonProperty("tagName", "temperature"),
jsonProperty("numberOfBuckets", 10)
)))
.build())
.build());
}
}
import pulumi
import json
import komminarlabs_influxdb3 as influxdb3
signals = influxdb3.Database("signals",
retention_period=604800,
partition_templates=[
influxdb3.DatabasePartitionTemplateArgs(
type="tag",
value="line",
),
influxdb3.DatabasePartitionTemplateArgs(
type="tag",
value="station",
),
influxdb3.DatabasePartitionTemplateArgs(
type="time",
value="%Y-%m-%d",
),
influxdb3.DatabasePartitionTemplateArgs(
type="bucket",
value=json.dumps({
"tagName": "temperature",
"numberOfBuckets": 10,
}),
),
])
import * as pulumi from "@pulumi/pulumi";
import * as influxdb3 from "@komminarlabs/influxdb3";
const signals = new influxdb3.Database("signals", {
retentionPeriod: 604800,
partitionTemplates: [
{
type: "tag",
value: "line",
},
{
type: "tag",
value: "station",
},
{
type: "time",
value: "%Y-%m-%d",
},
{
type: "bucket",
value: JSON.stringify({
tagName: "temperature",
numberOfBuckets: 10,
}),
},
],
});
resources:
signals:
type: influxdb3:Database
properties:
retentionPeriod: 604800
partitionTemplates:
- type: tag
value: line
- type: tag
value: station
- type: time
value: '%Y-%m-%d'
- type: bucket
value:
fn::toJSON:
tagName: temperature
numberOfBuckets: 10
Create Database Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Database(name: string, args?: DatabaseArgs, opts?: CustomResourceOptions);
@overload
def Database(resource_name: str,
args: Optional[DatabaseArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Database(resource_name: str,
opts: Optional[ResourceOptions] = None,
max_columns_per_table: Optional[int] = None,
max_tables: Optional[int] = None,
name: Optional[str] = None,
partition_templates: Optional[Sequence[DatabasePartitionTemplateArgs]] = None,
retention_period: Optional[int] = None)
func NewDatabase(ctx *Context, name string, args *DatabaseArgs, opts ...ResourceOption) (*Database, error)
public Database(string name, DatabaseArgs? args = null, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: influxdb3:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var databaseResource = new InfluxDB3.Database("databaseResource", new()
{
MaxColumnsPerTable = 0,
MaxTables = 0,
Name = "string",
PartitionTemplates = new[]
{
new InfluxDB3.Inputs.DatabasePartitionTemplateArgs
{
Type = "string",
Value = "string",
},
},
RetentionPeriod = 0,
});
example, err := influxdb3.NewDatabase(ctx, "databaseResource", &influxdb3.DatabaseArgs{
MaxColumnsPerTable: pulumi.Int(0),
MaxTables: pulumi.Int(0),
Name: pulumi.String("string"),
PartitionTemplates: influxdb3.DatabasePartitionTemplateArray{
&influxdb3.DatabasePartitionTemplateArgs{
Type: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
RetentionPeriod: pulumi.Int(0),
})
var databaseResource = new Database("databaseResource", DatabaseArgs.builder()
.maxColumnsPerTable(0)
.maxTables(0)
.name("string")
.partitionTemplates(DatabasePartitionTemplateArgs.builder()
.type("string")
.value("string")
.build())
.retentionPeriod(0)
.build());
database_resource = influxdb3.Database("databaseResource",
max_columns_per_table=0,
max_tables=0,
name="string",
partition_templates=[{
"type": "string",
"value": "string",
}],
retention_period=0)
const databaseResource = new influxdb3.Database("databaseResource", {
maxColumnsPerTable: 0,
maxTables: 0,
name: "string",
partitionTemplates: [{
type: "string",
value: "string",
}],
retentionPeriod: 0,
});
type: influxdb3:Database
properties:
maxColumnsPerTable: 0
maxTables: 0
name: string
partitionTemplates:
- type: string
value: string
retentionPeriod: 0
Database Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Database resource accepts the following input properties:
- Max
Columns intPer Table - The maximum number of columns per table for the cluster database. The default is
200
- Max
Tables int - The maximum number of tables for the cluster database. The default is
500
- Name string
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - Partition
Templates List<KomminarLabs. Influx DB3. Inputs. Database Partition Template> - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- Retention
Period int - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- Max
Columns intPer Table - The maximum number of columns per table for the cluster database. The default is
200
- Max
Tables int - The maximum number of tables for the cluster database. The default is
500
- Name string
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - Partition
Templates []DatabasePartition Template Args - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- Retention
Period int - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- max
Columns IntegerPer Table - The maximum number of columns per table for the cluster database. The default is
200
- max
Tables Integer - The maximum number of tables for the cluster database. The default is
500
- name String
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition
Templates List<DatabasePartition Template> - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention
Period Integer - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- max
Columns numberPer Table - The maximum number of columns per table for the cluster database. The default is
200
- max
Tables number - The maximum number of tables for the cluster database. The default is
500
- name string
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition
Templates DatabasePartition Template[] - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention
Period number - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- max_
columns_ intper_ table - The maximum number of columns per table for the cluster database. The default is
200
- max_
tables int - The maximum number of tables for the cluster database. The default is
500
- name str
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition_
templates Sequence[DatabasePartition Template Args] - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention_
period int - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- max
Columns NumberPer Table - The maximum number of columns per table for the cluster database. The default is
200
- max
Tables Number - The maximum number of tables for the cluster database. The default is
500
- name String
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition
Templates List<Property Map> - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention
Period Number - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
Outputs
All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:
- account_
id str - The ID of the account that the cluster belongs to.
- cluster_
id str - The ID of the cluster that you want to manage.
- id str
- The provider-assigned unique ID for this managed resource.
Look up Existing Database Resource
Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DatabaseState, opts?: CustomResourceOptions): Database
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
cluster_id: Optional[str] = None,
max_columns_per_table: Optional[int] = None,
max_tables: Optional[int] = None,
name: Optional[str] = None,
partition_templates: Optional[Sequence[DatabasePartitionTemplateArgs]] = None,
retention_period: Optional[int] = None) -> Database
func GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)
public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)
public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Id string - The ID of the account that the cluster belongs to.
- Cluster
Id string - The ID of the cluster that you want to manage.
- Max
Columns intPer Table - The maximum number of columns per table for the cluster database. The default is
200
- Max
Tables int - The maximum number of tables for the cluster database. The default is
500
- Name string
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - Partition
Templates List<KomminarLabs. Influx DB3. Inputs. Database Partition Template> - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- Retention
Period int - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- Account
Id string - The ID of the account that the cluster belongs to.
- Cluster
Id string - The ID of the cluster that you want to manage.
- Max
Columns intPer Table - The maximum number of columns per table for the cluster database. The default is
200
- Max
Tables int - The maximum number of tables for the cluster database. The default is
500
- Name string
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - Partition
Templates []DatabasePartition Template Args - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- Retention
Period int - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- account
Id String - The ID of the account that the cluster belongs to.
- cluster
Id String - The ID of the cluster that you want to manage.
- max
Columns IntegerPer Table - The maximum number of columns per table for the cluster database. The default is
200
- max
Tables Integer - The maximum number of tables for the cluster database. The default is
500
- name String
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition
Templates List<DatabasePartition Template> - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention
Period Integer - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- account
Id string - The ID of the account that the cluster belongs to.
- cluster
Id string - The ID of the cluster that you want to manage.
- max
Columns numberPer Table - The maximum number of columns per table for the cluster database. The default is
200
- max
Tables number - The maximum number of tables for the cluster database. The default is
500
- name string
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition
Templates DatabasePartition Template[] - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention
Period number - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- account_
id str - The ID of the account that the cluster belongs to.
- cluster_
id str - The ID of the cluster that you want to manage.
- max_
columns_ intper_ table - The maximum number of columns per table for the cluster database. The default is
200
- max_
tables int - The maximum number of tables for the cluster database. The default is
500
- name str
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition_
templates Sequence[DatabasePartition Template Args] - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention_
period int - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
- account
Id String - The ID of the account that the cluster belongs to.
- cluster
Id String - The ID of the cluster that you want to manage.
- max
Columns NumberPer Table - The maximum number of columns per table for the cluster database. The default is
200
- max
Tables Number - The maximum number of tables for the cluster database. The default is
500
- name String
- The name of the cluster database. The Length should be between
[ 1 .. 64 ]
characters. Note: Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot reuse the same name for a new database. - partition
Templates List<Property Map> - A template for partitioning a cluster database. Note: A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You can't update a partition template on an existing database. An update will result in resource replacement.
- retention
Period Number - The retention period of the cluster database in nanoseconds. The default is
0
. If the retention period is not set or is set to0
, the database will have infinite retention.
Supporting Types
DatabasePartitionTemplate, DatabasePartitionTemplateArgs
Package Details
- Repository
- influxdb3 komminarlabs/pulumi-influxdb3
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
influxdb3
Terraform Provider.