DbCluster class
Resource for managing an Amazon Timestream for InfluxDB read-replica cluster.
> NOTE: This resource requires a subscription to Timestream for InfluxDB Read Replicas (Add-On) on the AWS Marketplace.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.timestreaminfluxdb.DbCluster("example", {
allocatedStorage: 20,
bucket: "example-bucket-name",
dbInstanceType: "db.influx.medium",
failoverMode: "AUTOMATIC",
username: "admin",
password: "example-password",
port: 8086,
organization: "organization",
vpcSubnetIds: [
example1.id,
example2.id,
],
vpcSecurityGroupIds: [exampleAwsSecurityGroup.id],
name: "example-db-cluster",
});
import pulumi
import pulumi_aws as aws
example = aws.timestreaminfluxdb.DbCluster("example",
allocated_storage=20,
bucket="example-bucket-name",
db_instance_type="db.influx.medium",
failover_mode="AUTOMATIC",
username="admin",
password="example-password",
port=8086,
organization="organization",
vpc_subnet_ids=[
example1["id"],
example2["id"],
],
vpc_security_group_ids=[example_aws_security_group["id"]],
name="example-db-cluster")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.TimestreamInfluxDB.DbCluster("example", new()
{
AllocatedStorage = 20,
Bucket = "example-bucket-name",
DbInstanceType = "db.influx.medium",
FailoverMode = "AUTOMATIC",
Username = "admin",
Password = "example-password",
Port = 8086,
Organization = "organization",
VpcSubnetIds = new[]
{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds = new[]
{
exampleAwsSecurityGroup.Id,
},
Name = "example-db-cluster",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/timestreaminfluxdb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := timestreaminfluxdb.NewDbCluster(ctx, "example", ×treaminfluxdb.DbClusterArgs{
AllocatedStorage: pulumi.Int(20),
Bucket: pulumi.String("example-bucket-name"),
DbInstanceType: pulumi.String("db.influx.medium"),
FailoverMode: pulumi.String("AUTOMATIC"),
Username: pulumi.String("admin"),
Password: pulumi.String("example-password"),
Port: pulumi.Int(8086),
Organization: pulumi.String("organization"),
VpcSubnetIds: pulumi.StringArray{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds: pulumi.StringArray{
exampleAwsSecurityGroup.Id,
},
Name: pulumi.String("example-db-cluster"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_timestreaminfluxdb_dbcluster" "example" {
allocated_storage = 20
bucket = "example-bucket-name"
db_instance_type = "db.influx.medium"
failover_mode = "AUTOMATIC"
username = "admin"
password = "example-password"
port = 8086
organization = "organization"
vpc_subnet_ids = [example1.id, example2.id]
vpc_security_group_ids = [exampleAwsSecurityGroup.id]
name = "example-db-cluster"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.timestreaminfluxdb.DbCluster;
import com.pulumi.aws.timestreaminfluxdb.DbClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new DbCluster("example", DbClusterArgs.builder()
.allocatedStorage(20)
.bucket("example-bucket-name")
.dbInstanceType("db.influx.medium")
.failoverMode("AUTOMATIC")
.username("admin")
.password("example-password")
.port(8086)
.organization("organization")
.vpcSubnetIds(
example1.id(),
example2.id())
.vpcSecurityGroupIds(exampleAwsSecurityGroup.id())
.name("example-db-cluster")
.build());
}
}
resources:
example:
type: aws:timestreaminfluxdb:DbCluster
properties:
allocatedStorage: 20
bucket: example-bucket-name
dbInstanceType: db.influx.medium
failoverMode: AUTOMATIC
username: admin
password: example-password
port: 8086
organization: organization
vpcSubnetIds:
- ${example1.id}
- ${example2.id}
vpcSecurityGroupIds:
- ${exampleAwsSecurityGroup.id}
name: example-db-cluster
Usage with Prerequisite Resources
All Timestream for InfluxDB clusters require a VPC, at least two subnets, and a security group. The following example shows how these prerequisite resources can be created and used with aws.timestreaminfluxdb.DbCluster.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"});
const example1 = new aws.ec2.Subnet("example_1", {
vpcId: example.id,
cidrBlock: "10.0.1.0/24",
});
const example2 = new aws.ec2.Subnet("example_2", {
vpcId: example.id,
cidrBlock: "10.0.2.0/24",
});
const exampleSecurityGroup = new aws.ec2.SecurityGroup("example", {
name: "example",
vpcId: example.id,
});
const exampleDbCluster = new aws.timestreaminfluxdb.DbCluster("example", {
allocatedStorage: 20,
bucket: "example-bucket-name",
dbInstanceType: "db.influx.medium",
username: "admin",
password: "example-password",
organization: "organization",
vpcSubnetIds: [
example1.id,
example2.id,
],
vpcSecurityGroupIds: [exampleSecurityGroup.id],
name: "example-db-cluster",
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.Vpc("example", cidr_block="10.0.0.0/16")
example1 = aws.ec2.Subnet("example_1",
vpc_id=example.id,
cidr_block="10.0.1.0/24")
example2 = aws.ec2.Subnet("example_2",
vpc_id=example.id,
cidr_block="10.0.2.0/24")
example_security_group = aws.ec2.SecurityGroup("example",
name="example",
vpc_id=example.id)
example_db_cluster = aws.timestreaminfluxdb.DbCluster("example",
allocated_storage=20,
bucket="example-bucket-name",
db_instance_type="db.influx.medium",
username="admin",
password="example-password",
organization="organization",
vpc_subnet_ids=[
example1.id,
example2.id,
],
vpc_security_group_ids=[example_security_group.id],
name="example-db-cluster")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.Vpc("example", new()
{
CidrBlock = "10.0.0.0/16",
});
var example1 = new Aws.Ec2.Subnet("example_1", new()
{
VpcId = example.Id,
CidrBlock = "10.0.1.0/24",
});
var example2 = new Aws.Ec2.Subnet("example_2", new()
{
VpcId = example.Id,
CidrBlock = "10.0.2.0/24",
});
var exampleSecurityGroup = new Aws.Ec2.SecurityGroup("example", new()
{
Name = "example",
VpcId = example.Id,
});
var exampleDbCluster = new Aws.TimestreamInfluxDB.DbCluster("example", new()
{
AllocatedStorage = 20,
Bucket = "example-bucket-name",
DbInstanceType = "db.influx.medium",
Username = "admin",
Password = "example-password",
Organization = "organization",
VpcSubnetIds = new[]
{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds = new[]
{
exampleSecurityGroup.Id,
},
Name = "example-db-cluster",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/timestreaminfluxdb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
example1, err := ec2.NewSubnet(ctx, "example_1", &ec2.SubnetArgs{
VpcId: example.ID().ToIDOutput().ToStringOutput(),
CidrBlock: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
example2, err := ec2.NewSubnet(ctx, "example_2", &ec2.SubnetArgs{
VpcId: example.ID().ToIDOutput().ToStringOutput(),
CidrBlock: pulumi.String("10.0.2.0/24"),
})
if err != nil {
return err
}
exampleSecurityGroup, err := ec2.NewSecurityGroup(ctx, "example", &ec2.SecurityGroupArgs{
Name: pulumi.String("example"),
VpcId: example.ID().ToIDOutput().ToStringOutput(),
})
if err != nil {
return err
}
_, err = timestreaminfluxdb.NewDbCluster(ctx, "example", ×treaminfluxdb.DbClusterArgs{
AllocatedStorage: pulumi.Int(20),
Bucket: pulumi.String("example-bucket-name"),
DbInstanceType: pulumi.String("db.influx.medium"),
Username: pulumi.String("admin"),
Password: pulumi.String("example-password"),
Organization: pulumi.String("organization"),
VpcSubnetIds: pulumi.StringArray{
example1.ID().ToIDOutput().ToStringOutput(),
example2.ID().ToIDOutput().ToStringOutput(),
},
VpcSecurityGroupIds: pulumi.StringArray{
exampleSecurityGroup.ID().ToIDOutput().ToStringOutput(),
},
Name: pulumi.String("example-db-cluster"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_ec2_vpc" "example" {
cidr_block = "10.0.0.0/16"
}
resource "aws_ec2_subnet" "example_1" {
vpc_id = aws_ec2_vpc.example.id
cidr_block = "10.0.1.0/24"
}
resource "aws_ec2_subnet" "example_2" {
vpc_id = aws_ec2_vpc.example.id
cidr_block = "10.0.2.0/24"
}
resource "aws_ec2_securitygroup" "example" {
name = "example"
vpc_id = aws_ec2_vpc.example.id
}
resource "aws_timestreaminfluxdb_dbcluster" "example" {
allocated_storage = 20
bucket = "example-bucket-name"
db_instance_type = "db.influx.medium"
username = "admin"
password = "example-password"
organization = "organization"
vpc_subnet_ids = [aws_ec2_subnet.example_1.id, aws_ec2_subnet.example_2.id]
vpc_security_group_ids = [aws_ec2_securitygroup.example.id]
name = "example-db-cluster"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.ec2.Subnet;
import com.pulumi.aws.ec2.SubnetArgs;
import com.pulumi.aws.ec2.SecurityGroup;
import com.pulumi.aws.ec2.SecurityGroupArgs;
import com.pulumi.aws.timestreaminfluxdb.DbCluster;
import com.pulumi.aws.timestreaminfluxdb.DbClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Vpc("example", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var example1 = new Subnet("example1", SubnetArgs.builder()
.vpcId(example.id())
.cidrBlock("10.0.1.0/24")
.build());
var example2 = new Subnet("example2", SubnetArgs.builder()
.vpcId(example.id())
.cidrBlock("10.0.2.0/24")
.build());
var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
.name("example")
.vpcId(example.id())
.build());
var exampleDbCluster = new DbCluster("exampleDbCluster", DbClusterArgs.builder()
.allocatedStorage(20)
.bucket("example-bucket-name")
.dbInstanceType("db.influx.medium")
.username("admin")
.password("example-password")
.organization("organization")
.vpcSubnetIds(
example1.id(),
example2.id())
.vpcSecurityGroupIds(exampleSecurityGroup.id())
.name("example-db-cluster")
.build());
}
}
resources:
example:
type: aws:ec2:Vpc
properties:
cidrBlock: 10.0.0.0/16
example1:
type: aws:ec2:Subnet
name: example_1
properties:
vpcId: ${example.id}
cidrBlock: 10.0.1.0/24
example2:
type: aws:ec2:Subnet
name: example_2
properties:
vpcId: ${example.id}
cidrBlock: 10.0.2.0/24
exampleSecurityGroup:
type: aws:ec2:SecurityGroup
name: example
properties:
name: example
vpcId: ${example.id}
exampleDbCluster:
type: aws:timestreaminfluxdb:DbCluster
name: example
properties:
allocatedStorage: 20
bucket: example-bucket-name
dbInstanceType: db.influx.medium
username: admin
password: example-password
organization: organization
vpcSubnetIds:
- ${example1.id}
- ${example2.id}
vpcSecurityGroupIds:
- ${exampleSecurityGroup.id}
name: example-db-cluster
Usage with S3 Log Delivery Enabled
You can use an S3 bucket to store logs generated by your Timestream for InfluxDB cluster. The following example shows what resources and arguments are required to configure an S3 bucket for logging, including the IAM policy that needs to be set in order to allow Timestream for InfluxDB to place logs in your S3 bucket. The configuration of the required VPC, security group, and subnets have been left out of the example for brevity.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleBucket = new aws.s3.Bucket("example", {
bucket: "example-s3-bucket",
forceDestroy: true,
});
const example = aws.iam.getPolicyDocumentOutput({
statements: [{
principals: [{
type: "Service",
identifiers: ["timestream-influxdb.amazonaws.com"],
}],
actions: ["s3:PutObject"],
resources: [pulumi.interpolate`${exampleBucket.arn}/*`],
}],
});
const exampleBucketPolicy = new aws.s3.BucketPolicy("example", {
bucket: exampleBucket.id,
policy: example.json,
});
const exampleDbCluster = new aws.timestreaminfluxdb.DbCluster("example", {
logDeliveryConfiguration: {
s3Configuration: {
bucketName: exampleBucket.bucket,
enabled: true,
},
},
allocatedStorage: 20,
bucket: "example-bucket-name",
dbInstanceType: "db.influx.medium",
username: "admin",
password: "example-password",
organization: "organization",
vpcSubnetIds: [
example1.id,
example2.id,
],
vpcSecurityGroupIds: [exampleAwsSecurityGroup.id],
name: "example-db-cluster",
});
import pulumi
import pulumi_aws as aws
example_bucket = aws.s3.Bucket("example",
bucket="example-s3-bucket",
force_destroy=True)
example = aws.iam.get_policy_document_output(statements=[{
"principals": [{
"type": "Service",
"identifiers": ["timestream-influxdb.amazonaws.com"],
}],
"actions": ["s3:PutObject"],
"resources": [example_bucket.arn.apply(lambda arn: f"{arn}/*")],
}])
example_bucket_policy = aws.s3.BucketPolicy("example",
bucket=example_bucket.id,
policy=example.json)
example_db_cluster = aws.timestreaminfluxdb.DbCluster("example",
log_delivery_configuration={
"s3_configuration": {
"bucket_name": example_bucket.bucket,
"enabled": True,
},
},
allocated_storage=20,
bucket="example-bucket-name",
db_instance_type="db.influx.medium",
username="admin",
password="example-password",
organization="organization",
vpc_subnet_ids=[
example1["id"],
example2["id"],
],
vpc_security_group_ids=[example_aws_security_group["id"]],
name="example-db-cluster")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleBucket = new Aws.S3.Bucket("example", new()
{
BucketName = "example-s3-bucket",
ForceDestroy = true,
});
var example = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "Service",
Identifiers = new[]
{
"timestream-influxdb.amazonaws.com",
},
},
},
Actions = new[]
{
"s3:PutObject",
},
Resources = new[]
{
$"{exampleBucket.Arn}/*",
},
},
},
});
var exampleBucketPolicy = new Aws.S3.BucketPolicy("example", new()
{
Bucket = exampleBucket.Id,
Policy = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var exampleDbCluster = new Aws.TimestreamInfluxDB.DbCluster("example", new()
{
LogDeliveryConfiguration = new Aws.TimestreamInfluxDB.Inputs.DbClusterLogDeliveryConfigurationArgs
{
S3Configuration = new Aws.TimestreamInfluxDB.Inputs.DbClusterLogDeliveryConfigurationS3ConfigurationArgs
{
BucketName = exampleBucket.BucketName,
Enabled = true,
},
},
AllocatedStorage = 20,
Bucket = "example-bucket-name",
DbInstanceType = "db.influx.medium",
Username = "admin",
Password = "example-password",
Organization = "organization",
VpcSubnetIds = new[]
{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds = new[]
{
exampleAwsSecurityGroup.Id,
},
Name = "example-db-cluster",
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/timestreaminfluxdb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleBucket, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
Bucket: pulumi.String("example-s3-bucket"),
ForceDestroy: pulumi.Bool(true),
})
if err != nil {
return err
}
example := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
Statements: iam.GetPolicyDocumentStatementArray{
&iam.GetPolicyDocumentStatementArgs{
Principals: iam.GetPolicyDocumentStatementPrincipalArray{
&iam.GetPolicyDocumentStatementPrincipalArgs{
Type: pulumi.String("Service"),
Identifiers: pulumi.StringArray{
pulumi.String("timestream-influxdb.amazonaws.com"),
},
},
},
Actions: pulumi.StringArray{
pulumi.String("s3:PutObject"),
},
Resources: pulumi.StringArray{
exampleBucket.Arn.ApplyT(func(arn string) (string, error) {
return fmt.Sprintf("%v/*", arn), nil
}).(pulumi.StringOutput),
},
},
},
}, nil)
_, err = s3.NewBucketPolicy(ctx, "example", &s3.BucketPolicyArgs{
Bucket: exampleBucket.ID().ToIDOutput().ToStringOutput(),
Policy: example.Json(),
})
if err != nil {
return err
}
_, err = timestreaminfluxdb.NewDbCluster(ctx, "example", ×treaminfluxdb.DbClusterArgs{
LogDeliveryConfiguration: ×treaminfluxdb.DbClusterLogDeliveryConfigurationArgs{
S3Configuration: ×treaminfluxdb.DbClusterLogDeliveryConfigurationS3ConfigurationArgs{
BucketName: exampleBucket.Bucket,
Enabled: pulumi.Bool(true),
},
},
AllocatedStorage: pulumi.Int(20),
Bucket: pulumi.String("example-bucket-name"),
DbInstanceType: pulumi.String("db.influx.medium"),
Username: pulumi.String("admin"),
Password: pulumi.String("example-password"),
Organization: pulumi.String("organization"),
VpcSubnetIds: pulumi.StringArray{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds: pulumi.StringArray{
exampleAwsSecurityGroup.Id,
},
Name: pulumi.String("example-db-cluster"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_iam_getpolicydocument" "example" {
statements {
principals {
type = "Service"
identifiers = ["timestream-influxdb.amazonaws.com"]
}
actions = ["s3:PutObject"]
resources = ["${aws_s3_bucket.example.arn}/*"]
}
}
resource "aws_s3_bucket" "example" {
bucket = "example-s3-bucket"
force_destroy = true
}
resource "aws_s3_bucketpolicy" "example" {
bucket = aws_s3_bucket.example.id
policy = data.aws_iam_getpolicydocument.example.json
}
resource "aws_timestreaminfluxdb_dbcluster" "example" {
log_delivery_configuration = {
s3_configuration = {
bucket_name = aws_s3_bucket.example.bucket
enabled = true
}
}
allocated_storage = 20
bucket = "example-bucket-name"
db_instance_type = "db.influx.medium"
username = "admin"
password = "example-password"
organization = "organization"
vpc_subnet_ids = [example1.id, example2.id]
vpc_security_group_ids = [exampleAwsSecurityGroup.id]
name = "example-db-cluster"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs;
import com.pulumi.aws.s3.BucketPolicy;
import com.pulumi.aws.s3.BucketPolicyArgs;
import com.pulumi.aws.timestreaminfluxdb.DbCluster;
import com.pulumi.aws.timestreaminfluxdb.DbClusterArgs;
import com.pulumi.aws.timestreaminfluxdb.inputs.DbClusterLogDeliveryConfigurationArgs;
import com.pulumi.aws.timestreaminfluxdb.inputs.DbClusterLogDeliveryConfigurationS3ConfigurationArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 exampleBucket = new Bucket("exampleBucket", BucketArgs.builder()
.bucket("example-s3-bucket")
.forceDestroy(true)
.build());
final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("timestream-influxdb.amazonaws.com")
.build())
.actions("s3:PutObject")
.resources(exampleBucket.arn().applyValue(_arn -> String.format("%s/*", _arn)))
.build())
.build());
var exampleBucketPolicy = new BucketPolicy("exampleBucketPolicy", BucketPolicyArgs.builder()
.bucket(exampleBucket.id())
.policy(example.applyValue(_example -> _example.json()))
.build());
var exampleDbCluster = new DbCluster("exampleDbCluster", DbClusterArgs.builder()
.logDeliveryConfiguration(DbClusterLogDeliveryConfigurationArgs.builder()
.s3Configuration(DbClusterLogDeliveryConfigurationS3ConfigurationArgs.builder()
.bucketName(exampleBucket.bucket())
.enabled(true)
.build())
.build())
.allocatedStorage(20)
.bucket("example-bucket-name")
.dbInstanceType("db.influx.medium")
.username("admin")
.password("example-password")
.organization("organization")
.vpcSubnetIds(
example1.id(),
example2.id())
.vpcSecurityGroupIds(exampleAwsSecurityGroup.id())
.name("example-db-cluster")
.build());
}
}
resources:
exampleBucket:
type: aws:s3:Bucket
name: example
properties:
bucket: example-s3-bucket
forceDestroy: true
exampleBucketPolicy:
type: aws:s3:BucketPolicy
name: example
properties:
bucket: ${exampleBucket.id}
policy: ${example.json}
exampleDbCluster:
type: aws:timestreaminfluxdb:DbCluster
name: example
properties:
logDeliveryConfiguration:
s3Configuration:
bucketName: ${exampleBucket.bucket}
enabled: true
allocatedStorage: 20
bucket: example-bucket-name
dbInstanceType: db.influx.medium
username: admin
password: example-password
organization: organization
vpcSubnetIds:
- ${example1.id}
- ${example2.id}
vpcSecurityGroupIds:
- ${exampleAwsSecurityGroup.id}
name: example-db-cluster
variables:
example:
fn::invoke:
function: aws:iam:getPolicyDocument
arguments:
statements:
- principals:
- type: Service
identifiers:
- timestream-influxdb.amazonaws.com
actions:
- s3:PutObject
resources:
- ${exampleBucket.arn}/*
Usage with InfluxDB V3
For InfluxDB V3 clusters, you can create a cluster without providing allocatedStorage, bucket, organization, username, password, or deploymentType by specifying a dbParameterGroupIdentifier such as "InfluxDBV3Core". You can also optionally configure a maintenance schedule.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.timestreaminfluxdb.DbCluster("example", {
maintenanceSchedule: {
preferredMaintenanceWindow: "Sun:02:00-Sun:06:00",
timezone: "America/New_York",
},
name: "example-v3-cluster",
dbInstanceType: "db.influx.large",
dbParameterGroupIdentifier: "InfluxDBV3Core",
vpcSubnetIds: [
example1.id,
example2.id,
],
vpcSecurityGroupIds: [exampleAwsSecurityGroup.id],
});
import pulumi
import pulumi_aws as aws
example = aws.timestreaminfluxdb.DbCluster("example",
maintenance_schedule={
"preferred_maintenance_window": "Sun:02:00-Sun:06:00",
"timezone": "America/New_York",
},
name="example-v3-cluster",
db_instance_type="db.influx.large",
db_parameter_group_identifier="InfluxDBV3Core",
vpc_subnet_ids=[
example1["id"],
example2["id"],
],
vpc_security_group_ids=[example_aws_security_group["id"]])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.TimestreamInfluxDB.DbCluster("example", new()
{
MaintenanceSchedule = new Aws.TimestreamInfluxDB.Inputs.DbClusterMaintenanceScheduleArgs
{
PreferredMaintenanceWindow = "Sun:02:00-Sun:06:00",
Timezone = "America/New_York",
},
Name = "example-v3-cluster",
DbInstanceType = "db.influx.large",
DbParameterGroupIdentifier = "InfluxDBV3Core",
VpcSubnetIds = new[]
{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds = new[]
{
exampleAwsSecurityGroup.Id,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/timestreaminfluxdb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := timestreaminfluxdb.NewDbCluster(ctx, "example", ×treaminfluxdb.DbClusterArgs{
MaintenanceSchedule: ×treaminfluxdb.DbClusterMaintenanceScheduleArgs{
PreferredMaintenanceWindow: pulumi.String("Sun:02:00-Sun:06:00"),
Timezone: pulumi.String("America/New_York"),
},
Name: pulumi.String("example-v3-cluster"),
DbInstanceType: pulumi.String("db.influx.large"),
DbParameterGroupIdentifier: pulumi.String("InfluxDBV3Core"),
VpcSubnetIds: pulumi.StringArray{
example1.Id,
example2.Id,
},
VpcSecurityGroupIds: pulumi.StringArray{
exampleAwsSecurityGroup.Id,
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_timestreaminfluxdb_dbcluster" "example" {
maintenance_schedule = {
preferred_maintenance_window = "Sun:02:00-Sun:06:00"
timezone = "America/New_York"
}
name = "example-v3-cluster"
db_instance_type = "db.influx.large"
db_parameter_group_identifier = "InfluxDBV3Core"
vpc_subnet_ids = [example1.id, example2.id]
vpc_security_group_ids = [exampleAwsSecurityGroup.id]
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.timestreaminfluxdb.DbCluster;
import com.pulumi.aws.timestreaminfluxdb.DbClusterArgs;
import com.pulumi.aws.timestreaminfluxdb.inputs.DbClusterMaintenanceScheduleArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new DbCluster("example", DbClusterArgs.builder()
.maintenanceSchedule(DbClusterMaintenanceScheduleArgs.builder()
.preferredMaintenanceWindow("Sun:02:00-Sun:06:00")
.timezone("America/New_York")
.build())
.name("example-v3-cluster")
.dbInstanceType("db.influx.large")
.dbParameterGroupIdentifier("InfluxDBV3Core")
.vpcSubnetIds(
example1.id(),
example2.id())
.vpcSecurityGroupIds(exampleAwsSecurityGroup.id())
.build());
}
}
resources:
example:
type: aws:timestreaminfluxdb:DbCluster
properties:
maintenanceSchedule:
preferredMaintenanceWindow: Sun:02:00-Sun:06:00
timezone: America/New_York
name: example-v3-cluster
dbInstanceType: db.influx.large
dbParameterGroupIdentifier: InfluxDBV3Core
vpcSubnetIds:
- ${example1.id}
- ${example2.id}
vpcSecurityGroupIds:
- ${exampleAwsSecurityGroup.id}
Cluster Type Requirements
InfluxDB V2 Clusters (default)
The following arguments are required for InfluxDB V2 clusters:
allocatedStoragebucketdeploymentTypeorganizationpasswordusername
The deploymentType argument defaults to "MULTI_NODE_READ_REPLICAS" for InfluxDB V2 clusters when not specified.
InfluxDB V3 Clusters (when using V3 parameter groups)
The following arguments are forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group):
allocatedStoragebucketdeploymentTypeorganizationpasswordusername
Import
Identity Schema
Required
id(String) ID of the Timestream for InfluxDB cluster.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import Timestream for InfluxDB clusters using id. For example:
$ pulumi import aws:timestreaminfluxdb/dbCluster:DbCluster example hzfuy146ke
Constructors
- DbCluster(String name, {DbClusterArgs? args, CustomResourceOptions? options})
-
Creates a new DbCluster.
nameThe Pulumi resource name.argsArguments used to configure this DbCluster. The set of arguments for DbCluster.optionsResource options controlling this resource's behavior. - DbCluster.reference(String urn)
- Creates a typed reference to an existing DbCluster resource.
Properties
-
allocatedStorage
↔ Output<
int?> -
Amount of storage in GiB (gibibytes). The minimum value is
20, the maximum value is16384. The argumentdbStorageTypeplaces restrictions on this argument's minimum value. The following is a list ofdbStorageTypevalues and the corresponding minimum value forallocatedStorage:"InfluxIOIncludedT1":20,"InfluxIOIncludedT2" and"InfluxIOIncludedT3":400`. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group).latefinal -
arn
↔ Output<
String> -
ARN of the Timestream for InfluxDB cluster.
latefinal
-
bucket
↔ Output<
String?> -
Name of the initial InfluxDB bucket. All InfluxDB data is stored in a bucket. A bucket combines the concept of a database and a retention period (the duration of time that each data point persists). A bucket belongs to an organization. Along with
organization,username, andpassword, this argument will be stored in the secret referred to by theinfluxAuthParametersSecretArnattribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group).latefinal -
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
dbInstanceType
↔ Output<
String> -
Timestream for InfluxDB DB instance type to run InfluxDB on. Valid options are:
"db.influx.medium","db.influx.large","db.influx.xlarge","db.influx.2xlarge","db.influx.4xlarge","db.influx.8xlarge","db.influx.12xlarge", and"db.influx.16xlarge". This argument is updatable.latefinal -
dbParameterGroupIdentifier
↔ Output<
String?> -
ID of the DB parameter group assigned to your cluster. This argument is updatable. If added to an existing Timestream for InfluxDB cluster or given a new value, will cause an in-place update to the cluster. However, if a cluster already has a value for
dbParameterGroupIdentifier, removingdbParameterGroupIdentifierwill cause the cluster to be destroyed and recreated.latefinal -
dbStorageType
↔ Output<
String> -
Timestream for InfluxDB DB storage type to read and write InfluxDB data. You can choose between 3 different types of provisioned Influx IOPS included storage according to your workloads requirements: Influx IO Included 3000 IOPS, Influx IO Included 12000 IOPS, Influx IO Included 16000 IOPS. Valid options are:
"InfluxIOIncludedT1","InfluxIOIncludedT2", and"InfluxIOIncludedT3". If you use"InfluxIOIncludedT2" or "InfluxIOIncludedT3", the minimum value forallocatedStorage` is 400.latefinal -
deploymentType
↔ Output<
String> -
Specifies the type of cluster to create. Valid options are:
"MULTI_NODE_READ_REPLICAS". This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group).latefinal -
endpoint
↔ Output<
String> -
Endpoint used to connect to InfluxDB. The default InfluxDB port is 8086.
latefinal
-
engineType
↔ Output<
String> -
Database engine type of the DB cluster.
latefinal
-
failoverMode
↔ Output<
String> -
Specifies the behavior of failure recovery when the primary node of the cluster fails. Valid options are:
"AUTOMATIC"and"NO_FAILOVER".latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
influxAuthParametersSecretArn
↔ Output<
String> -
ARN of the AWS Secrets Manager secret containing the initial InfluxDB authorization parameters. For InfluxDB V2 clusters, the secret value is a JSON formatted key-value pair holding InfluxDB authorization values: organization, bucket, username, and password. For InfluxDB V3 clusters, the secret contains the InfluxDB admin token.
latefinal
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
logDeliveryConfiguration
↔ Output<
DbClusterLogDeliveryConfiguration?> -
Configuration for sending InfluxDB engine logs to a specified S3 bucket. This argument is updatable.
latefinal
-
maintenanceSchedule
↔ Output<
DbClusterMaintenanceSchedule?> -
Maintenance schedule for the DB cluster, including the preferred maintenance window and timezone. This argument is updatable. This field is only supported for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group).
latefinal
-
name
↔ Output<
String> -
Name that uniquely identifies the DB cluster when interacting with the Amazon Timestream for InfluxDB API and CLI commands. This name will also be a prefix included in the endpoint. Cluster names must be unique per customer and per region. The argument must start with a letter, cannot contain consecutive hyphens (
-) and cannot end with a hyphen.latefinal -
networkType
↔ Output<
String> -
Specifies whether the network type of the Timestream for InfluxDB cluster is IPV4, which can communicate over IPv4 protocol only, or DUAL, which can communicate over both IPv4 and IPv6 protocols.
latefinal
-
organization
↔ Output<
String?> -
Name of the initial organization for the initial admin user in InfluxDB. An InfluxDB organization is a workspace for a group of users. Along with
bucket,username, andpassword, this argument will be stored in the secret referred to by theinfluxAuthParametersSecretArnattribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group).latefinal -
password
↔ Output<
String?> -
Password of the initial admin user created in InfluxDB. This password will allow you to access the InfluxDB UI to perform various administrative tasks and also use the InfluxDB CLI to create an operator token. Along with
bucket,username, andorganization, this argument will be stored in the secret referred to by theinfluxAuthParametersSecretArnattribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group) as the AWS API rejects it.latefinal -
port
↔ Output<
int> -
The port on which the cluster accepts connections. Valid values:
1024-65535. Cannot be2375-2376,7788-7799,8090, or51678-51680. This argument is updatable.latefinal -
publiclyAccessible
↔ Output<
bool> -
Configures the DB cluster with a public IP to facilitate access. Other resources, such as a VPC, a subnet, an internet gateway, and a route table with routes, are also required to enabled public access, in addition to this argument. See "Usage with Public Internet Access Enabled" for an example configuration with all required resources for public internet access.
latefinal
-
readerEndpoint
↔ Output<
String> -
The endpoint used to connect to the Timestream for InfluxDB cluster for read-only operations.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
timeouts
↔ Output<
DbClusterTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
username
↔ Output<
String?> -
Username of the initial admin user created in InfluxDB. Must start with a letter and can't end with a hyphen or contain two consecutive hyphens. This username will allow you to access the InfluxDB UI to perform various administrative tasks and also use the InfluxDB CLI to create an operator token. Along with
bucket,organization, andpassword, this argument will be stored in the secret referred to by theinfluxAuthParametersSecretArnattribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 db parameter group).latefinal -
vpcSecurityGroupIds
↔ Output<
List< String> > -
List of VPC security group IDs to associate with the cluster.
latefinal
-
vpcSubnetIds
↔ Output<
List< String> > -
List of VPC subnet IDs to associate with the cluster. Provide at least two VPC subnet IDs in different availability zones when deploying with a Multi-AZ standby.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited