Skip to content

Commit 7af1d80

Browse files
chore: Update Terraform versions and required providers in modules
1 parent 0880c1d commit 7af1d80

37 files changed

+2049
-2789
lines changed

.cspell.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ignorePaths": [
3+
"**/node_modules/**",
4+
"**/vscode-extension/**",
5+
"**/.git/**",
6+
"**/.pnpm-lock.json",
7+
".vscode",
8+
"megalinter",
9+
"package-lock.json",
10+
"report"
11+
],
12+
"language": "en",
13+
"noConfigSearch": true,
14+
"words": ["megalinter", "oxsecurity"],
15+
"version": "0.2"
16+
}

.envrc.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
ENVIRONMENT="sandbox"
4+
5+
AWS_PROFILE="nan-${ENVIRONMENT}-admin"
6+
AWS_REGION="us-west-2"
7+
8+
export ENVIRONMENT AWS_PROFILE AWS_REGION
9+
10+
# Check if the AWS session is valid; otherwise, run the SSO login.
11+
if ! aws sts get-caller-identity > /dev/null 2>&1; then
12+
echo "AWS session expired or not found. Logging in with SSO for profile $AWS_PROFILE..."
13+
aws sso login
14+
fi
15+
16+
KUBECONFIG="$(realpath .kubeconfig/nan-${ENVIRONMENT}-services-platform-cluster)"
17+
18+
export KUBECONFIG

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
# What's this PR do?
1+
## Description
22

3-
_Summary of changes in this PR or what it accomplishes._
3+
Please include a summary of the changes and the related issue. List any dependencies that are required for this change.
44

5-
<!--
5+
Fixes # (issue)
66

7-
Please title your PR as follows: `feature: fix foo bar`.
8-
Always start with the thing you are fixing, then describe the fix.
9-
Don't use past tense (e.g. "fixed foo bar").
7+
## Type of Change
108

11-
Explain what your PR does and why.
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
1213

13-
If you are adding a new function, please document it and add tests:
14+
## How Has This Been Tested?
1415

15-
```
16-
code you added/updated
17-
```
16+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
1817

19-
If you are fixing a bug, please add a test that covers it.
18+
- [ ] Test A
19+
- [ ] Test B
2020

21-
Before submitting a PR, please:
22-
- specify the command to execute or steps to follow to know that the problem was solved
21+
## Checklist
2322

24-
We try to process PRs as soon as possible. They should be handled within 24 hours.
25-
26-
Applying labels to PRs is not needed.
27-
28-
Thanks a lot for your contribution!
29-
30-
->
23+
- [ ] My code follows the style guidelines of this project
24+
- [ ] I have performed a self-review of my code
25+
- [ ] I have commented my code, particularly in hard-to-understand areas
26+
- [ ] I have made corresponding changes to the documentation
27+
- [ ] My changes generate no new warnings
28+
- [ ] Any dependent changes have been merged and published in downstream modules
29+
- [ ] I have checked my code and corrected any misspellings

.github/workflows/danger.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ jobs:
2323

2424
steps:
2525
- name: Begin CI...
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version-file: ./tools/danger/.node-version
2731

2832
- name: Setup Danger Files
2933
run: |
3034
echo "Setting up Danger files..."
3135
mv tools/danger/* .
3236
33-
- uses: actions/setup-node@v3
34-
with:
35-
node-version: "v16.13.2"
36-
3737
- name: Install dependencies
38-
run: npm install
38+
run: pnpm install --frozen-lockfile
3939

4040
- name: Danger JS Action
41-
uses: danger/danger-js@9.1.8
41+
uses: danger/danger-js@12.3.3
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}

.github/workflows/lint.yml

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

.github/workflows/mega-linter.yml

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# MegaLinter GitHub Action configuration file
2+
# More info at https://megalinter.io
3+
---
4+
name: MegaLinter
5+
6+
# Trigger mega-linter at every push. Action will also be visible from
7+
# Pull Requests to main
8+
on:
9+
# Comment this line to trigger action only on pull-requests
10+
# (not recommended if you don't pay for GH Actions)
11+
push:
12+
13+
pull_request:
14+
branches:
15+
- main
16+
17+
# Comment env block if you do not want to apply fixes
18+
env:
19+
# Apply linter fixes configuration
20+
#
21+
# When active, APPLY_FIXES must also be defined as environment variable
22+
# (in github/workflows/mega-linter.yml or other CI tool)
23+
APPLY_FIXES: all
24+
25+
# Decide which event triggers application of fixes in a commit or a PR
26+
# (pull_request, push, all)
27+
APPLY_FIXES_EVENT: pull_request
28+
29+
# If APPLY_FIXES is used, defines if the fixes are directly committed (commit)
30+
# or posted in a PR (pull_request)
31+
APPLY_FIXES_MODE: commit
32+
33+
concurrency:
34+
group: ${{ github.ref }}-${{ github.workflow }}
35+
cancel-in-progress: true
36+
37+
jobs:
38+
megalinter:
39+
name: MegaLinter
40+
runs-on: ubuntu-latest
41+
42+
# Give the default GITHUB_TOKEN write permission to commit and push, comment
43+
# issues, and post new Pull Requests; remove the ones you do not need
44+
permissions:
45+
contents: write
46+
issues: write
47+
pull-requests: write
48+
49+
steps:
50+
# Git Checkout
51+
- name: Checkout Code
52+
uses: actions/checkout@v4
53+
with:
54+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
55+
56+
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
57+
# improve performance
58+
fetch-depth: 0
59+
60+
# MegaLinter
61+
- name: MegaLinter
62+
63+
# You can override MegaLinter flavor used to have faster performances
64+
# More info at https://megalinter.io/latest/flavors/
65+
uses: oxsecurity/megalinter/flavors/terraform@v8
66+
67+
id: ml
68+
69+
# All available variables are described in documentation
70+
# https://megalinter.io/latest/config-file/
71+
env:
72+
# Validates all source when push on main, else just the git diff with
73+
# main. Override with true if you always want to lint all sources
74+
#
75+
# To validate the entire codebase, set to:
76+
# VALIDATE_ALL_CODEBASE: true
77+
#
78+
# To validate only diff with main, set to:
79+
# VALIDATE_ALL_CODEBASE: >-
80+
# ${{
81+
# github.event_name == 'push' &&
82+
# github.ref == 'refs/heads/main'
83+
# }}
84+
VALIDATE_ALL_CODEBASE: >-
85+
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
86+
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
89+
# Uncomment to use ApiReporter (Grafana)
90+
# API_REPORTER: true
91+
# API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }}
92+
# API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
93+
# API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
94+
# API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }}
95+
# API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
96+
# API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
97+
# API_REPORTER_DEBUG: false
98+
99+
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF
100+
# .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
101+
102+
# Upload MegaLinter artifacts
103+
- name: Archive production artifacts
104+
uses: actions/upload-artifact@v4
105+
if: success() || failure()
106+
with:
107+
name: MegaLinter reports
108+
path: |
109+
megalinter-reports
110+
mega-linter.log
111+
112+
# Create pull request if applicable
113+
# (for now works only on PR from same repository, not from forks)
114+
- name: Create Pull Request with applied fixes
115+
uses: peter-evans/create-pull-request@v6
116+
id: cpr
117+
if: >-
118+
steps.ml.outputs.has_updated_sources == 1 &&
119+
(
120+
env.APPLY_FIXES_EVENT == 'all' ||
121+
env.APPLY_FIXES_EVENT == github.event_name
122+
) &&
123+
env.APPLY_FIXES_MODE == 'pull_request' &&
124+
(
125+
github.event_name == 'push' ||
126+
github.event.pull_request.head.repo.full_name == github.repository
127+
) &&
128+
!contains(github.event.head_commit.message, 'skip fix')
129+
with:
130+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
131+
commit-message: "[MegaLinter] Apply linters automatic fixes"
132+
title: "[MegaLinter] Apply linters automatic fixes"
133+
labels: bot
134+
135+
- name: Create PR output
136+
if: >-
137+
steps.ml.outputs.has_updated_sources == 1 &&
138+
(
139+
env.APPLY_FIXES_EVENT == 'all' ||
140+
env.APPLY_FIXES_EVENT == github.event_name
141+
) &&
142+
env.APPLY_FIXES_MODE == 'pull_request' &&
143+
(
144+
github.event_name == 'push' ||
145+
github.event.pull_request.head.repo.full_name == github.repository
146+
) &&
147+
!contains(github.event.head_commit.message, 'skip fix')
148+
run: |
149+
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
150+
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
151+
152+
# Push new commit if applicable
153+
# (for now works only on PR from same repository, not from forks)
154+
- name: Prepare commit
155+
if: >-
156+
steps.ml.outputs.has_updated_sources == 1 &&
157+
(
158+
env.APPLY_FIXES_EVENT == 'all' ||
159+
env.APPLY_FIXES_EVENT == github.event_name
160+
) &&
161+
env.APPLY_FIXES_MODE == 'commit' &&
162+
github.ref != 'refs/heads/main' &&
163+
(
164+
github.event_name == 'push' ||
165+
github.event.pull_request.head.repo.full_name == github.repository
166+
) &&
167+
!contains(github.event.head_commit.message, 'skip fix')
168+
run: sudo chown -Rc $UID .git/
169+
170+
- name: Commit and push applied linter fixes
171+
uses: stefanzweifel/git-auto-commit-action@v5
172+
if: >-
173+
steps.ml.outputs.has_updated_sources == 1 &&
174+
(
175+
env.APPLY_FIXES_EVENT == 'all' ||
176+
env.APPLY_FIXES_EVENT == github.event_name
177+
) &&
178+
env.APPLY_FIXES_MODE == 'commit' &&
179+
github.ref != 'refs/heads/main' &&
180+
(
181+
github.event_name == 'push' ||
182+
github.event.pull_request.head.repo.full_name == github.repository
183+
) &&
184+
!contains(github.event.head_commit.message, 'skip fix')
185+
with:
186+
branch: >-
187+
${{
188+
github.event.pull_request.head.ref ||
189+
github.head_ref ||
190+
github.ref
191+
}}
192+
commit_message: "[MegaLinter] Apply linters fixes"
193+
commit_user_name: megalinter-bot
194+
commit_user_email: [email protected]

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ override.tf.json
3131
*tfplan*
3232

3333
*.pem
34+
35+
.kubeconfig
36+
.envrc
37+
38+
megalinter-reports/

.jscpd.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"threshold": 0,
3+
"reporters": ["html", "markdown"],
4+
"ignore": [
5+
"**/node_modules/**",
6+
"**/.git/**",
7+
"**/.rbenv/**",
8+
"**/.venv/**",
9+
"**/*cache*/**",
10+
"**/.github/**",
11+
"**/.idea/**",
12+
"**/report/**",
13+
"**/*.svg"
14+
]
15+
}

0 commit comments

Comments
 (0)