Skip to content

Commit

Permalink
fix: Add new lines around blocks in HCL
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavms committed Jan 11, 2024
1 parent df847bf commit fd95fc9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/pagerduty-service-integration-email/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ variable "email_filter" {
from_email_regex = string
subject_regex = string
})

default = {
from_email_regex = null
subject_regex = null
}

description = <<-EOT
email_filter = {
from_email_regex : "The regex used to match the 'from' field in the inbound email. Should be a valid regex or null"
Expand Down
3 changes: 3 additions & 0 deletions modules/honest-two-level-schedule/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ variable "name" {
variable "rotation_turn_length_seconds" {
description = "The time in seconds each individual is on-call for."
type = number

validation {
condition = var.rotation_turn_length_seconds > 0
error_message = "Rotation turn length must be greater than 0."
Expand All @@ -32,6 +33,7 @@ variable "time_zone" {
variable "user_ids" {
description = "An ordered list of PagerDuty User IDs to add to the schedule. The individual's order in the schedule depends on the order of this list."
type = list(string)

validation {
# This validation does not catch repeating user IDs with different cases (uppercase/lowercase, etc)
# So duplicate values of "A" and "a" will be allowed.
Expand All @@ -40,6 +42,7 @@ variable "user_ids" {
length(distinct(var.user_ids)) == length(var.user_ids),
length(distinct([for u in var.user_ids : lower(u)])) == length(var.user_ids),
])

error_message = "At least two unique responders are required to build a two-level schedule. Repeated values are not allowed."
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resource "pagerduty_service_integration" "generic_email_inbound_integration" {
# hardcoded because this is a generic_email_inbound_integration module.
type = "generic_email_inbound_integration"
email_incident_creation = var.email_incident_creation

email_filter {
# v1 we don't expose this yet.
body_mode = "always"
Expand Down
3 changes: 3 additions & 0 deletions modules/pagerduty-service-integration-email/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ variable "integration_email" {
variable "email_incident_creation" {
default = "use_rules"
description = "Behaviour of Email Management feature (explained in PD docs)[https://support.pagerduty.com/docs/email-management-filters-and-rules#control-when-a-new-incident-or-alert-is-triggered]. Can be on_new_email, on_new_email_subject, only_if_no_open_incidents or use_rules."

validation {
condition = contains(["on_new_email", "on_new_email_subject", "only_if_no_open_incidents", "use_rules"], var.email_incident_creation)
error_message = "Invalid value passed to email_incident_creation. Must be one of on_new_email, on_new_email_subject, only_if_no_open_incidents or use_rules."
Expand All @@ -27,10 +28,12 @@ variable "email_filter" {
from_email_regex = string
subject_regex = string
})

default = {
from_email_regex = null
subject_regex = null
}

description = <<-EOT
email_filter = {
from_email_regex : "The regex used to match the 'from' field in the inbound email. Should be a valid regex or null"
Expand Down
2 changes: 2 additions & 0 deletions modules/pagerduty-user/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ variable "role" {
default = "user"
description = "The user's role in PagerDuty. Can be `admin`, `limited_user`, `read_only_user` (Full Stakeholder), or `user`."
type = string

validation {
condition = anytrue([
var.role == "admin",
var.role == "limited_user",
var.role == "read_only_user",
var.role == "user",
])

error_message = "role must be one of `admin`, `limited_user`, `read_only_user`, or `user`."
}
}

0 comments on commit fd95fc9

Please sign in to comment.