Skip to content

Commit 7b2143d

Browse files
authored
Merge branch 'terraform-linters:master' into Add-aws_iam_policy_attachment_has_alternatives-rule
2 parents a637712 + 9db6b98 commit 7b2143d

File tree

1,636 files changed

+11450
-12115
lines changed

Some content is hidden

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

1,636 files changed

+11450
-12115
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v3
2323
- name: Set up Go
24-
uses: actions/setup-go@v3
24+
uses: actions/setup-go@v4
2525
with:
2626
go-version-file: 'go.mod'
2727
cache: true

.github/workflows/e2e.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v3
2626
- name: Set up Go
27-
uses: actions/setup-go@v3
27+
uses: actions/setup-go@v4
2828
with:
2929
go-version-file: 'go.mod'
3030
- name: Install TFLint
3131
run: curl -sL https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3234
- name: Install plugin (Linux)
3335
if: runner.os == 'Linux'
3436
run: make install

.github/workflows/generated_code_checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
steps:
99
- name: Checkout
1010
uses: actions/checkout@v3
11-
with:
12-
submodules: true
11+
- name: Checkout submodules
12+
run: git submodule update --init --depth=0
1313
- name: Set up Go
14-
uses: actions/setup-go@v3
14+
uses: actions/setup-go@v4
1515
with:
1616
go-version-file: 'go.mod'
1717
cache: true

.github/workflows/goreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
- name: Set up Go
20-
uses: actions/setup-go@v3
20+
uses: actions/setup-go@v4
2121
with:
2222
go-version-file: 'go.mod'
2323
- name: goreleaser check
24-
uses: goreleaser/goreleaser-action@v3
24+
uses: goreleaser/goreleaser-action@v4
2525
with:
26-
version: v1.7.0
26+
version: v1.12.3
2727
args: check

.github/workflows/maintenance.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ on:
22
push:
33
branches: [ master ]
44
schedule:
5-
- cron: '*/5 * * * *'
5+
- cron: '0 0 * * 1'
66
workflow_dispatch: # Enables on-demand/manual triggering
77
jobs:
88
job:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
12-
with:
13-
submodules: true
14-
- uses: actions/setup-go@v3
12+
- run: git submodule update --init --depth=0
13+
- uses: actions/setup-go@v4
1514
with:
1615
go-version-file: 'go.mod'
1716
- run: |
@@ -23,12 +22,11 @@ jobs:
2322
cd ../..
2423
git submodule update --remote
2524
go generate ./...
26-
- uses: peter-evans/create-pull-request@v4
25+
- uses: peter-evans/create-pull-request@v5
2726
with:
2827
commit-message: |
29-
autogenerated maintenance
30-
title: autogenerated maintenance
28+
Update AWS provider/module and generated content
29+
title: Update AWS provider/module and generated content
3130
delete-branch: true
3231
body: |
33-
If tests are stuck on https://github.com/peter-evans/create-pull-request/issues/48:
34-
["Manually close pull requests and immediately reopen them. This will enable `on: pull_request` workflows to run and be added as checks."](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs)
32+
This is an automated pull request triggered by GitHub Actions. To trigger check runs, close and re-open it.

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
tags:
88
- v*.*.*
99

10+
permissions:
11+
contents: write
12+
id-token: write
13+
1014
jobs:
1115
goreleaser:
1216
runs-on: ubuntu-latest
@@ -16,14 +20,16 @@ jobs:
1620
with:
1721
fetch-depth: 0
1822
- name: Set up Go
19-
uses: actions/setup-go@v3
23+
uses: actions/setup-go@v4
2024
with:
2125
go-version-file: 'go.mod'
2226
cache: true
27+
- name: Install Cosign
28+
uses: sigstore/cosign-installer@v3
2329
- name: Run GoReleaser
24-
uses: goreleaser/goreleaser-action@v3
30+
uses: goreleaser/goreleaser-action@v4
2531
with:
26-
version: v1.7.0
32+
version: v1.12.3
2733
args: release --rm-dist
2834
env:
2935
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ changelog:
2222
skip: true
2323
checksum:
2424
name_template: 'checksums.txt'
25+
signs:
26+
- cmd: cosign
27+
signature: '${artifact}.keyless.sig'
28+
certificate: '${artifact}.pem'
29+
output: true
30+
artifacts: checksum
31+
args:
32+
- sign-blob
33+
- '--output-certificate=${certificate}'
34+
- '--output-signature=${signature}'
35+
- '${artifact}'
36+
- --yes
2537
release:
2638
github:
2739
owner: terraform-linters

CHANGELOG.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,130 @@
1+
## 0.23.1 (2023-05-22)
2+
3+
### Enhancements
4+
5+
- [#484](https://github.com/terraform-linters/tflint-ruleset-aws/pull/484): `aws_route_not_specified_target`: Add core_network_arn as target ([@ttretau](https://github.com/ttretau))
6+
- [#485](https://github.com/terraform-linters/tflint-ruleset-aws/pull/485) [#487](https://github.com/terraform-linters/tflint-ruleset-aws/pull/487) [#490](https://github.com/terraform-linters/tflint-ruleset-aws/pull/490) [#495](https://github.com/terraform-linters/tflint-ruleset-aws/pull/495): Update AWS provider/module and generated content
7+
8+
### Chores
9+
10+
- [#493](https://github.com/terraform-linters/tflint-ruleset-aws/pull/493): Bump golang.org/x/net from 0.9.0 to 0.10.0
11+
12+
## 0.23.0 (2023-04-22)
13+
14+
### Enhancements
15+
16+
- [#471](https://github.com/terraform-linters/tflint-ruleset-aws/pull/471) [#480](https://github.com/terraform-linters/tflint-ruleset-aws/pull/480): Update AWS provider/module and generated content
17+
18+
### Chores
19+
20+
- [#436](https://github.com/terraform-linters/tflint-ruleset-aws/pull/436): Use NewRunner hook ([@wata727](https://github.com/wata727))
21+
- [#468](https://github.com/terraform-linters/tflint-ruleset-aws/pull/468): Bump actions/setup-go from 3 to 4
22+
- [#469](https://github.com/terraform-linters/tflint-ruleset-aws/pull/469): Bump github.com/zclconf/go-cty from 1.13.0 to 1.13.1
23+
- [#473](https://github.com/terraform-linters/tflint-ruleset-aws/pull/473): Bump peter-evans/create-pull-request from 4 to 5
24+
- [#475](https://github.com/terraform-linters/tflint-ruleset-aws/pull/475): Bump github.com/terraform-linters/tflint-plugin-sdk from 0.15.0 to 0.16.1
25+
- [#477](https://github.com/terraform-linters/tflint-ruleset-aws/pull/477): docs: copy edits for deep check ([@bendrucker](https://github.com/bendrucker))
26+
- [#481](https://github.com/terraform-linters/tflint-ruleset-aws/pull/481): Follow up of the EnsureNoError deprecation ([@wata727](https://github.com/wata727))
27+
28+
## 0.22.1 (2023-03-18)
29+
30+
- [#465](https://github.com/terraform-linters/tflint-ruleset-aws/pull/465): Fix Cosign v2 signing ([@wata727](https://github.com/wata727))
31+
32+
## 0.22.0 (2023-03-18)
33+
34+
### Breaking Changes
35+
36+
- [#462](https://github.com/terraform-linters/tflint-ruleset-aws/pull/462): appsync: Remove invalid regexp rules ([@wata727](https://github.com/wata727))
37+
38+
### Enhancements
39+
40+
- [#444](https://github.com/terraform-linters/tflint-ruleset-aws/pull/444) [#451](https://github.com/terraform-linters/tflint-ruleset-aws/pull/451) [#454](https://github.com/terraform-linters/tflint-ruleset-aws/pull/454): Update AWS provider/module and generated content
41+
42+
### BugFixes
43+
44+
- [#455](https://github.com/terraform-linters/tflint-ruleset-aws/pull/455): aws_acm_certificate: fix false positive for private CA ([@bendrucker](https://github.com/bendrucker) [@wata727](https://github.com/wata727))
45+
46+
### Chores
47+
48+
- [#445](https://github.com/terraform-linters/tflint-ruleset-aws/pull/445) [#452](https://github.com/terraform-linters/tflint-ruleset-aws/pull/452) [#460](https://github.com/terraform-linters/tflint-ruleset-aws/pull/460): Bump github.com/hashicorp/hcl/v2 from 2.15.0 to 2.16.2
49+
- [#447](https://github.com/terraform-linters/tflint-ruleset-aws/pull/447) [#449](https://github.com/terraform-linters/tflint-ruleset-aws/pull/449) [#459](https://github.com/terraform-linters/tflint-ruleset-aws/pull/459): Bump golang.org/x/net from 0.5.0 to 0.8.0
50+
- [#450](https://github.com/terraform-linters/tflint-ruleset-aws/pull/450): Fix submodule checkout issue ([@wata727](https://github.com/wata727))
51+
- [#457](https://github.com/terraform-linters/tflint-ruleset-aws/pull/457): Bump github.com/zclconf/go-cty from 1.12.1 to 1.13.0
52+
- [#458](https://github.com/terraform-linters/tflint-ruleset-aws/pull/458): Bump sigstore/cosign-installer from 2 to 3
53+
- [#463](https://github.com/terraform-linters/tflint-ruleset-aws/pull/463): Fix generated_code_checks workflow step ([@wata727](https://github.com/wata727))
54+
- [#464](https://github.com/terraform-linters/tflint-ruleset-aws/pull/464): go 1.20 ([@wata727](https://github.com/wata727))
55+
56+
## 0.21.2 (2023-02-03)
57+
58+
### Enhancements
59+
60+
- [#431](https://github.com/terraform-linters/tflint-ruleset-aws/pull/431) [#442](https://github.com/terraform-linters/tflint-ruleset-aws/pull/442): Update AWS provider/module and generated content
61+
62+
### Chores
63+
64+
- [#433](https://github.com/terraform-linters/tflint-ruleset-aws/pull/433) [#441](https://github.com/terraform-linters/tflint-ruleset-aws/pull/441): Bump golang.org/x/net from 0.2.0 to 0.5.0
65+
- [#434](https://github.com/terraform-linters/tflint-ruleset-aws/pull/434): Bump goreleaser/goreleaser-action from 3 to 4
66+
- [#435](https://github.com/terraform-linters/tflint-ruleset-aws/pull/435): Pass `GITHUB_TOKEN` to e2e test workflow ([@wata727](https://github.com/wata727))
67+
- [#437](https://github.com/terraform-linters/tflint-ruleset-aws/pull/437): Bump github.com/terraform-linters/tflint-plugin-sdk from 0.14.0 to 0.15.0
68+
69+
## 0.21.1 (2022-12-12)
70+
71+
### BugFixes
72+
73+
- [#430](https://github.com/terraform-linters/tflint-ruleset-aws/pull/430): `elasticache_cluster_previous_type`: fix panic on empty string ([@bendrucker](https://github.com/bendrucker))
74+
75+
### Chores
76+
77+
- [#407](https://github.com/terraform-linters/tflint-ruleset-aws/pull/407): autogenerated maintenance
78+
79+
## 0.21.0 (2022-12-05)
80+
81+
### Enhancements
82+
83+
- [#403](https://github.com/terraform-linters/tflint-ruleset-aws/pull/403): autogenerated maintenance
84+
- [#405](https://github.com/terraform-linters/tflint-ruleset-aws/pull/405) [#406](https://github.com/terraform-linters/tflint-ruleset-aws/pull/406): Add assume role configuration to plugin config ([@kaito3desuyo](https://github.com/kaito3desuyo))
85+
86+
## 0.20.0 (2022-11-27)
87+
88+
### Enhancements
89+
90+
- [#400](https://github.com/terraform-linters/tflint-ruleset-aws/pull/400): autogenerated maintenance
91+
92+
### Chores
93+
94+
- [#399](https://github.com/terraform-linters/tflint-ruleset-aws/pull/399): Bump up GoReleaser version in release.yml ([@wata727](https://github.com/wata727))
95+
- [#401](https://github.com/terraform-linters/tflint-ruleset-aws/pull/401): Bump golang.org/x/net from 0.1.0 to 0.2.0
96+
97+
## 0.19.0 (2022-11-14)
98+
99+
### Enhancements
100+
101+
- [#390](https://github.com/terraform-linters/tflint-ruleset-aws/pull/390): autogenerated maintenance
102+
103+
### BugFixes
104+
105+
- [#397](https://github.com/terraform-linters/tflint-ruleset-aws/pull/397): Prefer credentials in "plugin" blocks over "provider" blocks ([@wata727](https://github.com/wata727))
106+
107+
### Chores
108+
109+
- [#394](https://github.com/terraform-linters/tflint-ruleset-aws/pull/394): Add signatures for keyless signing ([@wata727](https://github.com/wata727))
110+
- [#395](https://github.com/terraform-linters/tflint-ruleset-aws/pull/395): Bump github.com/hashicorp/hcl/v2 from 2.14.1 to 2.15.0
111+
- [#398](https://github.com/terraform-linters/tflint-ruleset-aws/pull/398): Bump up GoReleaser version ([@wata727](https://github.com/wata727))
112+
113+
## 0.18.0 (2022-10-24)
114+
115+
### Breaking Changes
116+
117+
- [#367](https://github.com/terraform-linters/tflint-ruleset-aws/pull/367): remove hardcoded S3 region rule ([@PatMyron](https://github.com/PatMyron))
118+
119+
### Enhancements
120+
121+
- [#382](https://github.com/terraform-linters/tflint-ruleset-aws/pull/382): autogenerated maintenance
122+
- [#388](https://github.com/terraform-linters/tflint-ruleset-aws/pull/388): Bump tflint-plugin-sdk to v0.14.0 ([@wata727](https://github.com/wata727))
123+
124+
### Chores
125+
126+
- [#387](https://github.com/terraform-linters/tflint-ruleset-aws/pull/387): Bump github.com/dave/dst from 0.27.0 to 0.27.2
127+
1128
## 0.17.1 (2022-09-29)
2129

3130
### Enhancements

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This ruleset focus on possible errors and best practices about AWS resources. Ma
1010
## Requirements
1111

1212
- TFLint v0.40+
13-
- Go v1.19
13+
- Go v1.20
1414

1515
## Installation
1616

@@ -19,7 +19,7 @@ You can install the plugin by adding a config to `.tflint.hcl` and running `tfli
1919
```hcl
2020
plugin "aws" {
2121
enabled = true
22-
version = "0.17.1"
22+
version = "0.23.1"
2323
source = "github.com/terraform-linters/tflint-ruleset-aws"
2424
}
2525
```

aws/config.go

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
package aws
22

3+
type AssumeRole struct {
4+
RoleARN string `hclext:"role_arn,optional"`
5+
ExternalID string `hclext:"external_id,optional"`
6+
Policy string `hclext:"policy,optional"`
7+
SessionName string `hclext:"session_name,optional"`
8+
}
9+
310
// Config is the configuration for the ruleset.
411
type Config struct {
5-
DeepCheck bool `hclext:"deep_check,optional"`
6-
AccessKey string `hclext:"access_key,optional"`
7-
SecretKey string `hclext:"secret_key,optional"`
8-
Region string `hclext:"region,optional"`
9-
Profile string `hclext:"profile,optional"`
10-
SharedCredentialsFile string `hclext:"shared_credentials_file,optional"`
12+
DeepCheck bool `hclext:"deep_check,optional"`
13+
AccessKey string `hclext:"access_key,optional"`
14+
SecretKey string `hclext:"secret_key,optional"`
15+
Region string `hclext:"region,optional"`
16+
Profile string `hclext:"profile,optional"`
17+
SharedCredentialsFile string `hclext:"shared_credentials_file,optional"`
18+
AssumeRole *AssumeRole `hclext:"assume_role,block"`
1119
}
1220

1321
func (c *Config) toCredentials() Credentials {
14-
return Credentials{
22+
credentials := Credentials{
1523
AccessKey: c.AccessKey,
1624
SecretKey: c.SecretKey,
1725
Region: c.Region,
1826
Profile: c.Profile,
1927
CredsFile: c.SharedCredentialsFile,
2028
}
29+
30+
if c.AssumeRole != nil {
31+
credentials.AssumeRoleARN = c.AssumeRole.RoleARN
32+
credentials.AssumeRoleExternalID = c.AssumeRole.ExternalID
33+
credentials.AssumeRolePolicy = c.AssumeRole.Policy
34+
credentials.AssumeRoleSessionName = c.AssumeRole.SessionName
35+
}
36+
37+
return credentials
2138
}

0 commit comments

Comments
 (0)