Class DbCluster


  • public class DbCluster
    extends com.pulumi.resources.CustomResource
    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](https://aws.amazon.com/marketplace/pp/prodview-lftzfxtb5xlv4?applicationId=AWS-Marketplace-Console&ref_=beagle&sr=0-2). ## Example Usage ### Basic Usage
     
     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());
     
         }
     }
     
     
    ### 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`.
     
     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());
     
         }
     }
     
     
    ### 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.
     
     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());
     
         }
     }
     
     
    ### 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.
     
     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());
     
         }
     }
     
     
    ### Cluster Type Requirements #### InfluxDB V2 Clusters (default) The following arguments are **required** for InfluxDB V2 clusters: * `allocatedStorage` * `bucket` * `deploymentType` * `organization` * `password` * `username` 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): * `allocatedStorage` * `bucket` * `deploymentType` * `organization` * `password` * `username` ## 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: ```sh $ pulumi import aws:timestreaminfluxdb/dbCluster:DbCluster example hzfuy146ke ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      DbCluster​(java.lang.String name)  
      DbCluster​(java.lang.String name, DbClusterArgs args)  
      DbCluster​(java.lang.String name, DbClusterArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> allocatedStorage()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> bucket()  
      com.pulumi.core.Output<java.lang.String> dbInstanceType()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> dbParameterGroupIdentifier()  
      com.pulumi.core.Output<java.lang.String> dbStorageType()  
      com.pulumi.core.Output<java.lang.String> deploymentType()  
      com.pulumi.core.Output<java.lang.String> endpoint()  
      com.pulumi.core.Output<java.lang.String> engineType()  
      com.pulumi.core.Output<java.lang.String> failoverMode()  
      static DbCluster get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, DbClusterState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> influxAuthParametersSecretArn()  
      com.pulumi.core.Output<java.util.Optional<DbClusterLogDeliveryConfiguration>> logDeliveryConfiguration()  
      com.pulumi.core.Output<java.util.Optional<DbClusterMaintenanceSchedule>> maintenanceSchedule()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> networkType()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> organization()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> password()  
      com.pulumi.core.Output<java.lang.Integer> port()  
      com.pulumi.core.Output<java.lang.Boolean> publiclyAccessible()  
      com.pulumi.core.Output<java.lang.String> readerEndpoint()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.util.Optional<DbClusterTimeouts>> timeouts()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> username()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> vpcSecurityGroupIds()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> vpcSubnetIds()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DbCluster

        public DbCluster​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • DbCluster

        public DbCluster​(java.lang.String name,
                         DbClusterArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • DbCluster

        public DbCluster​(java.lang.String name,
                         DbClusterArgs args,
                         @Nullable
                         com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • allocatedStorage

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> allocatedStorage()
        Returns:
        Amount of storage in GiB (gibibytes). The minimum value is `20`, the maximum value is `16384`. The argument `dbStorageType` places restrictions on this argument's minimum value. The following is a list of `dbStorageType` values and the corresponding minimum value for `allocatedStorage`: ` "InfluxIOIncludedT1": `20` , `"InfluxIOIncludedT2" and ` "InfluxIOIncludedT3": `400`. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 DB parameter group).
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the Timestream for InfluxDB cluster.
      • bucket

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> bucket()
        Returns:
        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`, and `password`, this argument will be stored in the secret referred to by the `influxAuthParametersSecretArn` attribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 DB parameter group).
      • dbInstanceType

        public com.pulumi.core.Output<java.lang.String> dbInstanceType()
        Returns:
        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.
      • dbParameterGroupIdentifier

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> dbParameterGroupIdentifier()
        Returns:
        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`, removing `dbParameterGroupIdentifier` will cause the cluster to be destroyed and recreated.
      • dbStorageType

        public com.pulumi.core.Output<java.lang.String> dbStorageType()
        Returns:
        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 for `allocatedStorage` is 400.
      • deploymentType

        public com.pulumi.core.Output<java.lang.String> deploymentType()
        Returns:
        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).
      • endpoint

        public com.pulumi.core.Output<java.lang.String> endpoint()
        Returns:
        Endpoint used to connect to InfluxDB. The default InfluxDB port is 8086.
      • engineType

        public com.pulumi.core.Output<java.lang.String> engineType()
        Returns:
        Database engine type of the DB cluster.
      • failoverMode

        public com.pulumi.core.Output<java.lang.String> failoverMode()
        Returns:
        Behavior of failure recovery when the primary node of the cluster fails. Valid options are: `"AUTOMATIC"` and `"NO_FAILOVER"`.
      • influxAuthParametersSecretArn

        public com.pulumi.core.Output<java.lang.String> influxAuthParametersSecretArn()
        Returns:
        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.
      • logDeliveryConfiguration

        public com.pulumi.core.Output<java.util.Optional<DbClusterLogDeliveryConfiguration>> logDeliveryConfiguration()
        Returns:
        Configuration for sending InfluxDB engine logs to a specified S3 bucket. This argument is updatable.
      • maintenanceSchedule

        public com.pulumi.core.Output<java.util.Optional<DbClusterMaintenanceSchedule>> maintenanceSchedule()
        Returns:
        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).
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        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.
      • networkType

        public com.pulumi.core.Output<java.lang.String> networkType()
        Returns:
        Network type of the Timestream for InfluxDB cluster. `IPV4` can communicate over IPv4 protocol only, and `DUAL` can communicate over both IPv4 and IPv6 protocols.
      • organization

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> organization()
        Returns:
        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`, and `password`, this argument will be stored in the secret referred to by the `influxAuthParametersSecretArn` attribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 DB parameter group).
      • password

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> password()
        Returns:
        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`, and `organization`, this argument will be stored in the secret referred to by the `influxAuthParametersSecretArn` attribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 DB parameter group) as the AWS API rejects it.
      • port

        public com.pulumi.core.Output<java.lang.Integer> port()
        Returns:
        Port on which the cluster accepts connections. Valid values: `1024`-`65535`. Cannot be `2375`-`2376`, `7788`-`7799`, `8090`, or `51678`-`51680`. This argument is updatable.
      • publiclyAccessible

        public com.pulumi.core.Output<java.lang.Boolean> publiclyAccessible()
        Returns:
        Whether to configure 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 enable 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.
      • readerEndpoint

        public com.pulumi.core.Output<java.lang.String> readerEndpoint()
        Returns:
        Endpoint used to connect to the Timestream for InfluxDB cluster for read-only operations.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • timeouts

        public com.pulumi.core.Output<java.util.Optional<DbClusterTimeouts>> timeouts()
      • username

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> username()
        Returns:
        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`, and `password`, this argument will be stored in the secret referred to by the `influxAuthParametersSecretArn` attribute. This field is forbidden for InfluxDB V3 clusters (when using an InfluxDB V3 DB parameter group).
      • vpcSecurityGroupIds

        public com.pulumi.core.Output<java.util.List<java.lang.String>> vpcSecurityGroupIds()
        Returns:
        List of VPC security group IDs to associate with the cluster.
      • vpcSubnetIds

        public com.pulumi.core.Output<java.util.List<java.lang.String>> vpcSubnetIds()
        Returns:
        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. The following arguments are optional:
      • get

        public static DbCluster get​(java.lang.String name,
                                    com.pulumi.core.Output<java.lang.String> id,
                                    @Nullable
                                    DbClusterState state,
                                    @Nullable
                                    com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.