我有這樣的Terraform模塊:如何覆蓋Terraform模塊中的資源?
module "helloworld" {
source = ../service"
}
和../service
包含:
resource "aws_cloudwatch_metric_alarm" "cpu_max" {
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
... etc
}
你如何重寫service
變量comparison_operator
和evaluation_periods
你的模塊?
E.g.將cpu_max
設置爲4
是否與模塊中的aws_cloudwatch_metric_alarm .cpu_max.evaluation_periods = 4
一樣簡單?