Skip to content

Commit 09f98d9

Browse files
wata727github-actions[bot]
authored andcommitted
Update Magic Modules
1 parent 47ed5d4 commit 09f98d9

9 files changed

+563
-1
lines changed

rules/magicmodules/api_definition.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ var APIDefinition = map[string]string{
5656
"google_apigee_keystores_aliases_self_signed_cert": "apigee.googleapis.com",
5757
"google_apigee_nat_address": "apigee.googleapis.com",
5858
"google_apigee_organization": "apigee.googleapis.com",
59+
"google_apigee_security_profile_v2": "apigee.googleapis.com",
5960
"google_apigee_sync_authorization": "apigee.googleapis.com",
6061
"google_apigee_target_server": "apigee.googleapis.com",
6162
"google_apihub_api_hub_instance": "apihub.googleapis.com",
@@ -99,6 +100,8 @@ var APIDefinition = map[string]string{
99100
"google_bigquery_reservation_assignment": "bigqueryreservation.googleapis.com",
100101
"google_bigquery_routine": "bigquery.googleapis.com",
101102
"google_bigtable_app_profile": "bigtableadmin.googleapis.com",
103+
"google_bigtable_logical_view": "bigtableadmin.googleapis.com",
104+
"google_bigtable_materialized_view": "bigtableadmin.googleapis.com",
102105
"google_billing_budget": "billingbudgets.googleapis.com",
103106
"google_billing_project_info": "cloudbilling.googleapis.com",
104107
"google_binary_authorization_attestor": "binaryauthorization.googleapis.com",
@@ -189,6 +192,8 @@ var APIDefinition = map[string]string{
189192
"google_compute_region_network_firewall_policy_association": "compute.googleapis.com",
190193
"google_compute_region_network_firewall_policy_rule": "compute.googleapis.com",
191194
"google_compute_region_per_instance_config": "compute.googleapis.com",
195+
"google_compute_region_security_policy": "compute.googleapis.com",
196+
"google_compute_region_security_policy_rule": "compute.googleapis.com",
192197
"google_compute_region_ssl_certificate": "compute.googleapis.com",
193198
"google_compute_region_ssl_policy": "compute.googleapis.com",
194199
"google_compute_region_target_http_proxy": "compute.googleapis.com",
@@ -198,6 +203,7 @@ var APIDefinition = map[string]string{
198203
"google_compute_reservation": "compute.googleapis.com",
199204
"google_compute_resize_request": "compute.googleapis.com",
200205
"google_compute_resource_policy": "compute.googleapis.com",
206+
"google_compute_resource_policy_attachment": "compute.googleapis.com",
201207
"google_compute_route": "compute.googleapis.com",
202208
"google_compute_router": "compute.googleapis.com",
203209
"google_compute_router_nat": "compute.googleapis.com",
@@ -208,6 +214,7 @@ var APIDefinition = map[string]string{
208214
"google_compute_snapshot": "compute.googleapis.com",
209215
"google_compute_ssl_certificate": "compute.googleapis.com",
210216
"google_compute_ssl_policy": "compute.googleapis.com",
217+
"google_compute_storage_pool": "compute.googleapis.com",
211218
"google_compute_subnetwork": "compute.googleapis.com",
212219
"google_compute_target_grpc_proxy": "compute.googleapis.com",
213220
"google_compute_target_http_proxy": "compute.googleapis.com",
@@ -310,7 +317,9 @@ var APIDefinition = map[string]string{
310317
"google_gemini_release_channel_setting": "cloudaicompanion.googleapis.com",
311318
"google_gemini_release_channel_setting_binding": "cloudaicompanion.googleapis.com",
312319
"google_gemini_repository_group": "cloudaicompanion.googleapis.com",
320+
"google_gke_backup_backup_channel": "gkebackup.googleapis.com",
313321
"google_gke_backup_backup_plan": "gkebackup.googleapis.com",
322+
"google_gke_backup_restore_channel": "gkebackup.googleapis.com",
314323
"google_gke_backup_restore_plan": "gkebackup.googleapis.com",
315324
"google_gke_hub_feature": "gkehub.googleapis.com",
316325
"google_gke_hub_fleet": "gkehub.googleapis.com",
@@ -452,6 +461,7 @@ var APIDefinition = map[string]string{
452461
"google_organization_access_approval_settings": "accessapproval.googleapis.com",
453462
"google_os_config_patch_deployment": "osconfig.googleapis.com",
454463
"google_os_config_v2_policy_orchestrator": "osconfig.googleapis.com",
464+
"google_os_config_v2_policy_orchestrator_for_folder": "osconfig.googleapis.com",
455465
"google_os_config_v2_policy_orchestrator_for_organization": "osconfig.googleapis.com",
456466
"google_os_login_ssh_public_key": "oslogin.googleapis.com",
457467
"google_parallelstore_instance": "parallelstore.googleapis.com",
@@ -516,6 +526,7 @@ var APIDefinition = map[string]string{
516526
"google_sql_database": "sqladmin.googleapis.com",
517527
"google_sql_source_representation_instance": "sqladmin.googleapis.com",
518528
"google_storage_anywhere_cache": "storage.googleapis.com",
529+
"google_storage_batch_operations_job": "storagebatchoperations.googleapis.com",
519530
"google_storage_bucket_access_control": "storage.googleapis.com",
520531
"google_storage_control_folder_intelligence_config": "storage.googleapis.com",
521532
"google_storage_control_organization_intelligence_config": "storage.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+
// GoogleBigqueryRoutineInvalidSecurityModeRule checks the pattern is valid
24+
type GoogleBigqueryRoutineInvalidSecurityModeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleBigqueryRoutineInvalidSecurityModeRule returns new rule with default attributes
32+
func NewGoogleBigqueryRoutineInvalidSecurityModeRule() *GoogleBigqueryRoutineInvalidSecurityModeRule {
33+
return &GoogleBigqueryRoutineInvalidSecurityModeRule{
34+
resourceType: "google_bigquery_routine",
35+
attributeName: "security_mode",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleBigqueryRoutineInvalidSecurityModeRule) Name() string {
41+
return "google_bigquery_routine_invalid_security_mode"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleBigqueryRoutineInvalidSecurityModeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleBigqueryRoutineInvalidSecurityModeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleBigqueryRoutineInvalidSecurityModeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleBigqueryRoutineInvalidSecurityModeRule) 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{"DEFINER", "INVOKER", ""}, 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+
// GoogleComputeRegionSecurityPolicyInvalidTypeRule checks the pattern is valid
24+
type GoogleComputeRegionSecurityPolicyInvalidTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleComputeRegionSecurityPolicyInvalidTypeRule returns new rule with default attributes
32+
func NewGoogleComputeRegionSecurityPolicyInvalidTypeRule() *GoogleComputeRegionSecurityPolicyInvalidTypeRule {
33+
return &GoogleComputeRegionSecurityPolicyInvalidTypeRule{
34+
resourceType: "google_compute_region_security_policy",
35+
attributeName: "type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleComputeRegionSecurityPolicyInvalidTypeRule) Name() string {
41+
return "google_compute_region_security_policy_invalid_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleComputeRegionSecurityPolicyInvalidTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleComputeRegionSecurityPolicyInvalidTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleComputeRegionSecurityPolicyInvalidTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleComputeRegionSecurityPolicyInvalidTypeRule) 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{"CLOUD_ARMOR", "CLOUD_ARMOR_EDGE", "CLOUD_ARMOR_NETWORK", ""}, 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+
// GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule checks the pattern is valid
24+
type GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule returns new rule with default attributes
32+
func NewGoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule() *GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule {
33+
return &GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule{
34+
resourceType: "google_compute_storage_pool",
35+
attributeName: "capacity_provisioning_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule) Name() string {
41+
return "google_compute_storage_pool_invalid_capacity_provisioning_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleComputeStoragePoolInvalidCapacityProvisioningTypeRule) 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{"STANDARD", "ADVANCED", ""}, 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)