Skip to content

Commit

Permalink
feat: add discord webhook secret
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur committed Dec 30, 2024
1 parent c6ece41 commit 79a95f4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tofu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
PG_CONN_STR: ${{ secrets.PG_CONN_STR }}
TF_VAR_bitwarden_token: ${{ secrets.BITWARDEN_TOKEN }}
TF_VAR_discord_webhook: ${{ secrets.DISCORD_WEBHOOK_FLUX_EU_1 }}
TF_VAR_github_token: ${{ secrets.PAT }}
run: |
tofu -chdir=./terraform/linode init -upgrade
- env:
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
PG_CONN_STR: ${{ secrets.PG_CONN_STR }}
TF_VAR_bitwarden_token: ${{ secrets.BITWARDEN_TOKEN }}
TF_VAR_discord_webhook: ${{ secrets.DISCORD_WEBHOOK_FLUX_EU_1 }}
TF_VAR_github_token: ${{ secrets.PAT }}
run: |
tofu -chdir=./terraform/linode \
Expand Down
1 change: 1 addition & 0 deletions terraform/linode/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ module "eu-1" {
github_repo = "https://github.com/anza-labs/manifests"
github_token = var.github_token
bitwarden_token = var.bitwarden_token
discord_webhook = var.discord_webhook
}
14 changes: 14 additions & 0 deletions terraform/linode/modules/lke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ resource "kubernetes_secret" "bitwarden" {
}
}

resource "kubernetes_secret" "discord_webhook" {
depends_on = [linode_lke_cluster.lke]
count = var.flux ? 1 : 0

metadata {
name = "discord-webhook"
namespace = "flux-system"
}

data = {
address = var.discord_webhook
}
}

data "kubernetes_nodes" "nodes" {
depends_on = [ linode_lke_cluster.lke ]
}
5 changes: 5 additions & 0 deletions terraform/linode/modules/lke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ variable "bitwarden_token" {
nullable = false
}

variable "discord_webhook" {
type = string
nullable = false
}

variable "node_pools" {
type = list(object({
type = string
Expand Down
4 changes: 4 additions & 0 deletions terraform/linode/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ variable "github_token" {
variable "bitwarden_token" {
type = string
}

variable "discord_webhook" {
type = string
}

0 comments on commit 79a95f4

Please sign in to comment.