Skip to content

Commit ee2a2c6

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

10 files changed

+561
-4
lines changed

rules/magicmodules/api_definition.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ var APIDefinition = map[string]string{
126126
"google_certificate_manager_certificate_map_entry": "certificatemanager.googleapis.com",
127127
"google_certificate_manager_dns_authorization": "certificatemanager.googleapis.com",
128128
"google_certificate_manager_trust_config": "certificatemanager.googleapis.com",
129+
"google_ces_app": "ces.googleapis.com",
130+
"google_ces_deployment": "ces.googleapis.com",
131+
"google_ces_example": "ces.googleapis.com",
132+
"google_ces_toolset": "ces.googleapis.com",
129133
"google_cloud_asset_folder_feed": "cloudasset.googleapis.com",
130134
"google_cloud_asset_organization_feed": "cloudasset.googleapis.com",
131135
"google_cloud_asset_project_feed": "cloudasset.googleapis.com",
@@ -137,8 +141,6 @@ var APIDefinition = map[string]string{
137141
"google_cloud_run_v2_service": "run.googleapis.com",
138142
"google_cloud_run_v2_worker_pool": "run.googleapis.com",
139143
"google_cloud_scheduler_job": "cloudscheduler.googleapis.com",
140-
"google_cloud_security_compliance_cloud_control": "cloudsecuritycompliance.googleapis.com",
141-
"google_cloud_security_compliance_framework": "cloudsecuritycompliance.googleapis.com",
142144
"google_cloud_tasks_queue": "cloudtasks.googleapis.com",
143145
"google_cloudbuild_bitbucket_server_config": "cloudbuild.googleapis.com",
144146
"google_cloudbuild_trigger": "cloudbuild.googleapis.com",
@@ -451,6 +453,7 @@ var APIDefinition = map[string]string{
451453
"google_netapp_backup": "netapp.googleapis.com",
452454
"google_netapp_backup_policy": "netapp.googleapis.com",
453455
"google_netapp_backup_vault": "netapp.googleapis.com",
456+
"google_netapp_host_group": "netapp.googleapis.com",
454457
"google_netapp_kmsconfig": "netapp.googleapis.com",
455458
"google_netapp_storage_pool": "netapp.googleapis.com",
456459
"google_netapp_volume": "netapp.googleapis.com",
@@ -465,6 +468,7 @@ var APIDefinition = map[string]string{
465468
"google_network_connectivity_service_connection_policy": "networkconnectivity.googleapis.com",
466469
"google_network_connectivity_spoke": "networkconnectivity.googleapis.com",
467470
"google_network_management_connectivity_test": "networkmanagement.googleapis.com",
471+
"google_network_management_organization_vpc_flow_logs_config": "networkmanagement.googleapis.com",
468472
"google_network_management_vpc_flow_logs_config": "networkmanagement.googleapis.com",
469473
"google_network_security_address_group": "networksecurity.googleapis.com",
470474
"google_network_security_authz_policy": "networksecurity.googleapis.com",
@@ -498,6 +502,7 @@ var APIDefinition = map[string]string{
498502
"google_network_services_lb_route_extension": "networkservices.googleapis.com",
499503
"google_network_services_lb_traffic_extension": "networkservices.googleapis.com",
500504
"google_network_services_mesh": "networkservices.googleapis.com",
505+
"google_network_services_multicast_domain": "networkservices.googleapis.com",
501506
"google_network_services_service_binding": "networkservices.googleapis.com",
502507
"google_network_services_tcp_route": "networkservices.googleapis.com",
503508
"google_network_services_tls_route": "networkservices.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+
// GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule checks the pattern is valid
24+
type GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule returns new rule with default attributes
32+
func NewGoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule() *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule {
33+
return &GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule{
34+
resourceType: "google_compute_public_advertised_prefix",
35+
attributeName: "ipv6_access_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Name() string {
41+
return "google_compute_public_advertised_prefix_invalid_ipv6_access_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) 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{"EXTERNAL", "INTERNAL", ""}, 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_compute_public_delegated_prefix_invalid_mode.go

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

7474
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
75-
validateFunc := validation.StringInSlice([]string{"DELEGATION", "EXTERNAL_IPV6_FORWARDING_RULE_CREATION", "EXTERNAL_IPV6_SUBNETWORK_CREATION", ""}, false)
75+
validateFunc := validation.StringInSlice([]string{"DELEGATION", "EXTERNAL_IPV6_FORWARDING_RULE_CREATION", "EXTERNAL_IPV6_SUBNETWORK_CREATION", "INTERNAL_IPV6_SUBNETWORK_CREATION", ""}, 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+
// GoogleDiscoveryEngineControlInvalidSolutionTypeRule checks the pattern is valid
24+
type GoogleDiscoveryEngineControlInvalidSolutionTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleDiscoveryEngineControlInvalidSolutionTypeRule returns new rule with default attributes
32+
func NewGoogleDiscoveryEngineControlInvalidSolutionTypeRule() *GoogleDiscoveryEngineControlInvalidSolutionTypeRule {
33+
return &GoogleDiscoveryEngineControlInvalidSolutionTypeRule{
34+
resourceType: "google_discovery_engine_control",
35+
attributeName: "solution_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Name() string {
41+
return "google_discovery_engine_control_invalid_solution_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) 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{"SOLUTION_TYPE_RECOMMENDATION", "SOLUTION_TYPE_SEARCH", "SOLUTION_TYPE_CHAT", "SOLUTION_TYPE_GENERATIVE_CHAT"}, 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+
// GoogleNetappHostGroupInvalidOsTypeRule checks the pattern is valid
24+
type GoogleNetappHostGroupInvalidOsTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleNetappHostGroupInvalidOsTypeRule returns new rule with default attributes
32+
func NewGoogleNetappHostGroupInvalidOsTypeRule() *GoogleNetappHostGroupInvalidOsTypeRule {
33+
return &GoogleNetappHostGroupInvalidOsTypeRule{
34+
resourceType: "google_netapp_host_group",
35+
attributeName: "os_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleNetappHostGroupInvalidOsTypeRule) Name() string {
41+
return "google_netapp_host_group_invalid_os_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleNetappHostGroupInvalidOsTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleNetappHostGroupInvalidOsTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleNetappHostGroupInvalidOsTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleNetappHostGroupInvalidOsTypeRule) 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{"LINUX", "WINDOWS", "ESXI"}, 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)