terracognita
terracognita copied to clipboard
Wrong rendering of metric_query yaml
General information:
-
Operating System: Macos
-
Terracognita version / tag: terracognita v0.7.4 terraform 1.0.11 (tried also with 1.1.6 and 0.14.11)
-
Did you build Terracognita from sources or did you use the Docker image: No, brew
Describe the bug:
I just want to import all alarms and edit them
terracognita aws --tfstate resources.tfstate --hcl main.tf -i aws_cloudwatch_metric_alarm
completes
tf plan
returns many errors like this:
│ Error: Unsupported block type
│
│ on main.tf line 511, in resource "aws_cloudwatch_metric_alarm" "one_or_more_hosts_are_unhealthy":
│ 511: dimensions {
│
│ Blocks of type "dimensions" are not expected here. Did you mean to define argument "dimensions"? If so, use the equals sign to assign it a value.
╵
fragment starting at line 507:
metric_query {
id = "m4"
metric {
dimensions {
LoadBalancer = "app/k8s-commonpublicalb-a48c003731/6100727d823ac3a8"
TargetGroup = "targetgroup/k8s-homeins-mobilitu-863904c84c/3395c10ec31fb55b"
}
metric_name = "UnHealthyHostCount"
namespace = "AWS/ApplicationELB"
period = 60
stat = "Maximum"
}
}
Log message
I've fixed by substituting dimensions {
with dimensions = {