Skip to content

Commit e92ac98

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

7 files changed

+97
-7
lines changed

rules/magicmodules/api_definition.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ var APIDefinition = map[string]string{
8787
"google_beyondcorp_app_connection": "beyondcorp.googleapis.com",
8888
"google_beyondcorp_app_connector": "beyondcorp.googleapis.com",
8989
"google_beyondcorp_app_gateway": "beyondcorp.googleapis.com",
90-
"google_beyondcorp_application": "beyondcorp.googleapis.com",
9190
"google_beyondcorp_security_gateway": "beyondcorp.googleapis.com",
9291
"google_beyondcorp_security_gateway_application": "beyondcorp.googleapis.com",
9392
"google_biglake_catalog": "biglake.googleapis.com",
@@ -288,6 +287,7 @@ var APIDefinition = map[string]string{
288287
"google_developer_connect_git_repository_link": "developerconnect.googleapis.com",
289288
"google_developer_connect_insights_config": "developerconnect.googleapis.com",
290289
"google_dialogflow_agent": "dialogflow.googleapis.com",
290+
"google_dialogflow_conversation_profile": "dialogflow.googleapis.com",
291291
"google_dialogflow_encryption_spec": "dialogflow.googleapis.com",
292292
"google_dialogflow_entity_type": "dialogflow.googleapis.com",
293293
"google_dialogflow_fulfillment": "dialogflow.googleapis.com",
@@ -491,7 +491,6 @@ var APIDefinition = map[string]string{
491491
"google_network_services_tls_route": "networkservices.googleapis.com",
492492
"google_notebooks_environment": "notebooks.googleapis.com",
493493
"google_notebooks_instance": "notebooks.googleapis.com",
494-
"google_notebooks_location": "notebooks.googleapis.com",
495494
"google_notebooks_runtime": "notebooks.googleapis.com",
496495
"google_oracle_database_autonomous_database": "oracledatabase.googleapis.com",
497496
"google_oracle_database_cloud_exadata_infrastructure": "oracledatabase.googleapis.com",
@@ -584,7 +583,6 @@ var APIDefinition = map[string]string{
584583
"google_tags_tag_binding": "cloudresourcemanager.googleapis.com",
585584
"google_tags_tag_key": "cloudresourcemanager.googleapis.com",
586585
"google_tags_tag_value": "cloudresourcemanager.googleapis.com",
587-
"google_tpu_node": "tpu.googleapis.com",
588586
"google_transcoder_job": "transcoder.googleapis.com",
589587
"google_transcoder_job_template": "transcoder.googleapis.com",
590588
"google_vmwareengine_cluster": "vmwareengine.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+
// GoogleNetappStoragePoolInvalidQosTypeRule checks the pattern is valid
24+
type GoogleNetappStoragePoolInvalidQosTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleNetappStoragePoolInvalidQosTypeRule returns new rule with default attributes
32+
func NewGoogleNetappStoragePoolInvalidQosTypeRule() *GoogleNetappStoragePoolInvalidQosTypeRule {
33+
return &GoogleNetappStoragePoolInvalidQosTypeRule{
34+
resourceType: "google_netapp_storage_pool",
35+
attributeName: "qos_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleNetappStoragePoolInvalidQosTypeRule) Name() string {
41+
return "google_netapp_storage_pool_invalid_qos_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleNetappStoragePoolInvalidQosTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleNetappStoragePoolInvalidQosTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleNetappStoragePoolInvalidQosTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleNetappStoragePoolInvalidQosTypeRule) 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{"QOS_TYPE_UNSPECIFIED", "AUTO", "MANUAL", ""}, 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_services_gateway_invalid_routing_mode.go

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

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

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

rules/magicmodules/google_network_services_lb_traffic_extension_invalid_load_balancing_scheme.go

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

7474
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
75-
validateFunc := validation.StringInSlice([]string{"INTERNAL_MANAGED", "EXTERNAL_MANAGED", ""}, false)
75+
validateFunc := validation.StringInSlice([]string{"INTERNAL_MANAGED", "EXTERNAL_MANAGED"}, 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
@@ -241,6 +241,7 @@ var Rules = []tflint.Rule{
241241
NewGoogleMonitoringSloInvalidSloIdRule(),
242242
NewGoogleMonitoringUptimeCheckConfigInvalidCheckerTypeRule(),
243243
NewGoogleNetappBackupVaultInvalidBackupVaultTypeRule(),
244+
NewGoogleNetappStoragePoolInvalidQosTypeRule(),
244245
NewGoogleNetappStoragePoolInvalidServiceLevelRule(),
245246
NewGoogleNetappVolumeInvalidSecurityStyleRule(),
246247
NewGoogleNetappVolumeQuotaRuleInvalidTypeRule(),

rules/magicmodules/verify/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func ValidateBase64String(i interface{}, val string) ([]string, []error) {
304304
}
305305

306306
func ValidateBase64URLString(i interface{}, val string) ([]string, []error) {
307-
_, err := base64.URLEncoding.DecodeString(i.(string))
307+
_, err := base64.RawURLEncoding.DecodeString(i.(string))
308308
if err != nil {
309309
return nil, []error{fmt.Errorf("could not decode %q as a valid base64URL value.", val)}
310310
}

tools/magic-modules

Submodule magic-modules updated 489 files

0 commit comments

Comments
 (0)