Skip to content

Commit

Permalink
Feature: use tags in terragrunt git refs (#4)
Browse files Browse the repository at this point in the history
* using tag refs for stability of terraform sources in terragrunt configuration
  • Loading branch information
brandonjbjelland committed Feb 1, 2023
1 parent 94e8619 commit f25e211
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.1] - Feb 1, 2022

### Changed

- fixed bugs in the example notifiers around kwargs processing.
- moved to tag-based refs in terragrunt configurations to show a best practice using a stable artifact.

## [0.1.0] - Jan 31, 2022

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The annotation value should point to a user-configured secret in Secret Manager.
This secret should contain configuration values that the notifier unpacks during
an execution. This is a powerful pattern for a few reasons:

1. It's secure - some notifiers will require secret data, others won't necessarily, but it's not a bad practice to treat all configuration as sensitive and RBAC controlled.
1. It's secure - some notifiers will require secret data, others won't necessarily, but it's a good practice to treat all configuration as potentially sensitive and RBAC controlled.
2. Notifiers can be liberally deployed without affecting existing deploy pipelines - enabling a notifier requires an annotation on opting-in deployment pipelines and the configuration in secret manager.

## Deploy notifier index
Expand Down
5 changes: 2 additions & 3 deletions demo/terragrunt/cloud-deploy-foundation/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ include {
}

terraform {
# TODO(bjb): switch to a tag ref
# source = "github.com/computeclub/gcp-cloud-deploy-notifiers//terraform/cloud-deploy-notification-infra?ref=main"
source = "${find_in_parent_folders("gcp-cloud-deploy-notifiers")}//terraform/cloud-deploy-notification-infra"
source = "github.com/computeclub/gcp-cloud-deploy-notifiers//terraform/cloud-deploy-notification-infra?ref=v0.1.0"
# source = "${find_in_parent_folders("gcp-cloud-deploy-notifiers")}//terraform/cloud-deploy-notification-infra"
}

locals {
Expand Down
7 changes: 3 additions & 4 deletions demo/terragrunt/echo-fastapi/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ include {
}

terraform {
# TODO(bjb): switch to a tag ref
# source = "github.com/computeclub/gcp-cloud-deploy-notifiers//terraform/cloud-deploy-notifier?ref=main"
source = "${find_in_parent_folders("gcp-cloud-deploy-notifiers")}//terraform/cloud-deploy-notifier"
source = "github.com/computeclub/gcp-cloud-deploy-notifiers//terraform/cloud-deploy-notifier?ref=v0.1.0"
# source = "${find_in_parent_folders("gcp-cloud-deploy-notifiers")}//terraform/cloud-deploy-notifier"
before_hook "before_hook" {
commands = ["apply"]
execute = [
Expand Down Expand Up @@ -47,7 +46,7 @@ inputs = {
env_vars = [
{
name = "LOG_LEVEL"
value = "INFO"
value = "DEBUG"
},
{
name = "SRC_SHA1"
Expand Down
2 changes: 0 additions & 2 deletions demo/terragrunt/nginx-app-infra/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include {
}

terraform {
# TODO(bjb): switch to a tag ref
# source = "github.com/computeclub/gcp-cloud-deploy-notifiers//demo/nginx-app/terraform?ref=main"
source = "${find_in_parent_folders("nginx-app")}//terraform"
after_hook "after_hook" {
commands = ["apply"]
Expand Down
5 changes: 2 additions & 3 deletions demo/terragrunt/release-auto-promoter-notifier/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ include {
}

terraform {
# TODO(bjb): switch to a tag ref
# source = "github.com/computeclub/gcp-cloud-deploy-notifiers//terraform/cloud-deploy-notifier?ref=main"
source = "${find_in_parent_folders("gcp-cloud-deploy-notifiers")}//terraform/cloud-deploy-notifier"
source = "github.com/computeclub/gcp-cloud-deploy-notifiers//terraform/cloud-deploy-notifier?ref=v0.1.0"
# source = "${find_in_parent_folders("gcp-cloud-deploy-notifiers")}//terraform/cloud-deploy-notifier"
before_hook "before_hook" {
commands = ["apply"]
execute = [
Expand Down

0 comments on commit f25e211

Please sign in to comment.