Skip to content

Commit 7f32bf6

Browse files
Update Magic Modules (#460)
Co-authored-by: wata727 <[email protected]>
1 parent fac3dfb commit 7f32bf6

15 files changed

+932
-3
lines changed

rules/magicmodules/api_definition.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var APIDefinition = map[string]string{
4343
"google_apigee_app_group": "apigee.googleapis.com",
4444
"google_apigee_control_plane_access": "apigee.googleapis.com",
4545
"google_apigee_developer": "apigee.googleapis.com",
46+
"google_apigee_developer_app": "apigee.googleapis.com",
4647
"google_apigee_dns_zone": "apigee.googleapis.com",
4748
"google_apigee_endpoint_attachment": "apigee.googleapis.com",
4849
"google_apigee_env_keystore": "apigee.googleapis.com",
@@ -51,6 +52,7 @@ var APIDefinition = map[string]string{
5152
"google_apigee_envgroup_attachment": "apigee.googleapis.com",
5253
"google_apigee_environment": "apigee.googleapis.com",
5354
"google_apigee_environment_addons_config": "apigee.googleapis.com",
55+
"google_apigee_environment_api_revision_deployment": "apigee.googleapis.com",
5456
"google_apigee_environment_keyvaluemaps": "apigee.googleapis.com",
5557
"google_apigee_environment_keyvaluemaps_entries": "apigee.googleapis.com",
5658
"google_apigee_instance": "apigee.googleapis.com",
@@ -135,6 +137,8 @@ var APIDefinition = map[string]string{
135137
"google_cloud_run_v2_service": "run.googleapis.com",
136138
"google_cloud_run_v2_worker_pool": "run.googleapis.com",
137139
"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",
138142
"google_cloud_tasks_queue": "cloudtasks.googleapis.com",
139143
"google_cloudbuild_bitbucket_server_config": "cloudbuild.googleapis.com",
140144
"google_cloudbuild_trigger": "cloudbuild.googleapis.com",
@@ -193,6 +197,7 @@ var APIDefinition = map[string]string{
193197
"google_compute_node_template": "compute.googleapis.com",
194198
"google_compute_packet_mirroring": "compute.googleapis.com",
195199
"google_compute_per_instance_config": "compute.googleapis.com",
200+
"google_compute_preview_feature": "compute.googleapis.com",
196201
"google_compute_project_cloud_armor_tier": "compute.googleapis.com",
197202
"google_compute_public_advertised_prefix": "compute.googleapis.com",
198203
"google_compute_public_delegated_prefix": "compute.googleapis.com",
@@ -267,6 +272,7 @@ var APIDefinition = map[string]string{
267272
"google_dataplex_datascan": "dataplex.googleapis.com",
268273
"google_dataplex_entry": "dataplex.googleapis.com",
269274
"google_dataplex_entry_group": "dataplex.googleapis.com",
275+
"google_dataplex_entry_link": "dataplex.googleapis.com",
270276
"google_dataplex_entry_type": "dataplex.googleapis.com",
271277
"google_dataplex_glossary": "dataplex.googleapis.com",
272278
"google_dataplex_glossary_category": "dataplex.googleapis.com",
@@ -335,6 +341,7 @@ var APIDefinition = map[string]string{
335341
"google_firestore_document": "firestore.googleapis.com",
336342
"google_firestore_field": "firestore.googleapis.com",
337343
"google_firestore_index": "firestore.googleapis.com",
344+
"google_firestore_user_creds": "firestore.googleapis.com",
338345
"google_folder_access_approval_settings": "accessapproval.googleapis.com",
339346
"google_gemini_code_repository_index": "cloudaicompanion.googleapis.com",
340347
"google_gemini_code_tools_setting": "cloudaicompanion.googleapis.com",
@@ -383,6 +390,7 @@ var APIDefinition = map[string]string{
383390
"google_iam_workforce_pool": "iam.googleapis.com",
384391
"google_iam_workforce_pool_provider": "iam.googleapis.com",
385392
"google_iam_workforce_pool_provider_key": "iam.googleapis.com",
393+
"google_iam_workforce_pool_provider_scim_tenant": "iam.googleapis.com",
386394
"google_iam_workload_identity_pool": "iam.googleapis.com",
387395
"google_iam_workload_identity_pool_provider": "iam.googleapis.com",
388396
"google_iap_brand": "iap.googleapis.com",
@@ -500,6 +508,7 @@ var APIDefinition = map[string]string{
500508
"google_oracle_database_autonomous_database": "oracledatabase.googleapis.com",
501509
"google_oracle_database_cloud_exadata_infrastructure": "oracledatabase.googleapis.com",
502510
"google_oracle_database_cloud_vm_cluster": "oracledatabase.googleapis.com",
511+
"google_oracle_database_db_system": "oracledatabase.googleapis.com",
503512
"google_oracle_database_odb_network": "oracledatabase.googleapis.com",
504513
"google_oracle_database_odb_subnet": "oracledatabase.googleapis.com",
505514
"google_org_policy_custom_constraint": "orgpolicy.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+
// GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule checks the pattern is valid
24+
type GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule returns new rule with default attributes
32+
func NewGoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule() *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule {
33+
return &GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule{
34+
resourceType: "google_beyondcorp_security_gateway_application",
35+
attributeName: "schema",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Name() string {
41+
return "google_beyondcorp_security_gateway_application_invalid_schema"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleBeyondcorpSecurityGatewayApplicationInvalidSchemaRule) 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{"PROXY_GATEWAY", "API_GATEWAY", ""}, 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+
// GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule checks the pattern is valid
24+
type GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule returns new rule with default attributes
32+
func NewGoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule() *GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule {
33+
return &GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule{
34+
resourceType: "google_compute_network_firewall_policy",
35+
attributeName: "policy_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule) Name() string {
41+
return "google_compute_network_firewall_policy_invalid_policy_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleComputeNetworkFirewallPolicyInvalidPolicyTypeRule) 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{"VPC_POLICY", ""}, 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+
// GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule checks the pattern is valid
24+
type GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule returns new rule with default attributes
32+
func NewGoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule() *GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule {
33+
return &GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule{
34+
resourceType: "google_compute_network_firewall_policy_with_rules",
35+
attributeName: "policy_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule) Name() string {
41+
return "google_compute_network_firewall_policy_with_rules_invalid_policy_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleComputeNetworkFirewallPolicyWithRulesInvalidPolicyTypeRule) 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{"VPC_POLICY", ""}, 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)