Skip to content

Commit

Permalink
Update AWS provider/module and generated content
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker committed Dec 18, 2023
1 parent 72203f1 commit 9bde0e9
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 26 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -4,7 +4,7 @@ go 1.21.1

require (
github.com/agext/levenshtein v1.2.2 // indirect
github.com/aws/aws-sdk-go v1.48.13
github.com/aws/aws-sdk-go v1.49.4
github.com/dave/dst v0.27.3
github.com/fatih/color v1.13.0 // indirect
github.com/golang/mock v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -3,8 +3,8 @@ github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.48.13 h1:6N4GTme6MpxfCisWf5pql8k3TBORiKTmbeutZCDXlG8=
github.com/aws/aws-sdk-go v1.48.13/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go v1.49.4 h1:qiXsqEeLLhdLgUIyfr5ot+N/dGPWALmtM1SetRmbUlY=
github.com/aws/aws-sdk-go v1.49.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dave/dst v0.27.3 h1:P1HPoMza3cMEquVf9kKy8yXsFirry4zEnWOdYPOoIzY=
github.com/dave/dst v0.27.3/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc=
Expand Down
2 changes: 1 addition & 1 deletion rules/models/aws-sdk-go
Submodule aws-sdk-go updated 101 files
9 changes: 9 additions & 0 deletions rules/models/aws_instance_invalid_type.go
Expand Up @@ -797,6 +797,15 @@ func NewAwsInstanceInvalidTypeRule() *AwsInstanceInvalidTypeRule {
"r7i.24xlarge",
"r7i.48xlarge",
"dl2q.24xlarge",
"mac2-m2.metal",
"i4i.12xlarge",
"i4i.24xlarge",
"c7i.metal-24xl",
"c7i.metal-48xl",
"m7i.metal-24xl",
"m7i.metal-48xl",
"r7i.metal-24xl",
"r7i.metal-48xl",
},
}
}
Expand Down
9 changes: 9 additions & 0 deletions rules/models/aws_launch_configuration_invalid_type.go
Expand Up @@ -797,6 +797,15 @@ func NewAwsLaunchConfigurationInvalidTypeRule() *AwsLaunchConfigurationInvalidTy
"r7i.24xlarge",
"r7i.48xlarge",
"dl2q.24xlarge",
"mac2-m2.metal",
"i4i.12xlarge",
"i4i.24xlarge",
"c7i.metal-24xl",
"c7i.metal-48xl",
"m7i.metal-24xl",
"m7i.metal-48xl",
"r7i.metal-24xl",
"r7i.metal-48xl",
},
}
}
Expand Down
9 changes: 9 additions & 0 deletions rules/models/aws_launch_template_invalid_instance_type.go
Expand Up @@ -797,6 +797,15 @@ func NewAwsLaunchTemplateInvalidInstanceTypeRule() *AwsLaunchTemplateInvalidInst
"r7i.24xlarge",
"r7i.48xlarge",
"dl2q.24xlarge",
"mac2-m2.metal",
"i4i.12xlarge",
"i4i.24xlarge",
"c7i.metal-24xl",
"c7i.metal-48xl",
"m7i.metal-24xl",
"m7i.metal-48xl",
"r7i.metal-24xl",
"r7i.metal-48xl",
},
}
}
Expand Down
12 changes: 10 additions & 2 deletions rules/models/aws_sagemaker_app_invalid_app_type.go
Expand Up @@ -27,11 +27,19 @@ func NewAwsSagemakerAppInvalidAppTypeRule() *AwsSagemakerAppInvalidAppTypeRule {
enum: []string{
"JupyterServer",
"KernelGateway",
"DetailedProfiler",
"TensorBoard",
"VSCode",
"Savitur",
"CodeEditor",
"JupyterLab",
"RStudioServerPro",
"RSession",
"RSessionGateway",
"JupyterLab",
"CodeEditor",
"Canvas",
"DatasetManager",
"SageMakerLite",
"Local",
},
}
}
Expand Down
12 changes: 12 additions & 0 deletions rules/models/aws_sagemaker_app_invalid_domain_id.go
Expand Up @@ -3,6 +3,9 @@
package models

import (
"fmt"
"regexp"

"github.com/terraform-linters/tflint-plugin-sdk/hclext"
"github.com/terraform-linters/tflint-plugin-sdk/logger"
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
Expand All @@ -15,6 +18,7 @@ type AwsSagemakerAppInvalidDomainIDRule struct {
resourceType string
attributeName string
max int
pattern *regexp.Regexp
}

// NewAwsSagemakerAppInvalidDomainIDRule returns new rule with default attributes
Expand All @@ -23,6 +27,7 @@ func NewAwsSagemakerAppInvalidDomainIDRule() *AwsSagemakerAppInvalidDomainIDRule
resourceType: "aws_sagemaker_app",
attributeName: "domain_id",
max: 63,
pattern: regexp.MustCompile(`^d-(-*[a-z0-9]){1,61}`),
}
}

Expand Down Expand Up @@ -73,6 +78,13 @@ func (r *AwsSagemakerAppInvalidDomainIDRule) Check(runner tflint.Runner) error {
attribute.Expr.Range(),
)
}
if !r.pattern.MatchString(val) {
runner.EmitIssue(
r,
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^d-(-*[a-z0-9]){1,61}`),
attribute.Expr.Range(),
)
}
return nil
}, nil)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions rules/models/aws_sagemaker_model_invalid_name.go
Expand Up @@ -27,7 +27,7 @@ func NewAwsSagemakerModelInvalidNameRule() *AwsSagemakerModelInvalidNameRule {
resourceType: "aws_sagemaker_model",
attributeName: "name",
max: 63,
pattern: regexp.MustCompile(`^[a-zA-Z0-9](-*[a-zA-Z0-9])*`),
pattern: regexp.MustCompile(`^[a-zA-Z0-9]([\-a-zA-Z0-9]*[a-zA-Z0-9])?`),
}
}

Expand Down Expand Up @@ -81,7 +81,7 @@ func (r *AwsSagemakerModelInvalidNameRule) Check(runner tflint.Runner) error {
if !r.pattern.MatchString(val) {
runner.EmitIssue(
r,
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^[a-zA-Z0-9](-*[a-zA-Z0-9])*`),
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^[a-zA-Z0-9]([\-a-zA-Z0-9]*[a-zA-Z0-9])?`),
attribute.Expr.Range(),
)
}
Expand Down
Expand Up @@ -27,8 +27,10 @@ func NewAwsSagemakerStudioLifecycleConfigInvalidStudioLifecycleConfigAppTypeRule
enum: []string{
"JupyterServer",
"KernelGateway",
"JupyterLab",
"VSCode",
"Savitur",
"CodeEditor",
"JupyterLab",
},
}
}
Expand Down
12 changes: 12 additions & 0 deletions rules/models/aws_sagemaker_user_profile_invalid_domain_id.go
Expand Up @@ -3,6 +3,9 @@
package models

import (
"fmt"
"regexp"

"github.com/terraform-linters/tflint-plugin-sdk/hclext"
"github.com/terraform-linters/tflint-plugin-sdk/logger"
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
Expand All @@ -15,6 +18,7 @@ type AwsSagemakerUserProfileInvalidDomainIDRule struct {
resourceType string
attributeName string
max int
pattern *regexp.Regexp
}

// NewAwsSagemakerUserProfileInvalidDomainIDRule returns new rule with default attributes
Expand All @@ -23,6 +27,7 @@ func NewAwsSagemakerUserProfileInvalidDomainIDRule() *AwsSagemakerUserProfileInv
resourceType: "aws_sagemaker_user_profile",
attributeName: "domain_id",
max: 63,
pattern: regexp.MustCompile(`^d-(-*[a-z0-9]){1,61}`),
}
}

Expand Down Expand Up @@ -73,6 +78,13 @@ func (r *AwsSagemakerUserProfileInvalidDomainIDRule) Check(runner tflint.Runner)
attribute.Expr.Range(),
)
}
if !r.pattern.MatchString(val) {
runner.EmitIssue(
r,
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^d-(-*[a-z0-9]){1,61}`),
attribute.Expr.Range(),
)
}
return nil
}, nil)
if err != nil {
Expand Down
9 changes: 9 additions & 0 deletions rules/tags/resources.go

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

32 changes: 16 additions & 16 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/schema.json

Large diffs are not rendered by default.

0 comments on commit 9bde0e9

Please sign in to comment.