Skip to content

Commit 4410138

Browse files
authored
Merge pull request #317 from sassoftware/staging
7.0.0 - May 25, 2023
2 parents 35dd33e + 7e1444a commit 4410138

File tree

24 files changed

+183
-139
lines changed

24 files changed

+183
-139
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Linter Analysis
2+
on:
3+
push:
4+
branches: ['*'] # '*' will cause the workflow to run on all commits to all branches.
5+
6+
jobs:
7+
# Hadolint: Job-1
8+
Hadolint:
9+
name: Hadolint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repo
13+
uses: actions/checkout@v3
14+
15+
- name: Run Hadolint Action
16+
uses: jbergstroem/[email protected]
17+
with:
18+
dockerfile: ./Dockerfile
19+
config_file: linting-configs/.hadolint.yaml
20+
error_level: 1 # Fail CI based on hadolint output (-1: never, 0: error, 1: warning, 2: info)
21+
22+
# ShellCheck: Job-2
23+
ShellCheck:
24+
name: ShellCheck
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v3
29+
30+
- name: Run ShellCheck Action
31+
uses: ludeeus/action-shellcheck@master
32+
with:
33+
severity: error
34+
35+
# TFLint: Job-3
36+
TFLint:
37+
name: TFLint
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout Repo
41+
uses: actions/checkout@v3
42+
43+
- name: Cache Plugin Directory
44+
uses: actions/cache@v3
45+
with:
46+
path: ~/.tflint.d/plugins
47+
key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }}
48+
49+
- name: Setup TFLint
50+
uses: terraform-linters/[email protected]
51+
with:
52+
tflint_version: latest
53+
github_token: ${{ secrets.LINTER_TEST_TOKEN }}
54+
55+
- name: Initializing TFLint
56+
run: TFLINT_LOG=info tflint --init -c .tflint.hcl
57+
58+
- name: Run TFLint Action
59+
run: TFLINT_LOG=info tflint -c .tflint.hcl

.tflint.hcl

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

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG TERRAFORM_VERSION=1.0.0
2-
ARG AZURECLI_VERSION=2.45.0
1+
ARG TERRAFORM_VERSION=1.4.5
2+
ARG AZURECLI_VERSION=2.48.1
33

44
FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform
55
FROM mcr.microsoft.com/azure-cli:$AZURECLI_VERSION
@@ -10,7 +10,8 @@ WORKDIR /viya4-iac-azure
1010
COPY --from=terraform /bin/terraform /bin/terraform
1111
COPY . .
1212

13-
RUN apk --update --no-cache add git openssh \
13+
RUN apk update \
14+
&& apk --no-cache add git openssh \
1415
&& curl -sLO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
1516
&& chmod 755 ./kubectl /viya4-iac-azure/docker-entrypoint.sh \
1617
&& mv ./kubectl /usr/local/bin/kubectl \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ This project supports two options for running Terraform scripts:
5757
Access to an **Azure Subscription** and an [**Identity**](./docs/user/TerraformAzureAuthentication.md) with the *Contributor* role are required.
5858

5959
#### Terraform Requirements:
60-
- [Terraform](https://www.terraform.io/downloads.html) - v1.0.0
60+
- [Terraform](https://www.terraform.io/downloads.html) - v1.4.5
6161
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.25
6262
- [jq](https://stedolan.github.io/jq/) - v1.6
63-
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.45.0
63+
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.48.1
6464

6565
#### Docker Requirements:
6666
- [Docker](https://docs.docker.com/get-docker/)

container-structure-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ commandTests:
1717
- name: "terraform version"
1818
command: "terraform"
1919
args: ["--version"]
20-
expectedOutput: ["Terraform v1.0.0"]
20+
expectedOutput: ["Terraform v1.4.5"]
2121
- name: "python version"
2222
command: "python3"
2323
args: ["--version"]
@@ -29,7 +29,7 @@ commandTests:
2929
- -c
3030
- |
3131
az version -o tsv
32-
expectedOutput: ["2.45.0\t2.45.0\t1.0.8"]
32+
expectedOutput: ["2.48.1\t2.48.1\t1.0.8"]
3333

3434
metadataTest:
3535
workdir: "/viya4-iac-azure"

docs/CONFIG-VARS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Ubuntu 20.04 LTS is the operating system used on the Jump/NFS servers. Ubuntu cr
175175
| aks_identity | Use UserAssignedIdentity or Service Principal as [AKS identity](https://docs.microsoft.com/en-us/azure/aks/concepts-identity) | string | "uai" | A value of `uai` wil create a Managed Identity based on the permissions of the authenticated user or use [`AKS_UAI_NAME`](#use-existing), if set. A value of `sp` will use values from [`CLIENT_ID`/`CLIENT_SECRET`](#azure-authentication), if set. |
176176
| ssh_public_key | File name of public ssh key for jump and nfs VM | string | "~/.ssh/id_rsa.pub" | Required with `create_jump_vm=true` or `storage_type=standard` |
177177
| cluster_api_mode | Public or private IP for the cluster api | string | "public" | Valid Values: "public", "private" |
178-
| aks_cluster_sku_tier | Optimizes api server for cost vs availability | string | "Free" | Valid Values: "Free", "Paid" |
178+
| aks_cluster_sku_tier | Optimizes api server for cost vs availability | string | "Free" | Valid Values: "Free", "Standard" |
179179

180180
## Node Pools
181181

File renamed without changes.
File renamed without changes.

linting-configs/.tflint.hcl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
# For more information on configuring TFlint; see https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/config.md
3+
4+
# For more information on plugins see https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md
5+
6+
# For more information on TFlint Ruleset for Terraform; see https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.3.0/docs/rules/README.md
7+
8+
# For more information on TFlint Ruleset for Azure, see https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/master/docs/README.md
9+
10+
config {
11+
# Enables module inspection.
12+
module = true
13+
}
14+
15+
plugin "azurerm" {
16+
enabled = true
17+
version = "0.23.0"
18+
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
19+
}
20+
21+
plugin "terraform" {
22+
enabled = true
23+
preset = "recommended"
24+
}
25+
26+
rule "azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size" {
27+
enabled = false
28+
}

locals.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ locals {
4343
container_registry_sku = title(var.container_registry_sku)
4444

4545
aks_rg = (var.resource_group_name == null
46-
? azurerm_resource_group.aks_rg.0
47-
: data.azurerm_resource_group.aks_rg.0
46+
? azurerm_resource_group.aks_rg[0]
47+
: data.azurerm_resource_group.aks_rg[0]
4848
)
4949

5050
network_rg = (var.vnet_resource_group_name == null
5151
? local.aks_rg
52-
: data.azurerm_resource_group.network_rg.0
52+
: data.azurerm_resource_group.network_rg[0]
5353
)
5454

55-
nsg = var.nsg_name == null ? azurerm_network_security_group.nsg.0 : data.azurerm_network_security_group.nsg.0
55+
nsg = var.nsg_name == null ? azurerm_network_security_group.nsg[0] : data.azurerm_network_security_group.nsg[0]
5656
nsg_rg_name = var.nsg_name == null ? local.aks_rg.name : local.network_rg.name
5757

5858
# Use BYO UAI if given, else create a UAI
5959
aks_uai_id = (var.aks_identity == "uai"
6060
? (var.aks_uai_name == null
61-
? azurerm_user_assigned_identity.uai.0.id
62-
: data.azurerm_user_assigned_identity.uai.0.id
61+
? azurerm_user_assigned_identity.uai[0].id
62+
: data.azurerm_user_assigned_identity.uai[0].id
6363
)
6464
: null
6565
)

0 commit comments

Comments
 (0)