Skip to content

Commit c505c23

Browse files
authored
chore: update with the latest template state (#55)
## what - Updates the module with the recent config changes in [terraform-module-template](https://github.com/masterpointio/terraform-module-template) ## why - Housekeeping. ## references - [INT-66](https://www.notion.so/masterpoint/Keep-terraform-template-module-up-to-latest-good-practices-1dd859758a568002b398c2a0fc2cb67d?pvs=4)
1 parent 59acbd6 commit c505c23

20 files changed

+383
-175
lines changed

.coderabbit.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ language: en
77
tone_instructions: |
88
Provide feedback in a professional, friendly, constructive, and concise tone.
99
Offer clear, specific suggestions and best practices to help enhance the code quality and promote learning.
10+
Be concise and only comment on significant issues.
1011
1112
early_access: true
1213

@@ -26,21 +27,25 @@ knowledge_base:
2627
reviews:
2728
profile: chill
2829
auto_review:
29-
# Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive)
30+
# Disable incremental code review on each push
31+
auto_incremental_review: false
32+
# The keywords are case-insensitive
3033
ignore_title_keywords:
3134
- wip
3235
- draft
3336
- test
34-
# Set the commit status to 'pending' when the review is in progress and 'success' when it is complete.
3537
commit_status: false
36-
# Post review details on each review. Additionally, post a review status when a review is skipped in certain cases.
37-
review_status: false
3838
path_instructions:
3939
- path: "**/*.tf"
4040
instructions: |
4141
You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.org/docs/.
4242
You have a strong grasp of Terraform syntax and prioritize providing accurate and insightful code suggestions.
4343
As a fan of the Cloud Posse / SweetOps ecosystem, you incorporate many of their best practices https://docs.cloudposse.com/best-practices/terraform/ while balancing them with general Terraform guidelines.
44+
changed_files_summary: false
45+
poem: false
46+
# Don't post review details on each review.
47+
review_status: false
48+
sequence_diagrams: false
4449
tools:
4550
# By default, all tools are enabled.
4651
# Masterpoint uses Trunk (https://trunk.io) so we do not need a lot of this feedback due to overlap.

.editorconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,8 @@ indent_style = space
77
insert_final_newline = true
88
trim_trailing_whitespace = true
99

10-
[*.{tf,tfvars}]
11-
indent_size = 2
12-
indent_style = space
13-
1410
[*.md]
1511
max_line_length = 0
16-
trim_trailing_whitespace = false
17-
18-
# Override for Makefile
19-
[{Makefile, makefile, GNUmakefile, Makefile.*}]
20-
tab_width = 2
21-
indent_style = tab
22-
indent_size = 4
2312

2413
[COMMIT_EDITMSG]
2514
max_line_length = 0

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Order is important: the last matching pattern takes the most precedence
55

66
# These owners will be the default owners for everything
7-
* @masterpointio/masterpoint-internal
7+
* @masterpointio/masterpoint-open-source

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## what
2-
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
3-
* Use bullet points to be concise and to the point.
2+
3+
- Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
4+
- Use bullet points to be concise and to the point.
45

56
## why
6-
* Provide the justifications for the changes (e.g. business case).
7-
* Describe why these changes were made (e.g. why do these commits fix the problem?)
8-
* Use bullet points to be concise and to the point.
7+
8+
- Provide the justifications for the changes (e.g. business case).
9+
- Describe why these changes were made (e.g. why do these commits fix the problem?)
10+
- Use bullet points to be concise and to the point.
911

1012
## references
11-
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
12-
* Use `closes #123`, if this PR closes a GitHub issue `#123`
1313

14+
- Link to any supporting GitHub issues or helpful documentation to add some context (e.g. Stackoverflow).
15+
- Use `closes #123`, if this PR closes a GitHub issue `#123`

.github/renovate.json5

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"extends": [
3+
"config:best-practices",
4+
"github>aquaproj/aqua-renovate-config#2.7.5"
5+
],
6+
"enabledManagers": [
7+
"terraform",
8+
"github-actions"
9+
],
10+
"terraform": {
11+
"ignorePaths": [
12+
"**/context.tf" // Mixin file https://github.com/cloudposse/terraform-null-label/blob/main/exports/context.tf
13+
],
14+
"fileMatch": [
15+
"\\.tf$",
16+
"\\.tofu$"
17+
]
18+
},
19+
"schedule": [
20+
"after 9am on the first day of the month"
21+
],
22+
"assigneesFromCodeOwners": true,
23+
"dependencyDashboardAutoclose": true,
24+
"addLabels": ["{{manager}}"],
25+
"packageRules": [
26+
{
27+
"matchManagers": ["github-actions"],
28+
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
29+
"automerge": true,
30+
"automergeType": "branch",
31+
"groupName": "github-actions-auto-upgrade",
32+
"addLabels": ["auto-upgrade"]
33+
},
34+
{
35+
"matchManagers": ["github-actions"],
36+
"matchUpdateTypes": ["major"],
37+
"groupName": "github-actions-needs-review",
38+
"addLabels": ["needs-review"]
39+
},
40+
{
41+
"matchManagers": ["terraform"],
42+
"groupName": "tf",
43+
"addLabels": ["needs-review"]
44+
},
45+
{
46+
"matchFileNames": ["**/*.tofu", "**/*.tf"],
47+
"matchDatasources": ["terraform-provider", "terraform-module"],
48+
"registryUrls": ["https://registry.opentofu.org"],
49+
"groupName": "tf"
50+
},
51+
{
52+
"matchFileNames": ["**/*.tofu"],
53+
"matchDepTypes": ["required_version"],
54+
"registryUrls": ["https://registry.opentofu.org"],
55+
"groupName": "tf"
56+
},
57+
{
58+
"matchFileNames": ["**/*.tf"],
59+
"matchDepTypes": ["required_version"],
60+
"registryUrls": ["https://registry.terraform.io"],
61+
"groupName": "tf"
62+
}
63+
]
64+
}

.github/workflows/lint.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ permissions:
1313
pull-requests: read
1414

1515
jobs:
16-
trunk-check:
16+
lint:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Check out Git repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
- name: Trunk Check
22-
uses: trunk-io/trunk-action@86b68ffae610a05105e90b1f52ad8c549ef482c2
22+
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
2323

2424
conventional-title:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017
27+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-please.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ on:
88
permissions:
99
contents: write
1010
pull-requests: write
11+
issues: write
1112

1213
jobs:
1314
release-please:
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f
17+
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f #v4.1.3
1718
with:
1819
release-type: terraform-module

.github/workflows/test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: TF Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
actions: read
11+
checks: write
12+
contents: read
13+
id-token: write
14+
pull-requests: read
15+
16+
jobs:
17+
tf-test:
18+
name: 🧪 ${{ matrix.tf }} test
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
tf: [tofu, terraform]
23+
steps:
24+
- uses: masterpointio/github-action-tf-test@c3b619f3bca9e4f482b9e0fb3166ab3f02d9d54c # v1.0.0
25+
with:
26+
tf_type: ${{ matrix.tf }}
27+
aws_role_arn: ${{ vars.TF_TEST_AWS_ROLE_ARN }}
28+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/trunk-upgrade.yaml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
1-
name: Monthly Trunk Upgrade
1+
name: Trunk Upgrade
2+
23
on:
34
schedule:
45
# On the first day of every month @ 8am
56
- cron: 0 8 1 * *
6-
# Allows us to manually run the workflow from Actions UI
77
workflow_dispatch: {}
8+
89
permissions: read-all
10+
911
jobs:
10-
trunk_upgrade:
11-
name: Upgrade Trunk
12+
trunk-upgrade:
1213
runs-on: ubuntu-latest
1314
permissions:
14-
contents: write # For trunk to create PRs
15-
pull-requests: write # For trunk to create PRs
15+
# For trunk to create PRs
16+
contents: write
17+
pull-requests: write
1618
steps:
1719
- name: Checkout
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1921

20-
- name: Trunk Upgrade
21-
uses: trunk-io/trunk-action/upgrade@2eaee169140ec559bd556208f9f99cdfdf468da8 # v1.1.18
22+
- name: Create Token for MasterpointBot App
23+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
24+
id: generate-token
2225
with:
23-
base: main
26+
app_id: ${{ secrets.MP_BOT_APP_ID }}
27+
private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
28+
29+
- name: Upgrade
30+
id: trunk-upgrade
31+
uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
32+
with:
33+
github-token: ${{ steps.generate-token.outputs.token }}
2434
reviewers: "@masterpointio/masterpoint-internal"
2535
prefix: "chore: "
36+
37+
- name: Merge PR automatically
38+
if: steps.trunk-upgrade.outputs.pull-request-number != ''
39+
env:
40+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
41+
PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }}
42+
run: |
43+
gh pr merge "$PR_NUMBER" --squash --auto --delete-branch

.gitignore

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,46 @@
1-
# Local .terraform directories
2-
**/.terraform/*
1+
# Ignore override files as they are usually used to override resources locally
2+
*override.tf
3+
*override.tf.json
34

45
# .tfstate files
56
*.tfstate
67
*.tfstate.*
7-
.terraform
8-
.terraform.tfstate.lock.info
98

10-
# Cloud Posse Build Harness https://github.com/cloudposse/build-harness
11-
**/.build-harness
12-
**/build-harness
9+
# Local .terraform directories
10+
**/.terraform/*
1311

14-
# Crash log files
15-
crash.log
16-
test.log
12+
# Ignore the root .terraform.lock.hcl file (Child modules don't want this)
13+
.terraform.lock.hcl
14+
!examples/**/.terraform.lock.hcl
1715

18-
# Random
16+
# IDE/Editor settings
1917
**/.idea
2018
**/*.iml
21-
.DS_Store
19+
.vscode/
20+
*.orig
21+
*.draft
22+
*~
23+
24+
# Build Harness https://github.com/cloudposse/build-harness
25+
**/.build-harness
26+
**/build-harness
27+
28+
# Log files
29+
*.log
30+
31+
# Output from other tools that might be used alongside Terraform/OpenTofu
32+
*.tfvars.json
33+
backend.tf.json
34+
35+
# Taskit files
36+
.taskit/
37+
.task/
38+
.env.taskit-secrets
39+
40+
# Other
41+
**/*.backup
42+
***/*.tmp
43+
**/*.temp
44+
**/*.bak
45+
**/*.*swp
46+
**/.DS_Store

0 commit comments

Comments
 (0)