From 6f0e7278c35e8a5e74ea3f9f8aa3fb901bfd82c1 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Thu, 23 Dec 2021 15:01:53 -0300 Subject: [PATCH] r/aws_iot_topic_rule: docs for timestream as iot action --- internal/service/iot/topic_rule.go | 12 ++++++++++++ website/docs/r/iot_topic_rule.html.markdown | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/internal/service/iot/topic_rule.go b/internal/service/iot/topic_rule.go index bd75277848a3..8825c9bf05fb 100644 --- a/internal/service/iot/topic_rule.go +++ b/internal/service/iot/topic_rule.go @@ -474,6 +474,12 @@ func ResourceTopicRule() *schema.Resource { "unit": { Type: schema.TypeString, Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS", + }, false), }, "value": { Type: schema.TypeString, @@ -1182,6 +1188,12 @@ func ResourceTopicRule() *schema.Resource { "unit": { Type: schema.TypeString, Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS", + }, false), }, "value": { Type: schema.TypeString, diff --git a/website/docs/r/iot_topic_rule.html.markdown b/website/docs/r/iot_topic_rule.html.markdown index fbe52a1f0ef2..0fa72131a4a0 100644 --- a/website/docs/r/iot_topic_rule.html.markdown +++ b/website/docs/r/iot_topic_rule.html.markdown @@ -88,7 +88,7 @@ EOF * `enabled` - (Required) Specifies whether the rule is enabled. * `sql` - (Required) The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference (http://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html#aws-iot-sql-reference) in the AWS IoT Developer Guide. * `sql_version` - (Required) The version of the SQL rules engine to use when evaluating the rule. -* `error_action` - (Optional) Configuration block with error action to be associated with the rule. See the documentation for `cloudwatch_alarm`, `cloudwatch_metric`, `dynamodb`, `dynamodbv2`, `elasticsearch`, `firehose`, `iot_analytics`, `iot_events`, `kinesis`, `lambda`, `republish`, `s3`, `step_functions`, `sns`, `sqs` configuration blocks for further configuration details. +* `error_action` - (Optional) Configuration block with error action to be associated with the rule. See the documentation for `cloudwatch_alarm`, `cloudwatch_metric`, `dynamodb`, `dynamodbv2`, `elasticsearch`, `firehose`, `iot_analytics`, `iot_events`, `kinesis`, `lambda`, `republish`, `s3`, `step_functions`, `sns`, `sqs`, `timestream` configuration blocks for further configuration details. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. The `cloudwatch_alarm` object takes the following arguments: @@ -180,6 +180,18 @@ The `step_functions` object takes the following arguments: * `state_machine_name` - (Required) The name of the Step Functions state machine whose execution will be started. * `role_arn` - (Required) The ARN of the IAM role that grants access to start execution of the state machine. +The `timestream` object takes the following arguments: + +* `database_name` - (Required) The name of an Amazon Timestream database. +* `dimension` - (Required) Configuration blocks with metadata attributes of the time series that are written in each measure record. Nested arguments below. + * `name` - (Required) The metadata dimension name. This is the name of the column in the Amazon Timestream database table record. + * `value` - (Required) The value to write in this column of the database record. +* `role_arn` - (Required) The ARN of the role that grants permission to write to the Amazon Timestream database table. +* `table_name` - (Required) The name of the database table into which to write the measure records. +* `timestamp` - (Optional) Configuration block specifying an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column. Nested arguments below. + * `unit` - (Required) The precision of the timestamp value that results from the expression described in value. Valid values: `SECONDS`, `MILLISECONDS`, `MICROSECONDS`, `NANOSECONDS`. + * `value` - (Required) An expression that returns a long epoch time value. + The `iot_analytics` object takes the following arguments: * `channel_name` - (Required) Name of AWS IOT Analytics channel.