Skip to content

Commit c1ee055

Browse files
authored
ci(terraform): Add matrix for multi environment deployment (#35)
1 parent f523f29 commit c1ee055

25 files changed

+700
-375
lines changed

.envrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/README.md

Lines changed: 93 additions & 55 deletions
Large diffs are not rendered by default.

.github/workflows/terraform-ci.yaml

Lines changed: 100 additions & 207 deletions
Large diffs are not rendered by default.

.github/workflows/terraform-docs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
name: Terraform Docs
2+
run-name: ${{ github.event.workflow_run.display_title }}
23

34
on:
4-
pull_request:
5-
types: [closed]
6-
branches: [main]
7-
paths:
8-
- "**/*.tf"
9-
- "**/*.tfvars"
10-
- "**/*.tftpl"
5+
workflow_run:
6+
workflows: [Terraform CI]
7+
types: [completed]
118

129
# Disable permissions for all available scopes
1310
permissions: {}
1411

1512
jobs:
1613
terraform-docs:
17-
if: ${{ github.event.pull_request.merged == true }}
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1815
name: Terraform Docs
1916
uses: 3ware/workflows/.github/workflows/terraform-docs.yaml@7880d6b986d1d689f5d219e901b863f1378fea9c # v4.4.0
2017
secrets: inherit
2118
with:
22-
tf-directory: terraform/development
19+
tf-directory: terraform

.github/workflows/wait-for-checks.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Checks
2+
run-name: ${{ github.event_name == 'merge_group' && github.event.merge_group.head_commit.message || ''}}
23

34
on:
45
pull_request:
56
branches: [main]
6-
types: [opened, edited, synchronize]
7+
merge_group:
8+
types: [checks_requested]
79

810
# Disable permissions for all available scopes
911
permissions: {}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ override.tf.json
2727

2828
# Ignore CLI configuration files
2929
.terraformrc
30-
terraform.rc
30+
terraform.rc
31+
32+
# Ignore direnv files
33+
.envrc

.trunk/trunk.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
33
version: 0.1
44
cli:
5-
version: 1.22.6
5+
version: 1.22.7
66
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.6.3
10+
ref: v1.6.4
1111
uri: https://github.com/trunk-io/plugins
1212
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1313
runtimes:
@@ -17,19 +17,19 @@ runtimes:
1717
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
1818
lint:
1919
disabled:
20+
- checkov
21+
- trivy
2022
- regal
2123
enabled:
22-
23-
24+
2425
2526
2627
commands: [fmt, validate]
2728
28-
2929
- git-diff-check
3030
3131
32-
- trufflehog@3.82.8
32+
- trufflehog@3.83.2
3333
3434
definitions:
3535
- name: tflint
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
development_aws_account_id: ENC[AES256_GCM,data:DJFVyfC1L2sU3Rg3,iv:/tY8GG2lda8IP2ITG72Xh4sMs+Tt4VNAP1Qb1LdTZoM=,tag:GwieQ56POhsSxjexHYx9fg==,type:int]
2+
sops:
3+
kms: []
4+
gcp_kms: []
5+
azure_kv: []
6+
hc_vault: []
7+
age:
8+
- recipient: age1wpy4kcrhan5ffwwv9dke50v9e302lhravg2njkze9qu33xgnr42q9p2d22
9+
enc: |
10+
-----BEGIN AGE ENCRYPTED FILE-----
11+
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoSml5M1p6MHIzaitVaGVW
12+
OTBZNVBQRmVXU2FENXFnb2UvdFNFYTJhSG1ZCk5FSEUvZFZiVUJFdzVXdC9hclNj
13+
T0NicFFSZ212QkdlRTFuQ3lSZUpVMWsKLS0tIFVta2pYaC9VMXlnbU1KNW1Zcnk4
14+
aXRkOUhWakRBUEtxSWdFVkw2R3ZscFEKm9zke6+CQFYyFohhm2XLMqW3ffkPs10d
15+
Lk5rBlAmGTsneyVHNdBrF/zjD6nKOqs7MZudWX+rZFgeSBnSjxo8qA==
16+
-----END AGE ENCRYPTED FILE-----
17+
lastmodified: "2024-11-01T11:23:38Z"
18+
mac: ENC[AES256_GCM,data:UItGJx1VhU+OtH0B7wcrBdiLjS3sZQwvZ+9pRLA7alkUU56AkdhSGHIIOrstdO8Nnb3Yjt4mPpwyKHUx1r3eIczQUGqUxa3h8kaF7fzyhf3RkJdLsnYRxvjvk7iHRKr/Ey0wtFFa5cGo7bSj2Ar0RTARq1pglLGJ6kRDjMzWaJo=,iv:HHzgmVOWktFiW5YaFEFyMy2wlhPc/v5v1+ccLpRZsB0=,tag:ipbezFjdtACwvEosS+p0Lg==,type:str]
19+
pgp: []
20+
unencrypted_suffix: _unencrypted
21+
version: 3.9.1

terraform/development/.terraform.lock.hcl

Lines changed: 16 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/development/outputs.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
output "aws_account_id" {
2-
description = "AWS account number resources are deployed into"
3-
value = data.aws_caller_identity.current.account_id
4-
sensitive = true
5-
}
6-
7-
output "default_tags" {
8-
description = "A map of default tags applied to resources."
9-
value = data.aws_default_tags.this.tags
10-
}
11-
121
output "grafana_ip" {
132
description = "The connection details of the grafana server."
143
value = "http://${aws_instance.grafana_server.public_ip}:3000"

0 commit comments

Comments
 (0)