Skip to content

Commit d5adeff

Browse files
wata727github-actions[bot]
authored andcommitted
Update Magic Modules
1 parent 62f9348 commit d5adeff

13 files changed

+579
-4
lines changed

rules/magicmodules/api_definition.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ var APIDefinition = map[string]string{
5757
"google_apigee_sync_authorization": "apigee.googleapis.com",
5858
"google_apigee_target_server": "apigee.googleapis.com",
5959
"google_apihub_api_hub_instance": "apihub.googleapis.com",
60+
"google_apihub_host_project_registration": "apihub.googleapis.com",
6061
"google_app_engine_application_url_dispatch_rules": "appengine.googleapis.com",
6162
"google_app_engine_domain_mapping": "appengine.googleapis.com",
6263
"google_app_engine_firewall_rule": "appengine.googleapis.com",
@@ -152,6 +153,7 @@ var APIDefinition = map[string]string{
152153
"google_compute_instance_group_membership": "compute.googleapis.com",
153154
"google_compute_instance_group_named_port": "compute.googleapis.com",
154155
"google_compute_instance_settings": "compute.googleapis.com",
156+
"google_compute_instant_snapshot": "compute.googleapis.com",
155157
"google_compute_interconnect": "compute.googleapis.com",
156158
"google_compute_interconnect_attachment": "compute.googleapis.com",
157159
"google_compute_managed_ssl_certificate": "compute.googleapis.com",
@@ -264,7 +266,11 @@ var APIDefinition = map[string]string{
264266
"google_edgenetwork_network": "edgenetwork.googleapis.com",
265267
"google_edgenetwork_subnet": "edgenetwork.googleapis.com",
266268
"google_essential_contacts_contact": "essentialcontacts.googleapis.com",
269+
"google_eventarc_channel": "eventarc.googleapis.com",
270+
"google_eventarc_google_api_source": "eventarc.googleapis.com",
267271
"google_eventarc_google_channel_config": "eventarc.googleapis.com",
272+
"google_eventarc_message_bus": "eventarc.googleapis.com",
273+
"google_eventarc_pipeline": "eventarc.googleapis.com",
268274
"google_eventarc_trigger": "eventarc.googleapis.com",
269275
"google_filestore_backup": "file.googleapis.com",
270276
"google_filestore_instance": "file.googleapis.com",
@@ -285,7 +291,9 @@ var APIDefinition = map[string]string{
285291
"google_folder_access_approval_settings": "accessapproval.googleapis.com",
286292
"google_gemini_code_repository_index": "cloudaicompanion.googleapis.com",
287293
"google_gemini_data_sharing_with_google_setting": "cloudaicompanion.googleapis.com",
294+
"google_gemini_data_sharing_with_google_setting_binding": "cloudaicompanion.googleapis.com",
288295
"google_gemini_gemini_gcp_enablement_setting": "cloudaicompanion.googleapis.com",
296+
"google_gemini_gemini_gcp_enablement_setting_binding": "cloudaicompanion.googleapis.com",
289297
"google_gemini_logging_setting": "cloudaicompanion.googleapis.com",
290298
"google_gemini_logging_setting_binding": "cloudaicompanion.googleapis.com",
291299
"google_gemini_release_channel_setting": "cloudaicompanion.googleapis.com",
@@ -315,6 +323,8 @@ var APIDefinition = map[string]string{
315323
"google_iam_access_boundary_policy": "iam.googleapis.com",
316324
"google_iam_deny_policy": "iam.googleapis.com",
317325
"google_iam_folders_policy_binding": "iam.googleapis.com",
326+
"google_iam_oauth_client": "iam.googleapis.com",
327+
"google_iam_oauth_client_credential": "iam.googleapis.com",
318328
"google_iam_organizations_policy_binding": "iam.googleapis.com",
319329
"google_iam_principal_access_boundary_policy": "iam.googleapis.com",
320330
"google_iam_projects_policy_binding": "iam.googleapis.com",
@@ -403,9 +413,16 @@ var APIDefinition = map[string]string{
403413
"google_network_services_edge_cache_keyset": "networkservices.googleapis.com",
404414
"google_network_services_edge_cache_origin": "networkservices.googleapis.com",
405415
"google_network_services_edge_cache_service": "networkservices.googleapis.com",
416+
"google_network_services_endpoint_policy": "networkservices.googleapis.com",
406417
"google_network_services_gateway": "networkservices.googleapis.com",
418+
"google_network_services_grpc_route": "networkservices.googleapis.com",
419+
"google_network_services_http_route": "networkservices.googleapis.com",
407420
"google_network_services_lb_route_extension": "networkservices.googleapis.com",
408421
"google_network_services_lb_traffic_extension": "networkservices.googleapis.com",
422+
"google_network_services_mesh": "networkservices.googleapis.com",
423+
"google_network_services_service_binding": "networkservices.googleapis.com",
424+
"google_network_services_tcp_route": "networkservices.googleapis.com",
425+
"google_network_services_tls_route": "networkservices.googleapis.com",
409426
"google_notebooks_environment": "notebooks.googleapis.com",
410427
"google_notebooks_instance": "notebooks.googleapis.com",
411428
"google_notebooks_location": "notebooks.googleapis.com",

rules/magicmodules/google_compute_backend_service_invalid_locality_lb_policy.go

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

7474
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
75-
validateFunc := validation.StringInSlice([]string{"ROUND_ROBIN", "LEAST_REQUEST", "RING_HASH", "RANDOM", "ORIGINAL_DESTINATION", "MAGLEV", "WEIGHTED_MAGLEV", ""}, false)
75+
validateFunc := validation.StringInSlice([]string{"ROUND_ROBIN", "LEAST_REQUEST", "RING_HASH", "RANDOM", "ORIGINAL_DESTINATION", "MAGLEV", "WEIGHTED_MAGLEV", "WEIGHTED_ROUND_ROBIN", ""}, false)
7676

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

rules/magicmodules/google_compute_region_backend_service_invalid_locality_lb_policy.go

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

7474
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
75-
validateFunc := validation.StringInSlice([]string{"ROUND_ROBIN", "LEAST_REQUEST", "RING_HASH", "RANDOM", "ORIGINAL_DESTINATION", "MAGLEV", "WEIGHTED_MAGLEV", ""}, false)
75+
validateFunc := validation.StringInSlice([]string{"ROUND_ROBIN", "LEAST_REQUEST", "RING_HASH", "RANDOM", "ORIGINAL_DESTINATION", "MAGLEV", "WEIGHTED_MAGLEV", "WEIGHTED_ROUND_ROBIN", ""}, false)
7676

7777
_, errors := validateFunc(val, r.attributeName)
7878
for _, err := range errors {
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+
// GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule checks the pattern is valid
24+
type GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule returns new rule with default attributes
32+
func NewGoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule() *GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule {
33+
return &GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule{
34+
resourceType: "google_gemini_data_sharing_with_google_setting_binding",
35+
attributeName: "product",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule) Name() string {
41+
return "google_gemini_data_sharing_with_google_setting_binding_invalid_product"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleGeminiDataSharingWithGoogleSettingBindingInvalidProductRule) 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{"GEMINI_CLOUD_ASSIST", ""}, 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+
// GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule checks the pattern is valid
24+
type GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule returns new rule with default attributes
32+
func NewGoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule() *GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule {
33+
return &GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule{
34+
resourceType: "google_gemini_gemini_gcp_enablement_setting_binding",
35+
attributeName: "product",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule) Name() string {
41+
return "google_gemini_gemini_gcp_enablement_setting_binding_invalid_product"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleGeminiGeminiGcpEnablementSettingBindingInvalidProductRule) 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{"GEMINI_IN_BIGQUERY", ""}, 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_gemini_logging_setting_binding_invalid_product.go

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

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

7777
_, errors := validateFunc(val, r.attributeName)
7878
for _, err := range errors {
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+
// GoogleNetworkConnectivityHubInvalidPolicyModeRule checks the pattern is valid
24+
type GoogleNetworkConnectivityHubInvalidPolicyModeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleNetworkConnectivityHubInvalidPolicyModeRule returns new rule with default attributes
32+
func NewGoogleNetworkConnectivityHubInvalidPolicyModeRule() *GoogleNetworkConnectivityHubInvalidPolicyModeRule {
33+
return &GoogleNetworkConnectivityHubInvalidPolicyModeRule{
34+
resourceType: "google_network_connectivity_hub",
35+
attributeName: "policy_mode",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleNetworkConnectivityHubInvalidPolicyModeRule) Name() string {
41+
return "google_network_connectivity_hub_invalid_policy_mode"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleNetworkConnectivityHubInvalidPolicyModeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleNetworkConnectivityHubInvalidPolicyModeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleNetworkConnectivityHubInvalidPolicyModeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleNetworkConnectivityHubInvalidPolicyModeRule) 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{"CUSTOM", "PRESET", ""}, 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+
}

0 commit comments

Comments
 (0)