Skip to content

Commit f5a8a47

Browse files
wata727github-actions[bot]
authored andcommitted
Update Magic Modules
1 parent c731a02 commit f5a8a47

File tree

5 files changed

+95
-2
lines changed

5 files changed

+95
-2
lines changed

rules/magicmodules/api_definition.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ var APIDefinition = map[string]string{
383383
"google_iam_workforce_pool": "iam.googleapis.com",
384384
"google_iam_workforce_pool_provider": "iam.googleapis.com",
385385
"google_iam_workforce_pool_provider_key": "iam.googleapis.com",
386+
"google_iam_workforce_pool_provider_scim_tenant": "iam.googleapis.com",
386387
"google_iam_workload_identity_pool": "iam.googleapis.com",
387388
"google_iam_workload_identity_pool_provider": "iam.googleapis.com",
388389
"google_iap_brand": "iap.googleapis.com",
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// ----------------------------------------------------------------------------
2+
//
3+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
4+
//
5+
// ----------------------------------------------------------------------------
6+
//
7+
// This file is automatically generated by Magic Modules and manual
8+
// changes will be clobbered when the file is regenerated.
9+
//
10+
// Please read more about how to change this file in
11+
// .github/CONTRIBUTING.md.
12+
//
13+
// ----------------------------------------------------------------------------
14+
15+
package magicmodules
16+
17+
import (
18+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
19+
"github.com/terraform-linters/tflint-plugin-sdk/hclext"
20+
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
21+
)
22+
23+
// GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule checks the pattern is valid
24+
type GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule returns new rule with default attributes
32+
func NewGoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule() *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule {
33+
return &GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule{
34+
resourceType: "google_beyondcorp_security_gateway_application",
35+
attributeName: "schema",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Name() string {
41+
return "google_beyondcorp_security_gateway_application_invalid_schema"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Check(runner tflint.Runner) error {
61+
resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{
62+
Attributes: []hclext.AttributeSchema{{Name: r.attributeName}},
63+
}, nil)
64+
if err != nil {
65+
return err
66+
}
67+
68+
for _, resource := range resources.Blocks {
69+
attribute, exists := resource.Body.Attributes[r.attributeName]
70+
if !exists {
71+
continue
72+
}
73+
74+
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
75+
validateFunc := validation.StringInSlice([]string{"PROXY_GATEWAY", "API_GATEWAY", ""}, false)
76+
77+
_, errors := validateFunc(val, r.attributeName)
78+
for _, err := range errors {
79+
if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil {
80+
return err
81+
}
82+
}
83+
return nil
84+
}, nil)
85+
if err != nil {
86+
return err
87+
}
88+
}
89+
90+
return nil
91+
}

rules/magicmodules/google_network_security_security_profile_invalid_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (r *GoogleNetworkSecuritySecurityProfileInvalidTypeRule) Check(runner tflin
7272
}
7373

7474
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
75-
validateFunc := validation.StringInSlice([]string{"THREAT_PREVENTION", "CUSTOM_MIRRORING", "CUSTOM_INTERCEPT"}, false)
75+
validateFunc := validation.StringInSlice([]string{"THREAT_PREVENTION", "URL_FILTERING", "CUSTOM_MIRRORING", "CUSTOM_INTERCEPT"}, false)
7676

7777
_, errors := validateFunc(val, r.attributeName)
7878
for _, err := range errors {

rules/magicmodules/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var Rules = []tflint.Rule{
5353
NewGoogleBackupDrManagementServerInvalidTypeRule(),
5454
NewGoogleBeyondcorpAppGatewayInvalidHostTypeRule(),
5555
NewGoogleBeyondcorpAppGatewayInvalidTypeRule(),
56+
NewGoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule(),
5657
NewGoogleBeyondcorpSecurityGatewayInvalidLocationRule(),
5758
NewGoogleBiglakeTableInvalidTypeRule(),
5859
NewGoogleBigqueryAnalyticsHubDataExchangeInvalidDiscoveryTypeRule(),

tools/magic-modules

Submodule magic-modules updated 146 files

0 commit comments

Comments
 (0)