hashicorp/terraform-provider-aws

iot_topic_rule CloudWatch metric timestamp Wrong validator

Aberta

#45.375 aberto em 3 de dez. de 2025

 (2 comentários) (0 reação) (0 responsável)Go (10.312 forks)github user discovery
buggood first issueservice/iot

Métricas do repositório

Stars
 (11.045 estrelas)
Métricas de merge de PR
 (Mesclagem média 19d 21h) (251 fundiu PRs em 30d)

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

  1. add a new iot_topic_rule with cloudwatch metric containing substitution template as metric_timestamp
  2. apply

Debug Logging

GenAI / LLM Assisted Development

n/a

Important Facts and References

No response

Would you like to implement a fix?

Yes

Guia do colaborador