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: add monitoring and fluentbit tags #126

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 | `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 |
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>"
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>"
@@ -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" {
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/*"
}
12 changes: 7 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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,
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -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"
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"