Skip to content

Commit

Permalink
Bump aws-sdk-go submodule and Terraform provider schema (#151)
Browse files Browse the repository at this point in the history
* Bump aws-sdk-go module

* Bump provider schema
  • Loading branch information
wata727 committed Aug 7, 2021
1 parent c974c12 commit dd2461d
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 20 deletions.
2 changes: 1 addition & 1 deletion rules/models/aws-sdk-go
Submodule aws-sdk-go updated 402 files
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func NewAwsAppsyncGraphqlAPIInvalidAuthenticationTypeRule() *AwsAppsyncGraphqlAP
"AWS_IAM",
"AMAZON_COGNITO_USER_POOLS",
"OPENID_CONNECT",
"AWS_LAMBDA",
},
}
}
Expand Down
1 change: 1 addition & 0 deletions rules/models/aws_glue_trigger_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func NewAwsGlueTriggerInvalidTypeRule() *AwsGlueTriggerInvalidTypeRule {
"SCHEDULED",
"CONDITIONAL",
"ON_DEMAND",
"EVENT",
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions rules/models/aws_instance_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ func NewAwsInstanceInvalidTypeRule() *AwsInstanceInvalidTypeRule {
"g3.8xlarge",
"g3.16xlarge",
"g3s.xlarge",
"g4ad.xlarge",
"g4ad.2xlarge",
"g4ad.4xlarge",
"g4ad.8xlarge",
"g4ad.16xlarge",
Expand Down
4 changes: 2 additions & 2 deletions rules/models/aws_lambda_permission_invalid_principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewAwsLambdaPermissionInvalidPrincipalRule() *AwsLambdaPermissionInvalidPri
return &AwsLambdaPermissionInvalidPrincipalRule{
resourceType: "aws_lambda_permission",
attributeName: "principal",
pattern: regexp.MustCompile(`^.*$`),
pattern: regexp.MustCompile(`^[^\s]+$`),
}
}

Expand Down Expand Up @@ -59,7 +59,7 @@ func (r *AwsLambdaPermissionInvalidPrincipalRule) Check(runner tflint.Runner) er
if !r.pattern.MatchString(val) {
runner.EmitIssueOnExpr(
r,
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^.*$`),
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^[^\s]+$`),
attribute.Expr,
)
}
Expand Down
9 changes: 9 additions & 0 deletions rules/models/aws_lambda_permission_invalid_source_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
type AwsLambdaPermissionInvalidSourceAccountRule struct {
resourceType string
attributeName string
max int
pattern *regexp.Regexp
}

Expand All @@ -23,6 +24,7 @@ func NewAwsLambdaPermissionInvalidSourceAccountRule() *AwsLambdaPermissionInvali
return &AwsLambdaPermissionInvalidSourceAccountRule{
resourceType: "aws_lambda_permission",
attributeName: "source_account",
max: 12,
pattern: regexp.MustCompile(`^\d{12}$`),
}
}
Expand Down Expand Up @@ -56,6 +58,13 @@ func (r *AwsLambdaPermissionInvalidSourceAccountRule) Check(runner tflint.Runner
err := runner.EvaluateExpr(attribute.Expr, &val, nil)

return runner.EnsureNoError(err, func() error {
if len(val) > r.max {
runner.EmitIssueOnExpr(
r,
"source_account must be 12 characters or less",
attribute.Expr,
)
}
if !r.pattern.MatchString(val) {
runner.EmitIssueOnExpr(
r,
Expand Down
2 changes: 2 additions & 0 deletions rules/models/aws_launch_configuration_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ func NewAwsLaunchConfigurationInvalidTypeRule() *AwsLaunchConfigurationInvalidTy
"g3.8xlarge",
"g3.16xlarge",
"g3s.xlarge",
"g4ad.xlarge",
"g4ad.2xlarge",
"g4ad.4xlarge",
"g4ad.8xlarge",
"g4ad.16xlarge",
Expand Down
2 changes: 2 additions & 0 deletions rules/models/aws_launch_template_invalid_instance_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ func NewAwsLaunchTemplateInvalidInstanceTypeRule() *AwsLaunchTemplateInvalidInst
"g3.8xlarge",
"g3.16xlarge",
"g3s.xlarge",
"g4ad.xlarge",
"g4ad.2xlarge",
"g4ad.4xlarge",
"g4ad.8xlarge",
"g4ad.16xlarge",
Expand Down
1 change: 1 addition & 0 deletions rules/models/aws_route53_health_check_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func NewAwsRoute53HealthCheckInvalidTypeRule() *AwsRoute53HealthCheckInvalidType
"TCP",
"CALCULATED",
"CLOUDWATCH_METRIC",
"RECOVERY_CONTROL",
},
}
}
Expand Down
11 changes: 11 additions & 0 deletions rules/tags/resources.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/provider-schema/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.3
1.0.4
28 changes: 14 additions & 14 deletions tools/provider-schema/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/provider-schema/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.48.0"
version = "3.53.0"
}
}
}
2 changes: 1 addition & 1 deletion tools/provider-schema/schema.json

Large diffs are not rendered by default.

0 comments on commit dd2461d

Please sign in to comment.