Skip to content

Commit cc0c1a9

Browse files
committed
feat: Added WAFv2 module
0 parents  commit cc0c1a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+7433
-0
lines changed

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
max_line_length = 80
9+
indent_style = space
10+
indent_size = 2
11+
12+
[*.{tf,tfvars}]
13+
indent_size = 2
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false
18+
19+
[Makefile]
20+
indent_style = tab
21+
tab_width = 2
22+
23+
[COMMIT_EDITMSG]
24+
max_line_length = off

.github/workflows/lock.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Lock Threads'
2+
3+
on:
4+
schedule:
5+
- cron: '50 1 * * *'
6+
7+
jobs:
8+
lock:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: dessant/lock-threads@v5
12+
with:
13+
github-token: ${{ secrets.GITHUB_TOKEN }}
14+
issue-comment: >
15+
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
16+
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
17+
issue-inactive-days: '30'
18+
pr-comment: >
19+
I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
20+
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
21+
pr-inactive-days: '30'

.github/workflows/pr-title.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Validate PR title'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/action-semantic-pull-request@v6.1.1
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
docs
27+
ci
28+
chore
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# Configure additional validation for the subject based on a regex.
32+
# This example ensures the subject starts with an uppercase character.
33+
subjectPattern: ^[A-Z].+$
34+
# If `subjectPattern` is configured, you can use this property to override
35+
# the default error message that is shown when the pattern doesn't match.
36+
# The variables `subject` and `title` can be used within the message.
37+
subjectPatternError: |
38+
The subject "{subject}" found in the pull request title "{title}"
39+
didn't match the configured pattern. Please ensure that the subject
40+
starts with an uppercase character.
41+
# For work-in-progress PRs you can typically use draft pull requests
42+
# from Github. However, private repositories on the free plan don't have
43+
# this option and therefore this action allows you to opt-in to using the
44+
# special "[WIP]" prefix to indicate this state. This will avoid the
45+
# validation of the PR title and the pull request checks remain pending.
46+
# Note that a second check will be reported if this is enabled.
47+
wip: true
48+
# When using "Squash and merge" on a PR with only one commit, GitHub
49+
# will suggest using that commit message instead of the PR title for the
50+
# merge commit, and it's easy to commit this by mistake. Enable this option
51+
# to also validate the commit message for one commit PRs.
52+
validateSingleCommit: false

.github/workflows/pre-commit.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Pre-Commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- master
8+
9+
env:
10+
TERRAFORM_DOCS_VERSION: v0.20.0
11+
TFLINT_VERSION: v0.59.1
12+
13+
jobs:
14+
collectInputs:
15+
name: Collect workflow inputs
16+
runs-on: ubuntu-latest
17+
outputs:
18+
directories: ${{ steps.dirs.outputs.directories }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
23+
- name: Get root directories
24+
id: dirs
25+
uses: clowdhaus/terraform-composite-actions/directories@v1.14.0
26+
27+
preCommitMinVersions:
28+
name: Min TF pre-commit
29+
needs: collectInputs
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
34+
steps:
35+
- name: Install rmz
36+
uses: jaxxstorm/action-install-gh-release@v2.1.0
37+
with:
38+
repo: SUPERCILEX/fuc
39+
asset-name: x86_64-unknown-linux-gnu-rmz
40+
rename-to: rmz
41+
chmod: 0755
42+
extension-matching: disable
43+
44+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
45+
- name: Delete unnecessary files
46+
run: |
47+
formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); }
48+
getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); }
49+
50+
BEFORE=$(getAvailableSpace)
51+
52+
ln -s /opt/hostedtoolcache/SUPERCILEX/x86_64-unknown-linux-gnu-rmz/latest/linux-x64/rmz /usr/local/bin/rmz
53+
rmz -f /opt/hostedtoolcache/CodeQL &
54+
rmz -f /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk &
55+
rmz -f /opt/hostedtoolcache/PyPy &
56+
rmz -f /opt/hostedtoolcache/Ruby &
57+
rmz -f /opt/hostedtoolcache/go &
58+
59+
wait
60+
61+
AFTER=$(getAvailableSpace)
62+
SAVED=$((AFTER-BEFORE))
63+
echo "=> Saved $(formatByteCount $SAVED)"
64+
65+
- name: Checkout
66+
uses: actions/checkout@v5
67+
68+
- name: Terraform min/max versions
69+
id: minMax
70+
uses: clowdhaus/terraform-min-max@v2.1.0
71+
with:
72+
directory: ${{ matrix.directory }}
73+
74+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
75+
# Run only validate pre-commit check on min version supported
76+
if: ${{ matrix.directory != '.' }}
77+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.14.0
78+
with:
79+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
80+
tflint-version: ${{ env.TFLINT_VERSION }}
81+
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
82+
83+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
84+
# Run only validate pre-commit check on min version supported
85+
if: ${{ matrix.directory == '.' }}
86+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.14.0
87+
with:
88+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
89+
tflint-version: ${{ env.TFLINT_VERSION }}
90+
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
91+
92+
preCommitMaxVersion:
93+
name: Max TF pre-commit
94+
runs-on: ubuntu-latest
95+
needs: collectInputs
96+
steps:
97+
- name: Install rmz
98+
uses: jaxxstorm/action-install-gh-release@v2.1.0
99+
with:
100+
repo: SUPERCILEX/fuc
101+
asset-name: x86_64-unknown-linux-gnu-rmz
102+
rename-to: rmz
103+
chmod: 0755
104+
extension-matching: disable
105+
106+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
107+
- name: Delete unnecessary files
108+
run: |
109+
formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); }
110+
getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); }
111+
112+
BEFORE=$(getAvailableSpace)
113+
114+
ln -s /opt/hostedtoolcache/SUPERCILEX/x86_64-unknown-linux-gnu-rmz/latest/linux-x64/rmz /usr/local/bin/rmz
115+
rmz -f /opt/hostedtoolcache/CodeQL &
116+
rmz -f /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk &
117+
rmz -f /opt/hostedtoolcache/PyPy &
118+
rmz -f /opt/hostedtoolcache/Ruby &
119+
rmz -f /opt/hostedtoolcache/go &
120+
sudo rmz -f /usr/local/lib/android &
121+
122+
if [[ ${{ github.repository }} == terraform-aws-modules/terraform-aws-security-group ]]; then
123+
sudo rmz -f /usr/share/dotnet &
124+
sudo rmz -f /usr/local/.ghcup &
125+
sudo apt-get -qq remove -y 'azure-.*'
126+
sudo apt-get -qq remove -y 'cpp-.*'
127+
sudo apt-get -qq remove -y 'dotnet-runtime-.*'
128+
sudo apt-get -qq remove -y 'google-.*'
129+
sudo apt-get -qq remove -y 'libclang-.*'
130+
sudo apt-get -qq remove -y 'libllvm.*'
131+
sudo apt-get -qq remove -y 'llvm-.*'
132+
sudo apt-get -qq remove -y 'mysql-.*'
133+
sudo apt-get -qq remove -y 'postgresql-.*'
134+
sudo apt-get -qq remove -y 'php.*'
135+
sudo apt-get -qq remove -y 'temurin-.*'
136+
sudo apt-get -qq remove -y kubectl firefox mono-devel
137+
sudo apt-get -qq autoremove -y
138+
sudo apt-get -qq clean
139+
fi
140+
141+
wait
142+
143+
AFTER=$(getAvailableSpace)
144+
SAVED=$((AFTER-BEFORE))
145+
echo "=> Saved $(formatByteCount $SAVED)"
146+
147+
- name: Checkout
148+
uses: actions/checkout@v5
149+
with:
150+
ref: ${{ github.event.pull_request.head.ref }}
151+
repository: ${{github.event.pull_request.head.repo.full_name}}
152+
153+
- name: Terraform min/max versions
154+
id: minMax
155+
uses: clowdhaus/terraform-min-max@v2.1.0
156+
157+
- name: Hide template dir
158+
# Special to this repo, we don't want to check this dir
159+
if: ${{ github.repository == 'terraform-aws-modules/terraform-aws-security-group' }}
160+
run: rm -rf modules/_templates
161+
162+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
163+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.14.0
164+
with:
165+
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
166+
tflint-version: ${{ env.TFLINT_VERSION }}
167+
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
168+
install-hcledit: true

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
paths:
10+
- '**/*.tpl'
11+
- '**/*.py'
12+
- '**/*.tf'
13+
- '.github/workflows/release.yml'
14+
15+
jobs:
16+
release:
17+
name: Release
18+
runs-on: ubuntu-latest
19+
# Skip running release workflow on forks
20+
if: github.repository_owner == 'terraform-aws-modules'
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v5
24+
with:
25+
persist-credentials: false
26+
fetch-depth: 0
27+
28+
- name: Set correct Node.js version
29+
uses: actions/setup-node@v6
30+
with:
31+
node-version: 24
32+
33+
- name: Install dependencies
34+
run: |
35+
npm install \
36+
@semantic-release/changelog@6.0.3 \
37+
@semantic-release/git@10.0.1 \
38+
conventional-changelog-conventionalcommits@9.1.0
39+
40+
- name: Release
41+
uses: cycjimmy/semantic-release-action@v5
42+
with:
43+
semantic_version: 25.0.0
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Mark or close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v10
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
# Staling issues and PR's
14+
days-before-stale: 30
15+
stale-issue-label: stale
16+
stale-pr-label: stale
17+
stale-issue-message: |
18+
This issue has been automatically marked as stale because it has been open 30 days
19+
with no activity. Remove stale label or comment or this issue will be closed in 10 days
20+
stale-pr-message: |
21+
This PR has been automatically marked as stale because it has been open 30 days
22+
with no activity. Remove stale label or comment or this PR will be closed in 10 days
23+
# Not stale if have this labels or part of milestone
24+
exempt-issue-labels: bug,wip,on-hold
25+
exempt-pr-labels: bug,wip,on-hold
26+
exempt-all-milestones: true
27+
# Close issue operations
28+
# Label will be automatically removed if the issues are no longer closed nor locked.
29+
days-before-close: 10
30+
delete-branch: true
31+
close-issue-message: This issue was automatically closed because of stale in 10 days
32+
close-pr-message: This PR was automatically closed because of stale in 10 days

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# Crash log files
9+
crash.log
10+
crash.*.log
11+
12+
# Exclude all .tfvars files
13+
*.tfvars
14+
*.tfvars.json
15+
16+
# Ignore override files
17+
override.tf
18+
override.tf.json
19+
*_override.tf
20+
*_override.tf.json
21+
22+
# Ignore CLI configuration files
23+
.terraformrc
24+
terraform.rc
25+
26+
# Ignore lock files (some prefer to commit)
27+
.terraform.lock.hcl

0 commit comments

Comments
 (0)