Class DbInstance
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.timestreaminfluxdb.DbInstance
-
public class DbInstance extends com.pulumi.resources.CustomResourceResource for managing an Amazon Timestream for InfluxDB database instance. ## Example Usage ### Basic Usage
### Usage with Prerequisite Resources All Timestream for InfluxDB instances require a VPC, subnet, and security group. The following example shows how these prerequisite resources can be created and used with `aws.timestreaminfluxdb.DbInstance`.package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.timestreaminfluxdb.DbInstance; import com.pulumi.aws.timestreaminfluxdb.DbInstanceArgs; 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 DbInstance("example", DbInstanceArgs.builder() .allocatedStorage(20) .bucket("example-bucket-name") .dbInstanceType("db.influx.medium") .username("admin") .password("example-password") .port(8086) .organization("organization") .vpcSubnetIds(exampleid) .vpcSecurityGroupIds(exampleAwsSecurityGroup.id()) .name("example-db-instance") .build()); } }
### Usage with S3 Log Delivery Enabled You can use an S3 bucket to store logs generated by your Timestream for InfluxDB instance. 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 subnet 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.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.DbInstance; import com.pulumi.aws.timestreaminfluxdb.DbInstanceArgs; 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 exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder() .vpcId(example.id()) .cidrBlock("10.0.1.0/24") .build()); var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder() .name("example") .vpcId(example.id()) .build()); var exampleDbInstance = new DbInstance("exampleDbInstance", DbInstanceArgs.builder() .allocatedStorage(20) .bucket("example-bucket-name") .dbInstanceType("db.influx.medium") .username("admin") .password("example-password") .organization("organization") .vpcSubnetIds(exampleSubnet.id()) .vpcSecurityGroupIds(exampleSecurityGroup.id()) .name("example-db-instance") .build()); } }
### Usage with MultiAZ Deployment To use multi-region availability, at least two subnets must be created in different availability zones and used with your Timestream for InfluxDB instance.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.DbInstance; import com.pulumi.aws.timestreaminfluxdb.DbInstanceArgs; import com.pulumi.aws.timestreaminfluxdb.inputs.DbInstanceLogDeliveryConfigurationArgs; import com.pulumi.aws.timestreaminfluxdb.inputs.DbInstanceLogDeliveryConfigurationS3ConfigurationArgs; 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 exampleDbInstance = new DbInstance("exampleDbInstance", DbInstanceArgs.builder() .logDeliveryConfiguration(DbInstanceLogDeliveryConfigurationArgs.builder() .s3Configuration(DbInstanceLogDeliveryConfigurationS3ConfigurationArgs.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(exampleAwsSubnet.id()) .vpcSecurityGroupIds(exampleAwsSecurityGroup.id()) .name("example-db-instance") .build()); } }
## 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 instances using `id`. For example: ```sh $ pulumi import aws:timestreaminfluxdb/dbInstance:DbInstance example 0oo7rzble5 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.ec2.Subnet; import com.pulumi.aws.ec2.SubnetArgs; import com.pulumi.aws.timestreaminfluxdb.DbInstance; import com.pulumi.aws.timestreaminfluxdb.DbInstanceArgs; 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 example1 = new Subnet("example1", SubnetArgs.builder() .vpcId(exampleAwsVpc.id()) .cidrBlock("10.0.1.0/24") .availabilityZone("us-west-2a") .build()); var example2 = new Subnet("example2", SubnetArgs.builder() .vpcId(exampleAwsVpc.id()) .cidrBlock("10.0.2.0/24") .availabilityZone("us-west-2b") .build()); var example = new DbInstance("example", DbInstanceArgs.builder() .allocatedStorage(20) .bucket("example-bucket-name") .dbInstanceType("db.influx.medium") .deploymentType("WITH_MULTIAZ_STANDBY") .username("admin") .password("example-password") .organization("organization") .vpcSubnetIds( example1.id(), example2.id()) .vpcSecurityGroupIds(exampleAwsSecurityGroup.id()) .name("example-db-instance") .build()); } }
-
-
Constructor Summary
Constructors Constructor Description DbInstance(java.lang.String name)DbInstance(java.lang.String name, DbInstanceArgs args)DbInstance(java.lang.String name, DbInstanceArgs 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.lang.Integer>allocatedStorage()com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.lang.String>availabilityZone()com.pulumi.core.Output<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()static DbInstanceget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, DbInstanceState 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<DbInstanceLogDeliveryConfiguration>>logDeliveryConfiguration()com.pulumi.core.Output<java.util.Optional<DbInstanceMaintenanceSchedule>>maintenanceSchedule()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>networkType()com.pulumi.core.Output<java.lang.String>organization()com.pulumi.core.Output<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>region()com.pulumi.core.Output<java.lang.String>secondaryAvailabilityZone()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<DbInstanceTimeouts>>timeouts()com.pulumi.core.Output<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()
-
-
-
Constructor Detail
-
DbInstance
public DbInstance(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
DbInstance
public DbInstance(java.lang.String name, DbInstanceArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
DbInstance
public DbInstance(java.lang.String name, DbInstanceArgs 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.lang.Integer> allocatedStorage()
- Returns:
- Amount of storage in GiB (gibibytes). The minimum value is `20`, the maximum value is `16384`. This argument is updatable. 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`.
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the Timestream for InfluxDB Instance.
-
availabilityZone
public com.pulumi.core.Output<java.lang.String> availabilityZone()
- Returns:
- Availability Zone in which the DB instance resides.
-
bucket
public com.pulumi.core.Output<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.
-
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 DB instance. This argument is updatable. If added to an existing Timestream for InfluxDB instance or given a new value, will cause an in-place update to the instance. However, if an instance already has a value for `dbParameterGroupIdentifier`, removing `dbParameterGroupIdentifier` will cause the instance 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. This argument is updatable. For a single instance, after this argument has been updated once, it can only be updated again after 6 hours have passed.
-
deploymentType
public com.pulumi.core.Output<java.lang.String> deploymentType()
- Returns:
- Whether the DB instance will be deployed as a standalone instance or with a Multi-AZ standby for high availability. Valid options are: `"SINGLE_AZ"`, `"WITH_MULTIAZ_STANDBY"`. This argument is updatable.
-
endpoint
public com.pulumi.core.Output<java.lang.String> endpoint()
- Returns:
- Endpoint used to connect to InfluxDB. The default InfluxDB port is 8086.
-
influxAuthParametersSecretArn
public com.pulumi.core.Output<java.lang.String> influxAuthParametersSecretArn()
- Returns:
- ARN of the AWS Secrets Manager secret containing the initial InfluxDB authorization parameters. The secret value is a JSON formatted key-value pair holding InfluxDB authorization values: organization, bucket, username, and password.
-
logDeliveryConfiguration
public com.pulumi.core.Output<java.util.Optional<DbInstanceLogDeliveryConfiguration>> 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<DbInstanceMaintenanceSchedule>> maintenanceSchedule()
- Returns:
- Maintenance schedule for the DB instance, including the preferred maintenance window and timezone. This argument is updatable.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name that uniquely identifies the DB instance when interacting with the Amazon Timestream for InfluxDB API and CLI commands. This name will also be a prefix included in the endpoint. DB instance 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 instance. `IPV4` can communicate over IPv4 protocol only, and `DUAL` can communicate over both IPv4 and IPv6 protocols.
-
organization
public com.pulumi.core.Output<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.
-
password
public com.pulumi.core.Output<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.
-
port
public com.pulumi.core.Output<java.lang.Integer> port()
- Returns:
- Port on which the instance 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 instance 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.
-
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.
-
secondaryAvailabilityZone
public com.pulumi.core.Output<java.lang.String> secondaryAvailabilityZone()
- Returns:
- Availability Zone in which the standby instance is located when deploying with a MultiAZ standby instance.
-
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<DbInstanceTimeouts>> timeouts()
-
username
public com.pulumi.core.Output<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.
-
vpcSecurityGroupIds
public com.pulumi.core.Output<java.util.List<java.lang.String>> vpcSecurityGroupIds()
- Returns:
- List of VPC security group IDs to associate with the DB instance.
-
vpcSubnetIds
public com.pulumi.core.Output<java.util.List<java.lang.String>> vpcSubnetIds()
- Returns:
- List of VPC subnet IDs to associate with the DB instance. 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 DbInstance get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable DbInstanceState 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.
-
-