-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING CHANGE: Pass SLO config and Error Budget Policy paths instead of content #56
Conversation
Hi @ocervell, I got here via some references to issues in the I see in the current version that you have a few variables defined as A different way to get the result I think you were looking for (where the items in the sequence can each have a separate type) would be to change the declaration to variable "example" {
type = any
validation {
condition = can(var.example[0]) # numeric indexing is possible only for sequences
error_message = "Must be a list of objects."
}
validation {
# This expression is finicky; Terraform 0.14 has a new "alltrue"
# function that makes this easier but I assume you want to
# keep supporting Terraform 0.13, so I'm showing the finicky
# way.
condition = [for v in var.example : true if can(v.required_attr)] == length(var.example)
error_message = "Must be a list of objects where each object has a required_attr attribute."
}
# Potentially other validation rules for the types of different
# attributes, if you like.
} If the optional attribute experiment gets good feedback during the 0.14 series and stablizes as-is in 0.15 then, assuming you were then willing to require Terraform 0.15 for some new release, this could then be simplified back to a |
@apparentlymart thanks for helping here, much appreciated ! Would I'm interested in passing a list of maps (serialised from the yaml below) directly to the module - class: Prometheus
url: <URL>
metrics:
- name: test
alias: ok
additional_labels: [test1, test2, test3]
- name: test2
alias: ok2
- class: Stackdriver
project_id: <PROJECT_ID> Also, could we imagine using the |
@morgante I will close this for now since the breaking change is not needed based on the workaround shown above. |
Pass SLO configs and Error Budget Policy file paths instead of content to go around TF variable limitation.
Because of #55 (cannot have complex variables), the module has to take in config file paths instead of decoded configs to support the latest added attribute
metrics
.Also adds:
This will also help with updates to the SLO config or error budget policy JSON schemas without needing to update the Terraform module inputs.
Fix #55
Fix #57