Skip to content

Commit 724e354

Browse files
Update AWS provider/module and generated content (#650)
Co-authored-by: bendrucker <[email protected]>
1 parent 300933d commit 724e354

File tree

10 files changed

+89
-24
lines changed

10 files changed

+89
-24
lines changed

aws/mock/ec2.go

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22.4
44

55
require (
66
github.com/agext/levenshtein v1.2.2 // indirect
7-
github.com/aws/aws-sdk-go v1.53.19
7+
github.com/aws/aws-sdk-go v1.54.2
88
github.com/dave/dst v0.27.3
99
github.com/fatih/color v1.13.0 // indirect
1010
github.com/golang/mock v1.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki
33
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
44
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
55
github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
6-
github.com/aws/aws-sdk-go v1.53.19 h1:WEuWc918RXlIaPCyU11F7hH9H1ItK+8m2c/uoQNRUok=
7-
github.com/aws/aws-sdk-go v1.53.19/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
6+
github.com/aws/aws-sdk-go v1.54.2 h1:Wo6AVWcleNHrYa48YzfYz60hzxGRqsJrK5s/qePe+3I=
7+
github.com/aws/aws-sdk-go v1.54.2/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
88
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
99
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
1010
github.com/dave/dst v0.27.3 h1:P1HPoMza3cMEquVf9kKy8yXsFirry4zEnWOdYPOoIzY=

rules/models/aws-sdk-go

Submodule aws-sdk-go updated 144 files

rules/models/aws_cloudhsm_v2_cluster_invalid_hsm_type.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type AwsCloudhsmV2ClusterInvalidHsmTypeRule struct {
1717

1818
resourceType string
1919
attributeName string
20+
max int
2021
pattern *regexp.Regexp
2122
}
2223

@@ -25,7 +26,8 @@ func NewAwsCloudhsmV2ClusterInvalidHsmTypeRule() *AwsCloudhsmV2ClusterInvalidHsm
2526
return &AwsCloudhsmV2ClusterInvalidHsmTypeRule{
2627
resourceType: "aws_cloudhsm_v2_cluster",
2728
attributeName: "hsm_type",
28-
pattern: regexp.MustCompile(`^(hsm1\.medium)$`),
29+
max: 32,
30+
pattern: regexp.MustCompile(`^((p|)hsm[0-9][a-z.]*\.[a-zA-Z]+)$`),
2931
}
3032
}
3133

@@ -69,10 +71,17 @@ func (r *AwsCloudhsmV2ClusterInvalidHsmTypeRule) Check(runner tflint.Runner) err
6971
}
7072

7173
err := runner.EvaluateExpr(attribute.Expr, func (val string) error {
74+
if len(val) > r.max {
75+
runner.EmitIssue(
76+
r,
77+
"hsm_type must be 32 characters or less",
78+
attribute.Expr.Range(),
79+
)
80+
}
7281
if !r.pattern.MatchString(val) {
7382
runner.EmitIssue(
7483
r,
75-
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^(hsm1\.medium)$`),
84+
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^((p|)hsm[0-9][a-z.]*\.[a-zA-Z]+)$`),
7685
attribute.Expr.Range(),
7786
)
7887
}

rules/models/aws_cloudhsm_v2_cluster_invalid_hsm_type_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "aws_cloudhsm_v2_cluster" "foo" {
2424
Expected: helper.Issues{
2525
{
2626
Rule: NewAwsCloudhsmV2ClusterInvalidHsmTypeRule(),
27-
Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("hsm1.micro"), `^(hsm1\.medium)$`),
27+
Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("hsm1.micro"), `^((p|)hsm[0-9][a-z.]*\.[a-zA-Z]+)$`),
2828
},
2929
},
3030
},

rules/models/aws_kms_key_invalid_key_usage.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func NewAwsKmsKeyInvalidKeyUsageRule() *AwsKmsKeyInvalidKeyUsageRule {
2828
"SIGN_VERIFY",
2929
"ENCRYPT_DECRYPT",
3030
"GENERATE_VERIFY_MAC",
31+
"KEY_AGREEMENT",
3132
},
3233
}
3334
}

rules/tags/resources.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/provider-schema/.terraform.lock.hcl

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/provider-schema/schema.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)