Skip to content

Commit 413b0fd

Browse files
wata727github-actions[bot]
authored andcommitted
Update Magic Modules
1 parent 82f2679 commit 413b0fd

12 files changed

+657
-50
lines changed

rules/magicmodules/api_definition.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var APIDefinition = map[string]string{
3838
"google_alloydb_instance": "alloydb.googleapis.com",
3939
"google_alloydb_user": "alloydb.googleapis.com",
4040
"google_apigee_addons_config": "apigee.googleapis.com",
41+
"google_apigee_api_product": "apigee.googleapis.com",
4142
"google_apigee_app_group": "apigee.googleapis.com",
4243
"google_apigee_control_plane_access": "apigee.googleapis.com",
4344
"google_apigee_developer": "apigee.googleapis.com",
@@ -56,6 +57,7 @@ var APIDefinition = map[string]string{
5657
"google_apigee_keystores_aliases_self_signed_cert": "apigee.googleapis.com",
5758
"google_apigee_nat_address": "apigee.googleapis.com",
5859
"google_apigee_organization": "apigee.googleapis.com",
60+
"google_apigee_security_action": "apigee.googleapis.com",
5961
"google_apigee_security_monitoring_condition": "apigee.googleapis.com",
6062
"google_apigee_security_profile_v2": "apigee.googleapis.com",
6163
"google_apigee_sync_authorization": "apigee.googleapis.com",
@@ -81,6 +83,7 @@ var APIDefinition = map[string]string{
8183
"google_backup_dr_backup_plan_association": "backupdr.googleapis.com",
8284
"google_backup_dr_backup_vault": "backupdr.googleapis.com",
8385
"google_backup_dr_management_server": "backupdr.googleapis.com",
86+
"google_backup_dr_service_config": "backupdr.googleapis.com",
8487
"google_beyondcorp_app_connection": "beyondcorp.googleapis.com",
8588
"google_beyondcorp_app_connector": "beyondcorp.googleapis.com",
8689
"google_beyondcorp_app_gateway": "beyondcorp.googleapis.com",
@@ -108,6 +111,7 @@ var APIDefinition = map[string]string{
108111
"google_bigtable_app_profile": "bigtableadmin.googleapis.com",
109112
"google_bigtable_logical_view": "bigtableadmin.googleapis.com",
110113
"google_bigtable_materialized_view": "bigtableadmin.googleapis.com",
114+
"google_bigtable_schema_bundle": "bigtableadmin.googleapis.com",
111115
"google_billing_budget": "billingbudgets.googleapis.com",
112116
"google_billing_project_info": "cloudbilling.googleapis.com",
113117
"google_binary_authorization_attestor": "binaryauthorization.googleapis.com",
@@ -355,6 +359,7 @@ var APIDefinition = map[string]string{
355359
"google_gkeonprem_bare_metal_admin_cluster": "gkeonprem.googleapis.com",
356360
"google_gkeonprem_bare_metal_cluster": "gkeonprem.googleapis.com",
357361
"google_gkeonprem_bare_metal_node_pool": "gkeonprem.googleapis.com",
362+
"google_gkeonprem_vmware_admin_cluster": "gkeonprem.googleapis.com",
358363
"google_gkeonprem_vmware_cluster": "gkeonprem.googleapis.com",
359364
"google_gkeonprem_vmware_node_pool": "gkeonprem.googleapis.com",
360365
"google_healthcare_consent_store": "healthcare.googleapis.com",
@@ -394,9 +399,11 @@ var APIDefinition = map[string]string{
394399
"google_integration_connectors_managed_zone": "connectors.googleapis.com",
395400
"google_integrations_auth_config": "integrations.googleapis.com",
396401
"google_integrations_client": "integrations.googleapis.com",
402+
"google_kms_autokey_config": "cloudkms.googleapis.com",
397403
"google_kms_crypto_key": "cloudkms.googleapis.com",
398404
"google_kms_crypto_key_version": "cloudkms.googleapis.com",
399405
"google_kms_ekm_connection": "cloudkms.googleapis.com",
406+
"google_kms_key_handle": "cloudkms.googleapis.com",
400407
"google_kms_key_ring": "cloudkms.googleapis.com",
401408
"google_kms_key_ring_import_job": "cloudkms.googleapis.com",
402409
"google_kms_secret_ciphertext": "cloudkms.googleapis.com",
@@ -417,6 +424,7 @@ var APIDefinition = map[string]string{
417424
"google_migration_center_group": "migrationcenter.googleapis.com",
418425
"google_migration_center_preference_set": "migrationcenter.googleapis.com",
419426
"google_ml_engine_model": "ml.googleapis.com",
427+
"google_model_armor_floorsetting": "modelarmor.googleapis.com",
420428
"google_monitoring_alert_policy": "monitoring.googleapis.com",
421429
"google_monitoring_custom_service": "monitoring.googleapis.com",
422430
"google_monitoring_group": "monitoring.googleapis.com",
@@ -447,6 +455,7 @@ var APIDefinition = map[string]string{
447455
"google_network_management_vpc_flow_logs_config": "networkmanagement.googleapis.com",
448456
"google_network_security_address_group": "networksecurity.googleapis.com",
449457
"google_network_security_authz_policy": "networksecurity.googleapis.com",
458+
"google_network_security_backend_authentication_config": "networksecurity.googleapis.com",
450459
"google_network_security_client_tls_policy": "networksecurity.googleapis.com",
451460
"google_network_security_firewall_endpoint": "networksecurity.googleapis.com",
452461
"google_network_security_firewall_endpoint_association": "networksecurity.googleapis.com",
@@ -486,6 +495,8 @@ var APIDefinition = map[string]string{
486495
"google_oracle_database_autonomous_database": "oracledatabase.googleapis.com",
487496
"google_oracle_database_cloud_exadata_infrastructure": "oracledatabase.googleapis.com",
488497
"google_oracle_database_cloud_vm_cluster": "oracledatabase.googleapis.com",
498+
"google_oracle_database_odb_network": "oracledatabase.googleapis.com",
499+
"google_oracle_database_odb_subnet": "oracledatabase.googleapis.com",
489500
"google_org_policy_custom_constraint": "orgpolicy.googleapis.com",
490501
"google_org_policy_policy": "orgpolicy.googleapis.com",
491502
"google_organization_access_approval_settings": "accessapproval.googleapis.com",
@@ -564,6 +575,7 @@ var APIDefinition = map[string]string{
564575
"google_storage_default_object_access_control": "storage.googleapis.com",
565576
"google_storage_folder": "storage.googleapis.com",
566577
"google_storage_hmac_key": "storage.googleapis.com",
578+
"google_storage_insights_dataset_config": "storageinsights.googleapis.com",
567579
"google_storage_insights_report_config": "storageinsights.googleapis.com",
568580
"google_storage_managed_folder": "storage.googleapis.com",
569581
"google_storage_object_access_control": "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+
// GoogleApigeeApiProductInvalidApprovalTypeRule checks the pattern is valid
24+
type GoogleApigeeApiProductInvalidApprovalTypeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleApigeeApiProductInvalidApprovalTypeRule returns new rule with default attributes
32+
func NewGoogleApigeeApiProductInvalidApprovalTypeRule() *GoogleApigeeApiProductInvalidApprovalTypeRule {
33+
return &GoogleApigeeApiProductInvalidApprovalTypeRule{
34+
resourceType: "google_apigee_api_product",
35+
attributeName: "approval_type",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleApigeeApiProductInvalidApprovalTypeRule) Name() string {
41+
return "google_apigee_api_product_invalid_approval_type"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleApigeeApiProductInvalidApprovalTypeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleApigeeApiProductInvalidApprovalTypeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleApigeeApiProductInvalidApprovalTypeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleApigeeApiProductInvalidApprovalTypeRule) 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{"auto", "manual", ""}, 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: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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/terraform-linters/tflint-plugin-sdk/hclext"
19+
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
20+
)
21+
22+
// GoogleApigeeApiProductInvalidNameRule checks the pattern is valid
23+
type GoogleApigeeApiProductInvalidNameRule struct {
24+
tflint.DefaultRule
25+
26+
resourceType string
27+
attributeName string
28+
}
29+
30+
// NewGoogleApigeeApiProductInvalidNameRule returns new rule with default attributes
31+
func NewGoogleApigeeApiProductInvalidNameRule() *GoogleApigeeApiProductInvalidNameRule {
32+
return &GoogleApigeeApiProductInvalidNameRule{
33+
resourceType: "google_apigee_api_product",
34+
attributeName: "name",
35+
}
36+
}
37+
38+
// Name returns the rule name
39+
func (r *GoogleApigeeApiProductInvalidNameRule) Name() string {
40+
return "google_apigee_api_product_invalid_name"
41+
}
42+
43+
// Enabled returns whether the rule is enabled by default
44+
func (r *GoogleApigeeApiProductInvalidNameRule) Enabled() bool {
45+
return true
46+
}
47+
48+
// Severity returns the rule severity
49+
func (r *GoogleApigeeApiProductInvalidNameRule) Severity() tflint.Severity {
50+
return tflint.ERROR
51+
}
52+
53+
// Link returns the rule reference link
54+
func (r *GoogleApigeeApiProductInvalidNameRule) Link() string {
55+
return ""
56+
}
57+
58+
// Check checks the pattern is valid
59+
func (r *GoogleApigeeApiProductInvalidNameRule) Check(runner tflint.Runner) error {
60+
resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{
61+
Attributes: []hclext.AttributeSchema{{Name: r.attributeName}},
62+
}, nil)
63+
if err != nil {
64+
return err
65+
}
66+
67+
for _, resource := range resources.Blocks {
68+
attribute, exists := resource.Body.Attributes[r.attributeName]
69+
if !exists {
70+
continue
71+
}
72+
73+
err := runner.EvaluateExpr(attribute.Expr, func(val string) error {
74+
validateFunc := validateRegexp(`^[a-z][a-z0-9._\-$ %]*$`)
75+
76+
_, errors := validateFunc(val, r.attributeName)
77+
for _, err := range errors {
78+
if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil {
79+
return err
80+
}
81+
}
82+
return nil
83+
}, nil)
84+
if err != nil {
85+
return err
86+
}
87+
}
88+
89+
return nil
90+
}
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+
// GoogleApigeeApiProductInvalidQuotaCounterScopeRule checks the pattern is valid
24+
type GoogleApigeeApiProductInvalidQuotaCounterScopeRule struct {
25+
tflint.DefaultRule
26+
27+
resourceType string
28+
attributeName string
29+
}
30+
31+
// NewGoogleApigeeApiProductInvalidQuotaCounterScopeRule returns new rule with default attributes
32+
func NewGoogleApigeeApiProductInvalidQuotaCounterScopeRule() *GoogleApigeeApiProductInvalidQuotaCounterScopeRule {
33+
return &GoogleApigeeApiProductInvalidQuotaCounterScopeRule{
34+
resourceType: "google_apigee_api_product",
35+
attributeName: "quota_counter_scope",
36+
}
37+
}
38+
39+
// Name returns the rule name
40+
func (r *GoogleApigeeApiProductInvalidQuotaCounterScopeRule) Name() string {
41+
return "google_apigee_api_product_invalid_quota_counter_scope"
42+
}
43+
44+
// Enabled returns whether the rule is enabled by default
45+
func (r *GoogleApigeeApiProductInvalidQuotaCounterScopeRule) Enabled() bool {
46+
return true
47+
}
48+
49+
// Severity returns the rule severity
50+
func (r *GoogleApigeeApiProductInvalidQuotaCounterScopeRule) Severity() tflint.Severity {
51+
return tflint.ERROR
52+
}
53+
54+
// Link returns the rule reference link
55+
func (r *GoogleApigeeApiProductInvalidQuotaCounterScopeRule) Link() string {
56+
return ""
57+
}
58+
59+
// Check checks the pattern is valid
60+
func (r *GoogleApigeeApiProductInvalidQuotaCounterScopeRule) 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{"QUOTA_COUNTER_SCOPE_UNSPECIFIED", "PROXY", "OPERATION", ""}, 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)