Skip to content

Commit accba44

Browse files
Update AWS provider/module and generated content (#485)
Co-authored-by: bendrucker <[email protected]>
1 parent be95286 commit accba44

10 files changed

+38
-24
lines changed

go.mod

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

55
require (
66
github.com/agext/levenshtein v1.2.2 // indirect
7-
github.com/aws/aws-sdk-go v1.44.248
7+
github.com/aws/aws-sdk-go v1.44.253
88
github.com/dave/dst v0.27.2
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/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
44
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
55
github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
6-
github.com/aws/aws-sdk-go v1.44.248 h1:GvkxpgsxqNc03LmhXiaxKpzbyxndnex7V+OThLx4g5M=
7-
github.com/aws/aws-sdk-go v1.44.248/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
6+
github.com/aws/aws-sdk-go v1.44.253 h1:iqDd0okcH4ShfFexz2zzf4VmeDFf6NOMm07pHnEb8iY=
7+
github.com/aws/aws-sdk-go v1.44.253/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
88
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
99
github.com/dave/dst v0.27.2 h1:4Y5VFTkhGLC1oddtNwuxxe36pnyLxMFXT51FOzH8Ekc=
1010
github.com/dave/dst v0.27.2/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc=

rules/models/aws-sdk-go

Submodule aws-sdk-go updated 128 files

rules/models/aws_datasync_task_invalid_cloudwatch_log_group_arn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func NewAwsDatasyncTaskInvalidCloudwatchLogGroupArnRule() *AwsDatasyncTaskInvali
2727
resourceType: "aws_datasync_task",
2828
attributeName: "cloudwatch_log_group_arn",
2929
max: 562,
30-
pattern: regexp.MustCompile(`^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]*:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`),
30+
pattern: regexp.MustCompile(`^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]+:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`),
3131
}
3232
}
3333

@@ -81,7 +81,7 @@ func (r *AwsDatasyncTaskInvalidCloudwatchLogGroupArnRule) Check(runner tflint.Ru
8181
if !r.pattern.MatchString(val) {
8282
runner.EmitIssue(
8383
r,
84-
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]*:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`),
84+
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]+:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`),
8585
attribute.Expr.Range(),
8686
)
8787
}

rules/models/aws_datasync_task_invalid_cloudwatch_log_group_arn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "aws_datasync_task" "foo" {
2424
Expected: helper.Issues{
2525
{
2626
Rule: NewAwsDatasyncTaskInvalidCloudwatchLogGroupArnRule(),
27-
Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:s3:::my_corporate_bucket"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]*:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`),
27+
Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:s3:::my_corporate_bucket"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]+:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`),
2828
},
2929
},
3030
},

rules/models/aws_directory_service_conditional_forwarder_invalid_remote_domain_name.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type AwsDirectoryServiceConditionalForwarderInvalidRemoteDomainNameRule struct {
1717

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

@@ -25,6 +26,7 @@ func NewAwsDirectoryServiceConditionalForwarderInvalidRemoteDomainNameRule() *Aw
2526
return &AwsDirectoryServiceConditionalForwarderInvalidRemoteDomainNameRule{
2627
resourceType: "aws_directory_service_conditional_forwarder",
2728
attributeName: "remote_domain_name",
29+
max: 1024,
2830
pattern: regexp.MustCompile(`^([a-zA-Z0-9]+[\\.-])+([a-zA-Z0-9])+[.]?$`),
2931
}
3032
}
@@ -69,6 +71,13 @@ func (r *AwsDirectoryServiceConditionalForwarderInvalidRemoteDomainNameRule) Che
6971
}
7072

7173
err := runner.EvaluateExpr(attribute.Expr, func (val string) error {
74+
if len(val) > r.max {
75+
runner.EmitIssue(
76+
r,
77+
"remote_domain_name must be 1024 characters or less",
78+
attribute.Expr.Range(),
79+
)
80+
}
7281
if !r.pattern.MatchString(val) {
7382
runner.EmitIssue(
7483
r,

rules/models/aws_lambda_function_invalid_runtime.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func NewAwsLambdaFunctionInvalidRuntimeRule() *AwsLambdaFunctionInvalidRuntimeRu
5454
"provided.al2",
5555
"nodejs18.x",
5656
"python3.10",
57+
"java17",
5758
},
5859
}
5960
}

rules/tags/resources.go

Lines changed: 4 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)