You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
variable"cloudwatch_metric_alarm" {
type=object({
enable =bool,
actions =list(string)
})
}
variable"cloudwatch_metric_alarm_actions" {
type=list(string)
}
resource"aws_cloudwatch_metric_alarm""this" {
alarm_name="my-test-alarm"comparison_operator="GreaterThanOrEqualToThreshold"evaluation_periods="2"alarm_description="Alarm when query volume near upper limit"alarm_actions=var.cloudwatch_metric_alarm.actions# error reported due to object reference# alarm_actions = var.cloudwatch_metric_alarm_actions
}
Run the following command from the root module: regula run --var-file=terraform.tfvars
You will notice FG_R00240 being flagged complaining how an alarm action is not defined even though it is defined. Now, comment out the alarm_actions attribute line that has object reference and uncomment the alarm_actions attribute line that uses list(string) reference and run the above regula command again. The error reported for rule FG_R00240 disappears.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Submodule is unable to resolve a object reference to a variable value defined in the tfvars of the root module.
How you're running Regula
Please include versions of all relevant tools.
Operating System
Macbook
Steps to reproduce
Below is the IaC terraform configuration to reproduce
./main.tf
./terraform.tfvars
./modules/cloudwatch/main.tf
Run the following command from the root module:
regula run --var-file=terraform.tfvars
You will notice
FG_R00240
being flagged complaining how an alarm action is not defined even though it is defined. Now, comment out thealarm_actions
attribute line that has object reference and uncomment thealarm_actions
attribute line that useslist(string)
reference and run the above regula command again. The error reported for ruleFG_R00240
disappears.The text was updated successfully, but these errors were encountered: