Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
  • Loading branch information
k4leung4 committed Oct 3, 2024
1 parent 5f1e83b commit ca68d34
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion modules/audit-serviceaccount/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "google_monitoring_alert_policy" "generate-access-token" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down
2 changes: 1 addition & 1 deletion modules/bucket-events/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "google_service_account_iam_binding" "allow-pubsub-to-mint-tokens" {
}

module "audit-delivery-serviceaccount" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

source = "../audit-serviceaccount"

Expand Down
2 changes: 1 addition & 1 deletion modules/cloudevent-recorder/bigquery.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ resource "google_service_account_iam_binding" "provisioner-acts-as-import-identi
}

module "audit-import-serviceaccount" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

source = "../audit-serviceaccount"

Expand Down
2 changes: 1 addition & 1 deletion modules/cloudevent-recorder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "google_storage_bucket" "recorder" {
data "google_client_openid_userinfo" "me" {}

resource "google_monitoring_alert_policy" "bucket-access" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudevent-trigger/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "google_service_account_iam_binding" "allow-pubsub-to-mint-tokens" {
}

module "audit-trigger-serviceaccount" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

source = "../audit-serviceaccount"

Expand Down
4 changes: 2 additions & 2 deletions modules/configmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module "my-configmap" {
EOT
# Optionally: channels to notify if this configuration is manipulated.
notification-channels = [ ... ]
notification_channels = [ ... ]
}
module "foo-service" {
Expand Down Expand Up @@ -90,7 +90,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_data"></a> [data](#input\_data) | The data to place in the secret. | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | The name to give the secret. | `string` | n/a | yes |
| <a name="input_notification-channels"></a> [notification-channels](#input\_notification-channels) | The channels to notify if the configuration data is improperly accessed. | `list(string)` | n/a | yes |
| <a name="input_notification_channels"></a> [notification_channels](#input\_notification_channels) | The channels to notify if the configuration data is improperly accessed. | `list(string)` | n/a | yes |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
| <a name="input_service-account"></a> [service-account](#input\_service-account) | The email of the service account that will access the secret. | `string` | n/a | yes |

Expand Down
4 changes: 2 additions & 2 deletions modules/configmap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data "google_client_openid_userinfo" "me" {}

// Create an alert policy to notify if the secret is accessed by an unauthorized entity.
resource "google_monitoring_alert_policy" "anomalous-secret-access" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down Expand Up @@ -77,7 +77,7 @@ resource "google_monitoring_alert_policy" "anomalous-secret-access" {
}
}

notification_channels = var.notification-channels
notification_channels = var.notification_channels

enabled = "true"
project = var.project_id
Expand Down
2 changes: 1 addition & 1 deletion modules/configmap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variable "service-account" {
type = string
}

variable "notification-channels" {
variable "notification_channels" {
description = "The channels to notify if the configuration data is improperly accessed."
type = list(string)
}
4 changes: 2 additions & 2 deletions modules/cron/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ resource "google_service_account" "delivery" {
}

module "audit-delivery-serviceaccount" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

source = "../audit-serviceaccount"

Expand Down Expand Up @@ -284,7 +284,7 @@ data "google_client_openid_userinfo" "me" {}

// Create an alert policy to notify if the job is accessed by an unauthorized entity.
resource "google_monitoring_alert_policy" "anomalous-job-access" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down
2 changes: 1 addition & 1 deletion modules/github-events/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module "webhook-secret" {
service-account = google_service_account.service.email
authorized-adder = var.secret_version_adder

notification-channels = var.notification_channels
notification_channels = var.notification_channels
}

module "this" {
Expand Down
2 changes: 1 addition & 1 deletion modules/github-gsa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ resource "google_service_account_iam_binding" "allow-impersonation" {
// Create an auditing policy to ensure that tokens are only issued for identities
// matching our expectations.
module "audit-usage" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

source = "../audit-serviceaccount"

Expand Down
4 changes: 2 additions & 2 deletions modules/regional-service/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "audit-serviceaccount" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

source = "../audit-serviceaccount"

Expand Down Expand Up @@ -284,7 +284,7 @@ data "google_client_openid_userinfo" "me" {}

// Create an alert policy to notify if the service is accessed by an unauthorized entity.
resource "google_monitoring_alert_policy" "anomalous-service-access" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down
4 changes: 2 additions & 2 deletions modules/secret/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module "my-secret" {
authorized-adder = "group:oncall@my-corp.dev"

# Optionally: channels to notify if this secret is manipulated.
notification-channels = [ ... ]
notification_channels = [ ... ]
}

module "foo-service" {
Expand Down Expand Up @@ -90,7 +90,7 @@ No modules.
| <a name="input_authorized-adder"></a> [authorized-adder](#input\_authorized-adder) | A member-style representation of the identity authorized to add new secret values (e.g. group:oncall@my-corp.dev). | `string` | n/a | yes |
| <a name="input_create_placeholder_version"></a> [create\_placeholder\_version](#input\_create\_placeholder\_version) | Whether to create a placeholder secret version to avoid bad reference on first deploy. | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | The name to give the secret. | `string` | n/a | yes |
| <a name="input_notification-channels"></a> [notification-channels](#input\_notification-channels) | The channels to notify if the configuration data is improperly accessed. | `list(string)` | n/a | yes |
| <a name="input_notification_channels"></a> [notification_channels](#input\_notification_channels) | The channels to notify if the configuration data is improperly accessed. | `list(string)` | n/a | yes |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
| <a name="input_service-account"></a> [service-account](#input\_service-account) | The email of the service account that will access the secret. | `string` | n/a | yes |

Expand Down
4 changes: 2 additions & 2 deletions modules/secret/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data "google_project" "project" { project_id = var.project_id }

// Create an alert policy to notify if the secret is accessed by an unauthorized entity.
resource "google_monitoring_alert_policy" "anomalous-secret-access" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down Expand Up @@ -82,7 +82,7 @@ resource "google_monitoring_alert_policy" "anomalous-secret-access" {
}
}

notification_channels = var.notification-channels
notification_channels = var.notification_channels

enabled = "true"
project = var.project_id
Expand Down
2 changes: 1 addition & 1 deletion modules/secret/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variable "service-account" {
type = string
}

variable "notification-channels" {
variable "notification_channels" {
description = "The channels to notify if the configuration data is improperly accessed."
type = list(string)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/serverless-gclb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ locals {
}

resource "google_monitoring_alert_policy" "abnormal-gclb-access" {
count = len(var.notification_channels) > 0 ? 1 : 0
count = length(var.notification_channels) > 0 ? 1 : 0

# In the absence of data, incident will auto-close after an hour
alert_strategy {
Expand Down
6 changes: 3 additions & 3 deletions modules/workqueue/dispatcher.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Compute a suffix that satisfies the regex:
// ^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$
resource "random_string" "dispatcher" {
length = 30 - length(local.sa_prefix)
length = 30 = length(local.sa_prefix)
special = false
upper = false
}
Expand Down Expand Up @@ -79,7 +79,7 @@ module "dispatcher-service" {
// Compute a suffix that satisfies the regex:
// ^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$
resource "random_string" "cron-trigger" {
length = 30 - length(local.sa_prefix)
length = 30 = length(local.sa_prefix)
special = false
upper = false
}
Expand Down Expand Up @@ -133,7 +133,7 @@ resource "google_cloud_scheduler_job" "cron" {
// Compute a suffix that satisfies the regex:
// ^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$
resource "random_string" "change-trigger" {
length = 30 - length(local.sa_prefix)
length = 30 = length(local.sa_prefix)
special = false
upper = false
}
Expand Down
2 changes: 1 addition & 1 deletion modules/workqueue/receiver.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Compute a suffix that satisfies the regex:
// ^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$
resource "random_string" "receiver" {
length = 30 - length(local.sa_prefix)
length = 30 = length(local.sa_prefix)
special = false
upper = false
}
Expand Down

0 comments on commit ca68d34

Please sign in to comment.