Skip to content
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

feat(cloud-connector): Add logging level variable #35

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/services/cloud-connector/README.md
Expand Up @@ -67,6 +67,7 @@ No modules.
| <a name="input_extra_envs"></a> [extra\_envs](#input\_extra\_envs) | Extra environment variables for the Cloud Connector instance | `map(string)` | `{}` | no |
| <a name="input_image_name"></a> [image\_name](#input\_image\_name) | Cloud Connector image to deploy | `string` | `"gcr.io/mateo-burillo-ns/cloud-connector:latest"` | no |
| <a name="input_location"></a> [location](#input\_location) | Zone where the cloud connector will be deployed | `string` | `"us-central1"` | no |
| <a name="input_logging_level"></a> [logging\_level](#input\_logging\_level) | Logging level (debug, info, error). | `string` | `"info"` | no |
| <a name="input_max_instances"></a> [max\_instances](#input\_max\_instances) | Max number of instances for the Cloud Connector | `number` | `1` | no |
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc-cloudconnector"` | no |
| <a name="input_verify_ssl"></a> [verify\_ssl](#input\_verify\_ssl) | Verify the SSL certificate of the Secure endpoint | `bool` | `true` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/services/cloud-connector/main.tf
@@ -1,6 +1,7 @@
# This lines are here because of pre-commit hook
locals {
default_config = <<EOF
logging: ${var.logging_level}
rules: []
ingestors:
- gcp-auditlog-pubsub-http:
Expand Down
10 changes: 10 additions & 0 deletions modules/services/cloud-connector/variables.tf
Expand Up @@ -82,3 +82,13 @@ variable "config_source" {
type = string
description = "Path to a file that contains the contents of the configuration file to be saved in the bucket"
}

variable "logging_level" {
type = string
default = "info"
description = "Logging level (debug, info, error)."
validation {
condition = contains(["info", "debug", "error"], var.logging_level)
error_message = "Logging level can only be one of (debug, info, error)."
}
}