Skip to content

Commit 8b3f567

Browse files
authored
Merge pull request #241 from lonegunmanb/ci
Prepare v6.0 and new CI pipeline.
2 parents 7524a51 + ed8d1a6 commit 8b3f567

42 files changed

Lines changed: 2037 additions & 553 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Bug Report
2+
description: If something isn't working as expected.
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out a bug report.
9+
10+
If you are not running the latest version of this module, please try to reproduce your bug with the latest version before opening an issue.
11+
- type: checkboxes
12+
attributes:
13+
label: Is there an existing issue for this?
14+
description: Please search to see if an issue already exists for the bug you encountered.
15+
options:
16+
- label: I have searched the existing issues
17+
required: true
18+
- type: dropdown
19+
attributes:
20+
label: Greenfield/Brownfield provisioning
21+
description: Do you reproduce the bug with a new infrastructure provisioning (greenfield) or you need an existing infrastructure with an existing terraform state (brownfield) to reproduce the bug ?
22+
multiple: false
23+
options:
24+
- greenfield
25+
- brownfield
26+
validations:
27+
required: true
28+
- type: input
29+
id: terraform
30+
attributes:
31+
label: Terraform Version
32+
description: Which Terraform version are you using?
33+
placeholder: 1.2.8
34+
validations:
35+
required: true
36+
- type: input
37+
id: module
38+
attributes:
39+
label: Module Version
40+
description: Which module version are you using?
41+
placeholder: 5.0.0
42+
validations:
43+
required: true
44+
- type: input
45+
id: azurerm
46+
attributes:
47+
label: AzureRM Provider Version
48+
description: Which AzureRM Provider version are you using?
49+
placeholder: 3.0.0
50+
validations:
51+
required: true
52+
- type: input
53+
id: resource
54+
attributes:
55+
label: Affected Resource(s)/Data Source(s)
56+
description: Please list the affected resources and/or data sources.
57+
placeholder: azurerm_XXXXX
58+
validations:
59+
required: true
60+
- type: textarea
61+
id: config
62+
attributes:
63+
label: Terraform Configuration Files
64+
description: |
65+
Please provide a minimal Terraform configuration that can reproduce the issue.
66+
render: hcl
67+
validations:
68+
required: true
69+
- type: textarea
70+
id: tfvars
71+
attributes:
72+
label: tfvars variables values
73+
description: |
74+
Please provide the necessary tfvars variables values to reproduce the issue. Do not share secrets or sensitive information.
75+
render: hcl
76+
validations:
77+
required: true
78+
- type: textarea
79+
id: debug
80+
attributes:
81+
label: Debug Output/Panic Output
82+
description: |
83+
For long debug logs please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
84+
85+
To obtain the debug output, see the [Terraform documentation on debugging](https://www.terraform.io/docs/internals/debugging.html).
86+
render: shell
87+
validations:
88+
required: true
89+
- type: textarea
90+
id: expected
91+
attributes:
92+
label: Expected Behaviour
93+
description: What should have happened?
94+
- type: textarea
95+
id: actual
96+
attributes:
97+
label: Actual Behaviour
98+
description: What actually happened?
99+
- type: textarea
100+
id: reproduce
101+
attributes:
102+
label: Steps to Reproduce
103+
description: |
104+
Please list the steps required to reproduce the issue, e.g.
105+
106+
1. `terraform apply`
107+
- type: input
108+
id: facts
109+
attributes:
110+
label: Important Factoids
111+
description: |
112+
Are there anything atypical about your accounts that we should know? For example: Running in a Azure China/Germany/Government?
113+
- type: textarea
114+
id: references
115+
attributes:
116+
label: References
117+
description: |
118+
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
119+
120+
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Such as vendor documentation?
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Feature Request
2+
description: I have a suggestion (and might want to implement myself)!
3+
title: "Support for [thing]"
4+
body:
5+
- type: checkboxes
6+
attributes:
7+
label: Is there an existing issue for this?
8+
description: Please search to see if an issue already exists for the feature you are requesting.
9+
options:
10+
- label: I have searched the existing issues
11+
required: true
12+
- type: textarea
13+
id: description
14+
attributes:
15+
label: Description
16+
description: Please leave a helpful description of the feature request here.
17+
validations:
18+
required: true
19+
- type: input
20+
id: resource
21+
attributes:
22+
label: New or Affected Resource(s)/Data Source(s)
23+
description: Please list the new or affected resources and/or data sources.
24+
placeholder: azurerm_XXXXX
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: config
29+
attributes:
30+
label: Potential Terraform Configuration
31+
description: Please provide an example of what the enhancement could look like on this Terraform module.
32+
render: hcl
33+
- type: textarea
34+
id: references
35+
attributes:
36+
label: References
37+
description: |
38+
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
39+
40+
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation? For example:
41+
42+
* https://azure.microsoft.com/en-us/roadmap/virtual-network-service-endpoint-for-azure-cosmos-db/

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/workflows/acc-test.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: E2E Test
2+
on:
3+
pull_request:
4+
types: [ 'opened', 'synchronize' ]
5+
paths:
6+
- '.github/**'
7+
- '**.go'
8+
- '**.tf'
9+
- '.github/workflows/**'
10+
- '**.md'
11+
12+
env:
13+
MSI_ID: 'fe405819-42c4-4877-a28d-f96b88d7994b'
14+
15+
jobs:
16+
acc-tests:
17+
runs-on: [self-hosted, 1ES.Pool=AzureVerifiedTerraformModule]
18+
environment:
19+
name: acctests
20+
steps:
21+
- uses: actions/setup-go@v3
22+
with:
23+
go-version: '>=1.19.0'
24+
- uses: actions/checkout@v3
25+
- name: e2e test
26+
run: |
27+
az login --identity --username $MSI_ID
28+
export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id')
29+
export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId')
30+
ARM_USE_MSI=true make e2e-test
31+
- name: version-upgrade test
32+
run: |
33+
az login --identity --username $MSI_ID
34+
export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id')
35+
export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId')
36+
ARM_USE_MSI=true make version-upgrade-test
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Main Branch Push
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
jobs:
8+
main-branch-push:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
steps:
15+
- uses: 8BitJonny/gh-get-current-pr@2.1.0
16+
id: PR
17+
# checkov:skip=CKV_GHA_3 bypass check for CKV_GHA_3 since the GITHUB_TOKEN will be a one-time token https://docs.bridgecrew.io/docs/suspicious-use-of-curl-with-secrets
18+
- name: Warn remaining PR branch
19+
run: |
20+
echo "=====> Query remaining pull requests"
21+
response=$(curl \
22+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
23+
-H "Accept: application/vnd.github.v3+json" \
24+
https://api.github.com/repos/${{ github.repository }}/pulls?per_page=100)
25+
export pr_number=$(echo "$response" | jq '.[].number')
26+
27+
echo "=====> Warn pull requests branch"
28+
29+
for p in $pr_number; do
30+
curl -s -X PUT -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.lydian-preview+json" https://api.github.com/repos/${{ github.repository }}/pulls/$p/update-branch
31+
curl -s -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/$p/comments -d "{\"body\":\"MAIN BRANCH PUSH DETECTED DUE TO #${{steps.PR.outputs.number}}, THIS PR WILL BE UPDATED.\"}"
32+
done

.github/workflows/pr-check.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Pre Pull Request Check
2+
on:
3+
pull_request:
4+
types: ['opened', 'synchronize']
5+
paths:
6+
- '.github/**'
7+
- '**.go'
8+
- '**.tf'
9+
- '.github/workflows/**'
10+
- '**.md'
11+
12+
jobs:
13+
prepr-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v3
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: '>=1.17.0'
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: 14
24+
- name: make tools
25+
run: |
26+
make tools
27+
- name: gofmtcheck
28+
run: |
29+
make gofmtcheck
30+
- name: gencheck
31+
run: |
32+
make gencheck
33+
- name: tfvalidatecheck
34+
run: |
35+
make tfvalidatecheck
36+
- name: tffmtcheck
37+
run: |
38+
make tffmtcheck
39+
- name: terrafmtcheck
40+
run: |
41+
make terrafmtcheck
42+
- name: golint
43+
run: |
44+
make golint
45+
- name: tflint
46+
run: |
47+
make tflint
48+
- name: Run Checkov action
49+
id: checkov
50+
if: ${{env.SKIP_CHECKOV == ''}}
51+
uses: bridgecrewio/checkov-action@master
52+
with:
53+
directory: ./
54+
framework: terraform
55+
quiet: true
56+
output_format: sarif
57+
download_external_modules: true

.gitignore

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ terraform.tfvars
88
*.tfstate.backup
99
*.tfvars
1010

11+
**/.terraform.lock.hcl
12+
1113
# Terraform directory
1214
.terraform/
1315
terraform.tfstate.d/
14-
logs/
16+
logs/
1517

1618
# Go vendor directory
1719
vendor/
@@ -47,4 +49,14 @@ Gemfile.lock
4749
.terraform.tfstate.lock.info
4850

4951
# SSH Key
50-
private_ssh_key
52+
private_ssh_key
53+
54+
# generated readme by the pr-check job
55+
56+
README-generated.md
57+
58+
**/override.tf
59+
60+
.tflint.hcl
61+
62+
tfmod-scaffold/
File renamed without changes.

CHANGLOG.md renamed to CHANGELOG-v5.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,3 @@ ENHANCEMENTS:
2929
BUG FIXES:
3030

3131
* Change the incorrect description of variable `tags`. ([#175](https://github.com/Azure/terraform-azurerm-aks/pull/175))
32-
33-
# 5.1.0 (August 31, 2022)
34-
35-
* Loose the restriction on `tls` provider's version to include major version greater than 3.0. [#228](https://github.com/Azure/terraform-azurerm-aks/issues/228)
36-
* Mark some outputs as sensitive. [#231](https://github.com/Azure/terraform-azurerm-aks/pull/231)
37-
* Output Kubernetes Cluster Name. [#234](https://github.com/Azure/terraform-azurerm-aks/pull/234)
38-
* Require minimum `hashicorp/azurerm` provider version to 3.21.0 (fixes for AKS 1.24) [#238](https://github.com/Azure/terraform-azurerm-aks/pull/238)

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## 6.0.0 (August 10, 2022)
2+
3+
The goal of v6.0.0 is to add a GitHub Action-based CI pipeline and introduce modern acceptance tests to ensure that future pull requests to this module meet our new standard for AzureRM modules.
4+
5+
ENHANCEMENTS:
6+
7+
* Loose the restriction on `tls` provider's version to include major version greater than 3.0. [#228](https://github.com/Azure/terraform-azurerm-aks/issues/228)
8+
* Mark some outputs as sensitive. [#231](https://github.com/Azure/terraform-azurerm-aks/pull/231)
9+
* Output Kubernetes Cluster Name. [#234](https://github.com/Azure/terraform-azurerm-aks/pull/234)
10+
* Add Microsoft Defender support. [#232](https://github.com/Azure/terraform-azurerm-aks/pull/232)
11+
* Add outputs for created Log Analytics workspace. [#243](https://github.com/Azure/terraform-azurerm-aks/pull/243)
12+
13+
# BUG FIXES:
14+
15+
* Update hashicorp/terraform-provider-azurerm to version 3.21.0. [#238](https://github.com/Azure/terraform-azurerm-aks/pull/238)

0 commit comments

Comments
 (0)