hashicorp/terraform-provider-aws
iot_topic_rule CloudWatch metric timestamp Wrong validator
Open
#45,375 opened on Dec 3, 2025
buggood first issueservice/iot
Repository metrics
- Stars
- (11,045 stars)
- PR merge metrics
- (PR metrics pending)
Description
Terraform and AWS Provider Version
Terraform v1.13.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/archive v2.7.1
+ provider registry.terraform.io/hashicorp/aws v6.14.0
Affected Resource(s) or Data Source(s)
No response
Expected Behavior
When setting a cloudwatch_metric in an iot_topic_rule the metric_timestamp value should accept a valid string containing a Substitution template as described here: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html and here:
Actual Behavior
When setting a cloudwatch_metric in an iot_topic_rule the metric_timestamp is now validated to be a ValidUTCTimestamp, and breaks the deployment if other values such as substitutions like ${device_time} are provided.
Relevant Error/Panic Output
Sample Terraform Configuration
resource "aws_iot_topic_rule" "system_metrics_to_cloudwatch" {
...
cloudwatch_metric {
role_arn = aws_iam_role.system_metrics_to_cloudwatch_role.arn
metric_namespace = "metric_1/$${vesselId}"
metric_name = "tx"
metric_value = "$${tx}"
metric_unit = "Count"
metric_timestamp = "$${timestamp}"
}
}
Steps to Reproduce
- add a new iot_topic_rule with cloudwatch metric containing substitution template as metric_timestamp
- apply
Debug Logging
GenAI / LLM Assisted Development
n/a
Important Facts and References
No response
Would you like to implement a fix?
Yes