Skip to content

Commit 8498301

Browse files
authored
fix: Correct cluster autoscaler version typo, use (correct) static service principal DNS suffix (#372)
1 parent f28ce28 commit 8498301

File tree

5 files changed

+21
-48
lines changed

5 files changed

+21
-48
lines changed

.github/workflows/pr-title.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Validate PR title
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: amannn/action-semantic-pull-request@v5.3.0
15+
- uses: amannn/action-semantic-pull-request@v5.4.0
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
with:

.github/workflows/pre-commit.yaml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ permissions: read-all
1313

1414
env:
1515
TERRAFORM_DOCS_VERSION: v0.16.0
16-
TFSEC_VERSION: v1.28.1
17-
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
18-
TFLINT_VERSION: v0.45.0
16+
TFLINT_VERSION: v0.50.3
1917

2018
concurrency:
2119
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
@@ -33,7 +31,7 @@ jobs:
3331

3432
- name: Get root directories
3533
id: dirs
36-
uses: clowdhaus/terraform-composite-actions/directories@v1.8.3
34+
uses: clowdhaus/terraform-composite-actions/directories@v1.9.0
3735

3836
preCommitMinVersions:
3937
name: Min TF pre-commit
@@ -49,7 +47,7 @@ jobs:
4947
- name: Checkout
5048
uses: actions/checkout@v4
5149

52-
- uses: dorny/paths-filter@v2
50+
- uses: dorny/paths-filter@v3
5351
id: changes
5452
with:
5553
# We only need to check Terraform files for the current directory
@@ -59,35 +57,23 @@ jobs:
5957
src:
6058
- '${{ matrix.directory }}/*.tf'
6159
62-
- name: Config Terraform plugin cache
63-
if: steps.changes.outputs.src== 'true'
64-
run: mkdir --parents ${{ env.TERRAFORM_DOCS_VERSION }}
65-
66-
- name: Cache Terraform
67-
uses: actions/cache@v3
68-
if: steps.changes.outputs.src== 'true'
69-
with:
70-
path: ${{ env.TERRAFORM_DOCS_VERSION }}
71-
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
72-
restore-keys: ${{ runner.os }}-terraform-
73-
7460
- name: Terraform min/max versions
75-
uses: clowdhaus/terraform-min-max@v1.2.7
61+
uses: clowdhaus/terraform-min-max@v1.3.0
7662
if: steps.changes.outputs.src== 'true'
7763
id: minMax
7864
with:
7965
directory: ${{ matrix.directory }}
8066

8167
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
82-
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3
68+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
8369
# Run only validate pre-commit check on min version supported
8470
if: ${{ matrix.directory != '.' && steps.changes.outputs.src== 'true' }}
8571
with:
8672
terraform-version: ${{ steps.minMax.outputs.minVersion }}
8773
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
8874

8975
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
90-
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3
76+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
9177
# Run only validate pre-commit check on min version supported
9278
if: ${{ matrix.directory == '.' && steps.changes.outputs.src== 'true' }}
9379
with:
@@ -105,32 +91,20 @@ jobs:
10591
- name: Checkout
10692
uses: actions/checkout@v4
10793

108-
- uses: dorny/paths-filter@v2
94+
- uses: dorny/paths-filter@v3
10995
id: changes
11096
with:
11197
filters: |
11298
src:
11399
- '**/*.tf'
114100
115-
- name: Config Terraform plugin cache
116-
if: steps.changes.outputs.src== 'true'
117-
run: mkdir --parents ${{ env.TERRAFORM_DOCS_VERSION }}
118-
119-
- name: Cache Terraform
120-
uses: actions/cache@v3
121-
if: steps.changes.outputs.src== 'true'
122-
with:
123-
path: ${{ env.TF_PLUGIN_CACHE_DIR }}
124-
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
125-
restore-keys: ${{ runner.os }}-terraform-
126-
127101
- name: Terraform min/max versions
128102
id: minMax
129-
uses: clowdhaus/terraform-min-max@v1.2.7
103+
uses: clowdhaus/terraform-min-max@v1.3.0
130104
if: steps.changes.outputs.src== 'true'
131105

132106
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
133-
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3
107+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
134108
if: steps.changes.outputs.src== 'true'
135109
with:
136110
terraform-version: ${{ steps.minMax.outputs.maxVersion }}

.github/workflows/stale-issue-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
issues: write
1515
pull-requests: write
1616
steps:
17-
- uses: actions/stale@v8
17+
- uses: actions/stale@v9
1818
id: stale
1919
with:
2020
ascending: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: detect-aws-credentials
1212
args: ['--allow-missing-credentials']
1313
- repo: https://github.com/antonbabenko/pre-commit-terraform
14-
rev: v1.88.0
14+
rev: v1.88.2
1515
hooks:
1616
- id: terraform_fmt
1717
- id: terraform_docs

main.tf

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ resource "time_sleep" "this" {
1717

1818
locals {
1919
account_id = data.aws_caller_identity.current.account_id
20-
dns_suffix = data.aws_partition.current.dns_suffix
2120
partition = data.aws_partition.current.partition
2221
region = data.aws_region.current.name
2322

@@ -990,7 +989,7 @@ data "aws_iam_policy_document" "aws_fsx_csi_driver" {
990989

991990
statement {
992991
sid = "AllowCreateServiceLinkedRoles"
993-
resources = ["arn:${local.partition}:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.${local.dns_suffix}/*"]
992+
resources = ["arn:${local.partition}:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.${data.aws_partition.current.dns_suffix}/*"]
994993

995994
actions = [
996995
"iam:CreateServiceLinkedRole",
@@ -1007,7 +1006,7 @@ data "aws_iam_policy_document" "aws_fsx_csi_driver" {
10071006
condition {
10081007
test = "StringLike"
10091008
variable = "iam:AWSServiceName"
1010-
values = ["fsx.${local.dns_suffix}"]
1009+
values = ["fsx.amazonaws.com"]
10111010
}
10121011
}
10131012

@@ -1153,7 +1152,7 @@ data "aws_iam_policy_document" "aws_load_balancer_controller" {
11531152
condition {
11541153
test = "StringEquals"
11551154
variable = "iam:AWSServiceName"
1156-
values = ["elasticloadbalancing.${local.dns_suffix}"]
1155+
values = ["elasticloadbalancing.amazonaws.com"]
11571156
}
11581157
}
11591158

@@ -1531,8 +1530,8 @@ module "aws_node_termination_handler_sqs" {
15311530
{
15321531
type = "Service"
15331532
identifiers = [
1534-
"events.${local.dns_suffix}",
1535-
"sqs.${local.dns_suffix}",
1533+
"events.amazonaws.com",
1534+
"sqs.amazonaws.com",
15361535
]
15371536
}
15381537
]
@@ -1965,7 +1964,7 @@ locals {
19651964
"1.26" = "v1.26.6"
19661965
"1.27" = "v1.27.5"
19671966
"1.28" = "v1.28.2"
1968-
"1.29" = "v1.20.0"
1967+
"1.29" = "v1.29.0"
19691968
}
19701969
}
19711970

@@ -2909,8 +2908,8 @@ module "karpenter_sqs" {
29092908
{
29102909
type = "Service"
29112910
identifiers = [
2912-
"events.${local.dns_suffix}",
2913-
"sqs.${local.dns_suffix}",
2911+
"events.amazonaws.com",
2912+
"sqs.amazonaws.com",
29142913
]
29152914
}
29162915
]
@@ -2950,7 +2949,7 @@ data "aws_iam_policy_document" "karpenter_assume_role" {
29502949

29512950
principals {
29522951
type = "Service"
2953-
identifiers = ["ec2.${local.dns_suffix}"]
2952+
identifiers = ["ec2.amazonaws.com"]
29542953
}
29552954
}
29562955
}

0 commit comments

Comments
 (0)