github runatlantis/terraform-gce-atlantis 1.2.7
v1.2.7

latest releases: 4.1.0, v3.0.4, 3.0.3...
20 months ago

🚀 Enhancements

Fix module idempotency by setting sample_rate on backend service log_config @kpocius (#89)

what

Set sample_rate to 1 (default value) on google_compute_backend_service resource log_config block

why

When used as-is, the module is not idempotent, and results in change on each apply:

Terraform will perform the following actions:

  # module.atlantis.google_compute_backend_service.default will be updated in-place
  ~ resource "google_compute_backend_service" "default" {
        id                              = "projects/argyle-security-admin/global/backendServices/atlantis"
        name                            = "atlantis"
        # (16 unchanged attributes hidden)

      ~ log_config {
          - sample_rate = 1 -> null
            # (1 unchanged attribute hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

references

google_compute_backend_service sample_rate documentation

The ideal solution would be to provide an input variable for setting both logging and its sample rate. Maybe it can be handled in a separate feature. Meanwhile this is a quick workaround which doesn't change the current behavior and makes the module idempotent.

Don't miss a new terraform-gce-atlantis release

NewReleases is sending notifications on new releases.