generated from terraform-linters/tflint-ruleset-template
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mapping aws_apigatewayv2 * go generate
- Loading branch information
Showing
11 changed files
with
752 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
rules/models/aws_apigatewayv2_api_invalid_protocol_type.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// This file generated by `generator/`. DO NOT EDIT | ||
|
||
package models | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
hcl "github.com/hashicorp/hcl/v2" | ||
"github.com/terraform-linters/tflint-plugin-sdk/tflint" | ||
) | ||
|
||
// AwsApigatewayv2APIInvalidProtocolTypeRule checks the pattern is valid | ||
type AwsApigatewayv2APIInvalidProtocolTypeRule struct { | ||
resourceType string | ||
attributeName string | ||
enum []string | ||
} | ||
|
||
// NewAwsApigatewayv2APIInvalidProtocolTypeRule returns new rule with default attributes | ||
func NewAwsApigatewayv2APIInvalidProtocolTypeRule() *AwsApigatewayv2APIInvalidProtocolTypeRule { | ||
return &AwsApigatewayv2APIInvalidProtocolTypeRule{ | ||
resourceType: "aws_apigatewayv2_api", | ||
attributeName: "protocol_type", | ||
enum: []string{ | ||
"WEBSOCKET", | ||
"HTTP", | ||
}, | ||
} | ||
} | ||
|
||
// Name returns the rule name | ||
func (r *AwsApigatewayv2APIInvalidProtocolTypeRule) Name() string { | ||
return "aws_apigatewayv2_api_invalid_protocol_type" | ||
} | ||
|
||
// Enabled returns whether the rule is enabled by default | ||
func (r *AwsApigatewayv2APIInvalidProtocolTypeRule) Enabled() bool { | ||
return true | ||
} | ||
|
||
// Severity returns the rule severity | ||
func (r *AwsApigatewayv2APIInvalidProtocolTypeRule) Severity() string { | ||
return tflint.ERROR | ||
} | ||
|
||
// Link returns the rule reference link | ||
func (r *AwsApigatewayv2APIInvalidProtocolTypeRule) Link() string { | ||
return "" | ||
} | ||
|
||
// Check checks the pattern is valid | ||
func (r *AwsApigatewayv2APIInvalidProtocolTypeRule) Check(runner tflint.Runner) error { | ||
log.Printf("[TRACE] Check `%s` rule", r.Name()) | ||
|
||
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error { | ||
var val string | ||
err := runner.EvaluateExpr(attribute.Expr, &val, nil) | ||
|
||
return runner.EnsureNoError(err, func() error { | ||
found := false | ||
for _, item := range r.enum { | ||
if item == val { | ||
found = true | ||
} | ||
} | ||
if !found { | ||
runner.EmitIssueOnExpr( | ||
r, | ||
fmt.Sprintf(`"%s" is an invalid value as protocol_type`, truncateLongMessage(val)), | ||
attribute.Expr, | ||
) | ||
} | ||
return nil | ||
}) | ||
}) | ||
} |
77 changes: 77 additions & 0 deletions
77
rules/models/aws_apigatewayv2_authorizer_invalid_authorizer_type.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// This file generated by `generator/`. DO NOT EDIT | ||
|
||
package models | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
hcl "github.com/hashicorp/hcl/v2" | ||
"github.com/terraform-linters/tflint-plugin-sdk/tflint" | ||
) | ||
|
||
// AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule checks the pattern is valid | ||
type AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule struct { | ||
resourceType string | ||
attributeName string | ||
enum []string | ||
} | ||
|
||
// NewAwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule returns new rule with default attributes | ||
func NewAwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule() *AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule { | ||
return &AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule{ | ||
resourceType: "aws_apigatewayv2_authorizer", | ||
attributeName: "authorizer_type", | ||
enum: []string{ | ||
"REQUEST", | ||
"JWT", | ||
}, | ||
} | ||
} | ||
|
||
// Name returns the rule name | ||
func (r *AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule) Name() string { | ||
return "aws_apigatewayv2_authorizer_invalid_authorizer_type" | ||
} | ||
|
||
// Enabled returns whether the rule is enabled by default | ||
func (r *AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule) Enabled() bool { | ||
return true | ||
} | ||
|
||
// Severity returns the rule severity | ||
func (r *AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule) Severity() string { | ||
return tflint.ERROR | ||
} | ||
|
||
// Link returns the rule reference link | ||
func (r *AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule) Link() string { | ||
return "" | ||
} | ||
|
||
// Check checks the pattern is valid | ||
func (r *AwsApigatewayv2AuthorizerInvalidAuthorizerTypeRule) Check(runner tflint.Runner) error { | ||
log.Printf("[TRACE] Check `%s` rule", r.Name()) | ||
|
||
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error { | ||
var val string | ||
err := runner.EvaluateExpr(attribute.Expr, &val, nil) | ||
|
||
return runner.EnsureNoError(err, func() error { | ||
found := false | ||
for _, item := range r.enum { | ||
if item == val { | ||
found = true | ||
} | ||
} | ||
if !found { | ||
runner.EmitIssueOnExpr( | ||
r, | ||
fmt.Sprintf(`"%s" is an invalid value as authorizer_type`, truncateLongMessage(val)), | ||
attribute.Expr, | ||
) | ||
} | ||
return nil | ||
}) | ||
}) | ||
} |
77 changes: 77 additions & 0 deletions
77
rules/models/aws_apigatewayv2_integration_invalid_connection_type.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// This file generated by `generator/`. DO NOT EDIT | ||
|
||
package models | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
hcl "github.com/hashicorp/hcl/v2" | ||
"github.com/terraform-linters/tflint-plugin-sdk/tflint" | ||
) | ||
|
||
// AwsApigatewayv2IntegrationInvalidConnectionTypeRule checks the pattern is valid | ||
type AwsApigatewayv2IntegrationInvalidConnectionTypeRule struct { | ||
resourceType string | ||
attributeName string | ||
enum []string | ||
} | ||
|
||
// NewAwsApigatewayv2IntegrationInvalidConnectionTypeRule returns new rule with default attributes | ||
func NewAwsApigatewayv2IntegrationInvalidConnectionTypeRule() *AwsApigatewayv2IntegrationInvalidConnectionTypeRule { | ||
return &AwsApigatewayv2IntegrationInvalidConnectionTypeRule{ | ||
resourceType: "aws_apigatewayv2_integration", | ||
attributeName: "connection_type", | ||
enum: []string{ | ||
"INTERNET", | ||
"VPC_LINK", | ||
}, | ||
} | ||
} | ||
|
||
// Name returns the rule name | ||
func (r *AwsApigatewayv2IntegrationInvalidConnectionTypeRule) Name() string { | ||
return "aws_apigatewayv2_integration_invalid_connection_type" | ||
} | ||
|
||
// Enabled returns whether the rule is enabled by default | ||
func (r *AwsApigatewayv2IntegrationInvalidConnectionTypeRule) Enabled() bool { | ||
return true | ||
} | ||
|
||
// Severity returns the rule severity | ||
func (r *AwsApigatewayv2IntegrationInvalidConnectionTypeRule) Severity() string { | ||
return tflint.ERROR | ||
} | ||
|
||
// Link returns the rule reference link | ||
func (r *AwsApigatewayv2IntegrationInvalidConnectionTypeRule) Link() string { | ||
return "" | ||
} | ||
|
||
// Check checks the pattern is valid | ||
func (r *AwsApigatewayv2IntegrationInvalidConnectionTypeRule) Check(runner tflint.Runner) error { | ||
log.Printf("[TRACE] Check `%s` rule", r.Name()) | ||
|
||
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error { | ||
var val string | ||
err := runner.EvaluateExpr(attribute.Expr, &val, nil) | ||
|
||
return runner.EnsureNoError(err, func() error { | ||
found := false | ||
for _, item := range r.enum { | ||
if item == val { | ||
found = true | ||
} | ||
} | ||
if !found { | ||
runner.EmitIssueOnExpr( | ||
r, | ||
fmt.Sprintf(`"%s" is an invalid value as connection_type`, truncateLongMessage(val)), | ||
attribute.Expr, | ||
) | ||
} | ||
return nil | ||
}) | ||
}) | ||
} |
77 changes: 77 additions & 0 deletions
77
rules/models/aws_apigatewayv2_integration_invalid_content_handling_strategy.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// This file generated by `generator/`. DO NOT EDIT | ||
|
||
package models | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
hcl "github.com/hashicorp/hcl/v2" | ||
"github.com/terraform-linters/tflint-plugin-sdk/tflint" | ||
) | ||
|
||
// AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule checks the pattern is valid | ||
type AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule struct { | ||
resourceType string | ||
attributeName string | ||
enum []string | ||
} | ||
|
||
// NewAwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule returns new rule with default attributes | ||
func NewAwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule() *AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule { | ||
return &AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule{ | ||
resourceType: "aws_apigatewayv2_integration", | ||
attributeName: "content_handling_strategy", | ||
enum: []string{ | ||
"CONVERT_TO_BINARY", | ||
"CONVERT_TO_TEXT", | ||
}, | ||
} | ||
} | ||
|
||
// Name returns the rule name | ||
func (r *AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule) Name() string { | ||
return "aws_apigatewayv2_integration_invalid_content_handling_strategy" | ||
} | ||
|
||
// Enabled returns whether the rule is enabled by default | ||
func (r *AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule) Enabled() bool { | ||
return true | ||
} | ||
|
||
// Severity returns the rule severity | ||
func (r *AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule) Severity() string { | ||
return tflint.ERROR | ||
} | ||
|
||
// Link returns the rule reference link | ||
func (r *AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule) Link() string { | ||
return "" | ||
} | ||
|
||
// Check checks the pattern is valid | ||
func (r *AwsApigatewayv2IntegrationInvalidContentHandlingStrategyRule) Check(runner tflint.Runner) error { | ||
log.Printf("[TRACE] Check `%s` rule", r.Name()) | ||
|
||
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error { | ||
var val string | ||
err := runner.EvaluateExpr(attribute.Expr, &val, nil) | ||
|
||
return runner.EnsureNoError(err, func() error { | ||
found := false | ||
for _, item := range r.enum { | ||
if item == val { | ||
found = true | ||
} | ||
} | ||
if !found { | ||
runner.EmitIssueOnExpr( | ||
r, | ||
fmt.Sprintf(`"%s" is an invalid value as content_handling_strategy`, truncateLongMessage(val)), | ||
attribute.Expr, | ||
) | ||
} | ||
return nil | ||
}) | ||
}) | ||
} |
Oops, something went wrong.