Skip to content

Commit

Permalink
feat: add monitoring and fluentbit tags
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Oct 25, 2023
1 parent 8a2a864 commit 04cf6a6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 25 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ You can check the status of the certificate in the Google Cloud Console.
| <a name="input_enable_oslogin"></a> [enable\_oslogin](#input\_enable\_oslogin) | Enables OS Login service on the VM | `bool` | `false` | no |
| <a name="input_env_vars"></a> [env\_vars](#input\_env\_vars) | Key-value pairs representing environment variables and their respective values | `map(any)` | n/a | yes |
| <a name="input_expose_metrics_publicly"></a> [expose\_metrics\_publicly](#input\_expose\_metrics\_publicly) | Exposes the /metrics endpoint publicly even if Atlantis is protected by IAP | `bool` | `false` | no |
| <a name="input_google_logging_enabled"></a> [google\_logging\_enabled](#input\_google\_logging\_enabled) | Enable Google Cloud Logging | `bool` | `true` | no |
| <a name="input_google_logging_use_fluentbit"></a> [google\_logging\_use\_fluentbit](#input\_google\_logging\_use\_fluentbit) | Enable Google Cloud Logging using Fluent Bit ( available from COS 105+ ) | `bool` | `false` | no |
| <a name="input_google_monitoring_enabled"></a> [google\_monitoring\_enabled](#input\_google\_monitoring\_enabled) | Enable Google Cloud Monitoring | `bool` | `true` | no |
| <a name="input_iap"></a> [iap](#input\_iap) | Settings for enabling Cloud Identity Aware Proxy to protect the Atlantis UI | <pre>object({<br> oauth2_client_id = string<br> oauth2_client_secret = string<br> })</pre> | `null` | no |
| <a name="input_image"></a> [image](#input\_image) | Docker image. This is most often a reference to a container located in a container registry | `string` | `"ghcr.io/runatlantis/atlantis:latest"` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | Key-value pairs representing labels attaching to instance & instance template | `map(any)` | `{}` | no |
Expand Down
14 changes: 7 additions & 7 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
locals {
project_id = "<your-project-id>"
network = "<your-network>"
subnetwork = "<your-subnetwork>"
region = "<your-region>"
zone = "<your-zone>"
domain = "<example.com>"
managed_zone = "<your-managed-zone>"
project_id = "<your-project-id>"
network = "<your-network>"
subnetwork = "<your-subnetwork>"
region = "<your-region>"
zone = "<your-zone>"
domain = "<example.com>"
managed_zone = "<your-managed-zone>"

github_repo_allow_list = "github.com/example/*"
github_user = "<your-github-handle>"
Expand Down
8 changes: 3 additions & 5 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
locals {
project_id = "<your-project-id>"
network = "<your-network>"
subnetwork = "<your-subnetwork>"
region = "<your-region>"
zone = "<your-zone>"
domain = "<example.com>"
Expand Down Expand Up @@ -33,9 +31,9 @@ resource "google_project_iam_member" "atlantis_metric_writer" {
}

resource "google_compute_network" "default" {
name = "example-network"
auto_create_subnetworks = false
project = local.project_id
name = "example-network"
auto_create_subnetworks = false
project = local.project_id
}

resource "google_compute_subnetwork" "default" {
Expand Down
16 changes: 8 additions & 8 deletions examples/secure-env-vars/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
locals {
project_id = "<your-project-id>"
network = "<your-network>"
subnetwork = "<your-subnetwork>"
region = "<your-region>"
zone = "<your-zone>"
image = "<your-image>"
domain = "<example.com>"
managed_zone = "<your-managed-zone>"
project_id = "<your-project-id>"
network = "<your-network>"
subnetwork = "<your-subnetwork>"
region = "<your-region>"
zone = "<your-zone>"
image = "<your-image>"
domain = "<example.com>"
managed_zone = "<your-managed-zone>"

github_repo_allow_list = "github.com/example/*"
}
Expand Down
12 changes: 7 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ resource "google_compute_instance_template" "default" {
metadata_startup_script = var.startup_script

metadata = {
gce-container-declaration = module.container.metadata_value
user-data = data.cloudinit_config.config.rendered
google-logging-enabled = true
block-project-ssh-keys = var.block_project_ssh_keys_enabled
enable-oslogin = var.enable_oslogin
gce-container-declaration = module.container.metadata_value
user-data = data.cloudinit_config.config.rendered
google-logging-enabled = var.google_monitoring_enabled
google-monitoring-enabled = var.google_monitoring_enabled
google-logging-use-fluentbit = var.google_logging_use_fluentbit
block-project-ssh-keys = var.block_project_ssh_keys_enabled
enable-oslogin = var.enable_oslogin
}

# Using the below scheduling configuration,
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ variable "expose_metrics_publicly" {
default = false
}

variable "google_logging_enabled" {
type = bool
description = "Enable Google Cloud Logging"
default = true
}

variable "google_logging_use_fluentbit" {
type = bool
description = "Enable Google Cloud Logging using Fluent Bit ( available from COS 105+ )"
default = false
}

variable "google_monitoring_enabled" {
type = bool
description = "Enable Google Cloud Monitoring"
default = true
}

variable "labels" {
type = map(any)
description = "Key-value pairs representing labels attaching to instance & instance template"
Expand Down

0 comments on commit 04cf6a6

Please sign in to comment.