

# InfluxDBAction

The InfluxDB rule action converts the message payload into InfluxDB line protocol. It writes the result to a table in an InfluxDB database. The database can be an Amazon Timestream for InfluxDB instance or a self-managed InfluxDB cluster.

The action connects to InfluxDB through an InfluxDB topic rule destination, which must be in the `ENABLED` state before the action can write data.

## Contents
<a name="API_InfluxDBAction_Contents"></a>

 ** databaseName **   <a name="iot-Type-InfluxDBAction-databaseName"></a>
The name of the InfluxDB database to write to. In InfluxDB 2, this is the name of the bucket.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 64.  
Pattern: `^[^_\"][^\"]+$`   
Required: Yes

 ** destinationArn **   <a name="iot-Type-InfluxDBAction-destinationArn"></a>
The ARN of the InfluxDB topic rule destination that identifies the InfluxDB instance to write to.  
Type: String  
Required: Yes

 ** roleArn **   <a name="iot-Type-InfluxDBAction-roleArn"></a>
The ARN of the role that grants permission to retrieve the InfluxDB API token from AWS Secrets Manager.  
Type: String  
Required: Yes

 ** tableName **   <a name="iot-Type-InfluxDBAction-tableName"></a>
The name of the table to write the data point to. This is the measurement name of the InfluxDB line protocol record.  
Accepts substitution templates.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1024.  
Pattern: `^[^_].*$`   
Required: Yes

 ** batchConfig **   <a name="iot-Type-InfluxDBAction-batchConfig"></a>
The batching configuration for the action. When present, AWS IoT collects data points from multiple messages and writes them to InfluxDB in a single request.  
If omitted, each message is written to InfluxDB in its own request.  
Type: [InfluxDBBatchConfig](API_InfluxDBBatchConfig.md) object  
Required: No

 ** organization **   <a name="iot-Type-InfluxDBAction-organization"></a>
The name of the InfluxDB organization that owns the database.  
A write to an InfluxDB 2 instance fails if this value isn't set. This value isn't used when the destination is an InfluxDB 3 instance.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Required: No

 ** tags **   <a name="iot-Type-InfluxDBAction-tags"></a>
The set of tags to write with each data point. Tags are the indexed metadata of an InfluxDB data point.  
Tag names and tag values accept substitution templates. A tag name can't use the `@{...}` per-element form. A tag name must resolve to the same value for every element of an array payload.  
Type: String to string map  
Map Entries: Minimum number of 0 items. Maximum number of 498 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 256.  
Key Pattern: `^[^_].*$`   
Value Length Constraints: Minimum length of 1. Maximum length of 1024.  
Required: No

 ** timestampUnit **   <a name="iot-Type-InfluxDBAction-timestampUnit"></a>
The precision of the timestamp written with each data point. Valid values are `s` (seconds), `ms` (milliseconds), `us` (microseconds), and `ns` (nanoseconds).  
If omitted, the topic rule action uses `ms`.  
Type: String  
Valid Values: `s | ms | us | ns`   
Required: No

## See Also
<a name="API_InfluxDBAction_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/iot-2015-05-28/InfluxDBAction) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-2015-05-28/InfluxDBAction) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-2015-05-28/InfluxDBAction) 