|
| 1 | +## Components PR [#905](https://github.com/cloudposse/terraform-aws-components/pull/905) |
| 2 | + |
| 3 | +The `notifications.tf` file has been renamed to `notifications.tf`. Delete `notifications.tf` after vendoring these |
| 4 | +changes. |
| 5 | + |
| 6 | +## Components PR [#851](https://github.com/cloudposse/terraform-aws-components/pull/851) |
| 7 | + |
| 8 | +This is a bug fix and feature enhancement update. There are few actions necessary to upgrade. |
| 9 | + |
| 10 | +## Upgrade actions |
| 11 | + |
| 12 | +1. Update atmos stack yaml config |
| 13 | + 1. Add `github_default_notifications_enabled: true` |
| 14 | + 2. Add `github_webhook_enabled: true` |
| 15 | + 3. Remove `notifications_triggers` |
| 16 | + 4. Remove `notifications_templates` |
| 17 | + 5. Remove `notifications_notifiers` |
| 18 | + |
| 19 | +```diff |
| 20 | + components: |
| 21 | + terraform: |
| 22 | + argocd: |
| 23 | + settings: |
| 24 | + spacelift: |
| 25 | + workspace_enabled: true |
| 26 | + metadata: |
| 27 | + component: eks/argocd |
| 28 | + vars: |
| 29 | ++ github_default_notifications_enabled: true |
| 30 | ++ github_webhook_enabled: true |
| 31 | +- notifications_triggers: |
| 32 | +- trigger_on-deployed: |
| 33 | +- - when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy' |
| 34 | +- oncePer: app.status.sync.revision |
| 35 | +- send: [app-deployed] |
| 36 | +- notifications_templates: |
| 37 | +- template_app-deployed: |
| 38 | +- message: | |
| 39 | +- Application {{.app.metadata.name}} is now running new version of deployments manifests. |
| 40 | +- github: |
| 41 | +- status: |
| 42 | +- state: success |
| 43 | +- label: "continuous-delivery/{{.app.metadata.name}}" |
| 44 | +- targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" |
| 45 | +- notifications_notifiers: |
| 46 | +- service_github: |
| 47 | +- appID: xxxxxxx |
| 48 | +- installationID: xxxxxxx |
| 49 | +``` |
| 50 | + |
| 51 | +2. Move secrets from `/argocd/notifications/notifiers/service_webhook_github-commit-status/github-token` to |
| 52 | + `argocd/notifications/notifiers/common/github-token` |
| 53 | + |
| 54 | +```bash |
| 55 | +chamber read -q argocd/notifications/notifiers/service_webhook_github-commit-status github-token | chamber write argocd/notifications/notifiers/common github-token |
| 56 | +chamber delete argocd/notifications/notifiers/service_webhook_github-commit-status github-token |
| 57 | +``` |
| 58 | + |
| 59 | +3. [Create GitHub PAT ](https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token) |
| 60 | + with scope `admin:repo_hook` |
| 61 | +4. Save the PAT to SSM `/argocd/github/api_key` |
| 62 | + |
| 63 | +```bash |
| 64 | +chamber write argocd/github api_key ${PAT} |
| 65 | +``` |
| 66 | + |
| 67 | +5. Apply changes with atmos |
| 68 | + |
| 69 | +## Features |
| 70 | + |
| 71 | +- [Git Webhook Configuration](https://argo-cd.readthedocs.io/en/stable/operator-manual/webhook/) - makes GitHub trigger |
| 72 | + ArgoCD sync on each commit into argocd repo |
| 73 | +- Replace |
| 74 | + [GitHub notification service](https://argo-cd.readthedocs.io/en/stable/operator-manual/notifications/services/github/) |
| 75 | + with predefined |
| 76 | + [Webhook notification service](https://argo-cd.readthedocs.io/en/stable/operator-manual/notifications/services/webhook/) |
| 77 | +- Added predefined GitHub commit status notifications for CD sync mode: |
| 78 | + - `on-deploy-started` |
| 79 | + - `app-repo-github-commit-status` |
| 80 | + - `argocd-repo-github-commit-status` |
| 81 | + - `on-deploy-succeded` |
| 82 | + - `app-repo-github-commit-status` |
| 83 | + - `argocd-repo-github-commit-status` |
| 84 | + - `on-deploy-failed` |
| 85 | + - `app-repo-github-commit-status` |
| 86 | + - `argocd-repo-github-commit-status` |
| 87 | +- Support SSM secrets (`/argocd/notifications/notifiers/common/*`) common for all notification services. (Can be |
| 88 | + referenced with `$common_{secret-name}` ) |
| 89 | + |
| 90 | +### Bug Fixes |
| 91 | + |
| 92 | +- ArgoCD notifications pods recreated on deployment that change notifications related configs and secrets |
| 93 | +- Remove `metadata` output that expose helm values configs (used in debug purpose) |
| 94 | +- Remove legacy unnecessary helm values used in old ArgoCD versions (ex. `workflow auth` configs) and dropped |
| 95 | + notifications services |
| 96 | + |
| 97 | +## Breaking changes |
| 98 | + |
| 99 | +- Removed `service_github` from `notifications_notifiers` variable structure |
| 100 | +- Renamed `service_webhook` to `webhook` in `notifications_notifiers` variable structure |
| 101 | + |
| 102 | +```diff |
| 103 | +variable "notifications_notifiers" { |
| 104 | + type = object({ |
| 105 | + ssm_path_prefix = optional(string, "/argocd/notifications/notifiers") |
| 106 | +- service_github = optional(object({ |
| 107 | +- appID = number |
| 108 | +- installationID = number |
| 109 | +- privateKey = optional(string) |
| 110 | +- })) |
| 111 | + # service.webhook.<webhook-name>: |
| 112 | +- service_webhook = optional(map( |
| 113 | ++ webhook = optional(map( |
| 114 | + object({ |
| 115 | + url = string |
| 116 | + headers = optional(list( |
| 117 | + }) |
| 118 | + )) |
| 119 | + }) |
| 120 | +``` |
| 121 | + |
| 122 | +- Removed `github` from `notifications_templates` variable structure |
| 123 | + |
| 124 | +```diff |
| 125 | +variable "notifications_templates" { |
| 126 | + type = map(object({ |
| 127 | + message = string |
| 128 | + alertmanager = optional(object({ |
| 129 | + labels = map(string) |
| 130 | + annotations = map(string) |
| 131 | + generatorURL = string |
| 132 | + })) |
| 133 | +- github = optional(object({ |
| 134 | +- status = object({ |
| 135 | +- state = string |
| 136 | +- label = string |
| 137 | +- targetURL = string |
| 138 | +- }) |
| 139 | +- })) |
| 140 | + webhook = optional(map( |
| 141 | + object({ |
| 142 | + method = optional(string) |
| 143 | + path = optional(string) |
| 144 | + body = optional(string) |
| 145 | + }) |
| 146 | + )) |
| 147 | + })) |
| 148 | +``` |
0 commit comments