Skip to content

Commit 82daf98

Browse files
wata727github-actions[bot]
authored andcommitted
Update Magic Modules
1 parent 002bcb8 commit 82daf98

5 files changed

+191
-1
lines changed

rules/magicmodules/api_definition.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ var APIDefinition = map[string]string{
8181
"google_backup_dr_backup_plan_association": "backupdr.googleapis.com",
8282
"google_backup_dr_backup_vault": "backupdr.googleapis.com",
8383
"google_backup_dr_management_server": "backupdr.googleapis.com",
84+
"google_backup_dr_service_config": "backupdr.googleapis.com",
8485
"google_beyondcorp_app_connection": "beyondcorp.googleapis.com",
8586
"google_beyondcorp_app_connector": "beyondcorp.googleapis.com",
8687
"google_beyondcorp_app_gateway": "beyondcorp.googleapis.com",
@@ -108,6 +109,7 @@ var APIDefinition = map[string]string{
108109
"google_bigtable_app_profile": "bigtableadmin.googleapis.com",
109110
"google_bigtable_logical_view": "bigtableadmin.googleapis.com",
110111
"google_bigtable_materialized_view": "bigtableadmin.googleapis.com",
112+
"google_bigtable_schema_bundle": "bigtableadmin.googleapis.com",
111113
"google_billing_budget": "billingbudgets.googleapis.com",
112114
"google_billing_project_info": "cloudbilling.googleapis.com",
113115
"google_binary_authorization_attestor": "binaryauthorization.googleapis.com",
@@ -355,6 +357,7 @@ var APIDefinition = map[string]string{
355357
"google_gkeonprem_bare_metal_admin_cluster": "gkeonprem.googleapis.com",
356358
"google_gkeonprem_bare_metal_cluster": "gkeonprem.googleapis.com",
357359
"google_gkeonprem_bare_metal_node_pool": "gkeonprem.googleapis.com",
360+
"google_gkeonprem_vmware_admin_cluster": "gkeonprem.googleapis.com",
358361
"google_gkeonprem_vmware_cluster": "gkeonprem.googleapis.com",
359362
"google_gkeonprem_vmware_node_pool": "gkeonprem.googleapis.com",
360363
"google_healthcare_consent_store": "healthcare.googleapis.com",
@@ -394,9 +397,11 @@ var APIDefinition = map[string]string{
394397
"google_integration_connectors_managed_zone": "connectors.googleapis.com",
395398
"google_integrations_auth_config": "integrations.googleapis.com",
396399
"google_integrations_client": "integrations.googleapis.com",
400+
"google_kms_autokey_config": "cloudkms.googleapis.com",
397401
"google_kms_crypto_key": "cloudkms.googleapis.com",
398402
"google_kms_crypto_key_version": "cloudkms.googleapis.com",
399403
"google_kms_ekm_connection": "cloudkms.googleapis.com",
404+
"google_kms_key_handle": "cloudkms.googleapis.com",
400405
"google_kms_key_ring": "cloudkms.googleapis.com",
401406
"google_kms_key_ring_import_job": "cloudkms.googleapis.com",
402407
"google_kms_secret_ciphertext": "cloudkms.googleapis.com",
@@ -447,6 +452,7 @@ var APIDefinition = map[string]string{
447452
"google_network_management_vpc_flow_logs_config": "networkmanagement.googleapis.com",
448453
"google_network_security_address_group": "networksecurity.googleapis.com",
449454
"google_network_security_authz_policy": "networksecurity.googleapis.com",
455+
"google_network_security_backend_authentication_config": "networksecurity.googleapis.com",
450456
"google_network_security_client_tls_policy": "networksecurity.googleapis.com",
451457
"google_network_security_firewall_endpoint": "networksecurity.googleapis.com",
452458
"google_network_security_firewall_endpoint_association": "networksecurity.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+
// GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule checks the pattern is valid
24+
type GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleComputeBackendBucketInvalidLoadBalancingSchemeRule returns new rule with default attributes
32+
func NewGoogleComputeBackendBucketInvalidLoadBalancingSchemeRule() *GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule {
33+
return &GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule{
34+
resourceType: "google_compute_backend_bucket",
35+
attributeName: "load_balancing_scheme",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule) Name() string {
41+
return "google_compute_backend_bucket_invalid_load_balancing_scheme"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleComputeBackendBucketInvalidLoadBalancingSchemeRule) 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{"INTERNAL_MANAGED", ""}, 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+
}
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+
// GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule checks the pattern is valid
24+
type GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule returns new rule with default attributes
32+
func NewGoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule() *GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule {
33+
return &GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule{
34+
resourceType: "google_network_security_backend_authentication_config",
35+
attributeName: "well_known_roots",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule) Name() string {
41+
return "google_network_security_backend_authentication_config_invalid_well_known_roots"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule) 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{"NONE", "PUBLIC_ROOTS", ""}, 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/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ var Rules = []tflint.Rule{
7878
NewGoogleComputeAddressInvalidNameRule(),
7979
NewGoogleComputeAddressInvalidNetworkTierRule(),
8080
NewGoogleComputeBackendBucketInvalidCompressionModeRule(),
81+
NewGoogleComputeBackendBucketInvalidLoadBalancingSchemeRule(),
8182
NewGoogleComputeBackendBucketInvalidNameRule(),
8283
NewGoogleComputeBackendBucketSignedUrlKeyInvalidNameRule(),
8384
NewGoogleComputeBackendServiceInvalidCompressionModeRule(),
@@ -244,6 +245,7 @@ var Rules = []tflint.Rule{
244245
NewGoogleNetworkConnectivityRegionalEndpointInvalidAccessTypeRule(),
245246
NewGoogleNetworkSecurityAddressGroupInvalidTypeRule(),
246247
NewGoogleNetworkSecurityAuthzPolicyInvalidActionRule(),
248+
NewGoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule(),
247249
NewGoogleNetworkSecurityGatewaySecurityPolicyRuleInvalidBasicProfileRule(),
248250
NewGoogleNetworkSecuritySecurityProfileInvalidTypeRule(),
249251
NewGoogleNetworkSecurityTlsInspectionPolicyInvalidMinTlsVersionRule(),

tools/magic-modules

Submodule magic-modules updated 215 files

0 commit comments

Comments
 (0)