From ee2a2c6706def9bbd90369fbcfc9023e80f39c31 Mon Sep 17 00:00:00 2001 From: wata727 <9624059+wata727@users.noreply.github.com> Date: Sun, 9 Nov 2025 06:50:59 +0000 Subject: [PATCH] Update Magic Modules --- rules/magicmodules/api_definition.go | 9 +- ...ertised_prefix_invalid_ipv6_access_type.go | 91 +++++++++++++++++++ ...te_public_delegated_prefix_invalid_mode.go | 2 +- ...ry_engine_control_invalid_solution_type.go | 91 +++++++++++++++++++ ...oogle_netapp_host_group_invalid_os_type.go | 91 +++++++++++++++++++ .../google_netapp_host_group_invalid_type.go | 91 +++++++++++++++++++ ...google_netapp_storage_pool_invalid_type.go | 91 +++++++++++++++++++ ...s_config_invalid_cross_project_metadata.go | 91 +++++++++++++++++++ rules/magicmodules/provider.go | 6 ++ tools/magic-modules | 2 +- 10 files changed, 561 insertions(+), 4 deletions(-) create mode 100644 rules/magicmodules/google_compute_public_advertised_prefix_invalid_ipv6_access_type.go create mode 100644 rules/magicmodules/google_discovery_engine_control_invalid_solution_type.go create mode 100644 rules/magicmodules/google_netapp_host_group_invalid_os_type.go create mode 100644 rules/magicmodules/google_netapp_host_group_invalid_type.go create mode 100644 rules/magicmodules/google_netapp_storage_pool_invalid_type.go create mode 100644 rules/magicmodules/google_network_management_organization_vpc_flow_logs_config_invalid_cross_project_metadata.go diff --git a/rules/magicmodules/api_definition.go b/rules/magicmodules/api_definition.go index 724531a7..5d2fedca 100644 --- a/rules/magicmodules/api_definition.go +++ b/rules/magicmodules/api_definition.go @@ -126,6 +126,10 @@ var APIDefinition = map[string]string{ "google_certificate_manager_certificate_map_entry": "certificatemanager.googleapis.com", "google_certificate_manager_dns_authorization": "certificatemanager.googleapis.com", "google_certificate_manager_trust_config": "certificatemanager.googleapis.com", + "google_ces_app": "ces.googleapis.com", + "google_ces_deployment": "ces.googleapis.com", + "google_ces_example": "ces.googleapis.com", + "google_ces_toolset": "ces.googleapis.com", "google_cloud_asset_folder_feed": "cloudasset.googleapis.com", "google_cloud_asset_organization_feed": "cloudasset.googleapis.com", "google_cloud_asset_project_feed": "cloudasset.googleapis.com", @@ -137,8 +141,6 @@ var APIDefinition = map[string]string{ "google_cloud_run_v2_service": "run.googleapis.com", "google_cloud_run_v2_worker_pool": "run.googleapis.com", "google_cloud_scheduler_job": "cloudscheduler.googleapis.com", - "google_cloud_security_compliance_cloud_control": "cloudsecuritycompliance.googleapis.com", - "google_cloud_security_compliance_framework": "cloudsecuritycompliance.googleapis.com", "google_cloud_tasks_queue": "cloudtasks.googleapis.com", "google_cloudbuild_bitbucket_server_config": "cloudbuild.googleapis.com", "google_cloudbuild_trigger": "cloudbuild.googleapis.com", @@ -451,6 +453,7 @@ var APIDefinition = map[string]string{ "google_netapp_backup": "netapp.googleapis.com", "google_netapp_backup_policy": "netapp.googleapis.com", "google_netapp_backup_vault": "netapp.googleapis.com", + "google_netapp_host_group": "netapp.googleapis.com", "google_netapp_kmsconfig": "netapp.googleapis.com", "google_netapp_storage_pool": "netapp.googleapis.com", "google_netapp_volume": "netapp.googleapis.com", @@ -465,6 +468,7 @@ var APIDefinition = map[string]string{ "google_network_connectivity_service_connection_policy": "networkconnectivity.googleapis.com", "google_network_connectivity_spoke": "networkconnectivity.googleapis.com", "google_network_management_connectivity_test": "networkmanagement.googleapis.com", + "google_network_management_organization_vpc_flow_logs_config": "networkmanagement.googleapis.com", "google_network_management_vpc_flow_logs_config": "networkmanagement.googleapis.com", "google_network_security_address_group": "networksecurity.googleapis.com", "google_network_security_authz_policy": "networksecurity.googleapis.com", @@ -498,6 +502,7 @@ var APIDefinition = map[string]string{ "google_network_services_lb_route_extension": "networkservices.googleapis.com", "google_network_services_lb_traffic_extension": "networkservices.googleapis.com", "google_network_services_mesh": "networkservices.googleapis.com", + "google_network_services_multicast_domain": "networkservices.googleapis.com", "google_network_services_service_binding": "networkservices.googleapis.com", "google_network_services_tcp_route": "networkservices.googleapis.com", "google_network_services_tls_route": "networkservices.googleapis.com", diff --git a/rules/magicmodules/google_compute_public_advertised_prefix_invalid_ipv6_access_type.go b/rules/magicmodules/google_compute_public_advertised_prefix_invalid_ipv6_access_type.go new file mode 100644 index 00000000..c3093ca9 --- /dev/null +++ b/rules/magicmodules/google_compute_public_advertised_prefix_invalid_ipv6_access_type.go @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: MMv1 *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package magicmodules + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-linters/tflint-plugin-sdk/hclext" + "github.com/terraform-linters/tflint-plugin-sdk/tflint" +) + +// GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule checks the pattern is valid +type GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule struct { + tflint.DefaultRule + + resourceType string + attributeName string +} + +// NewGoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule returns new rule with default attributes +func NewGoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule() *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule { + return &GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule{ + resourceType: "google_compute_public_advertised_prefix", + attributeName: "ipv6_access_type", + } +} + +// Name returns the rule name +func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Name() string { + return "google_compute_public_advertised_prefix_invalid_ipv6_access_type" +} + +// Enabled returns whether the rule is enabled by default +func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Enabled() bool { + return true +} + +// Severity returns the rule severity +func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Severity() tflint.Severity { + return tflint.ERROR +} + +// Link returns the rule reference link +func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Link() string { + return "" +} + +// Check checks the pattern is valid +func (r *GoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule) Check(runner tflint.Runner) error { + resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{ + Attributes: []hclext.AttributeSchema{{Name: r.attributeName}}, + }, nil) + if err != nil { + return err + } + + for _, resource := range resources.Blocks { + attribute, exists := resource.Body.Attributes[r.attributeName] + if !exists { + continue + } + + err := runner.EvaluateExpr(attribute.Expr, func(val string) error { + validateFunc := validation.StringInSlice([]string{"EXTERNAL", "INTERNAL", ""}, false) + + _, errors := validateFunc(val, r.attributeName) + for _, err := range errors { + if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil { + return err + } + } + return nil + }, nil) + if err != nil { + return err + } + } + + return nil +} diff --git a/rules/magicmodules/google_compute_public_delegated_prefix_invalid_mode.go b/rules/magicmodules/google_compute_public_delegated_prefix_invalid_mode.go index a11f4b1f..8f1109b2 100644 --- a/rules/magicmodules/google_compute_public_delegated_prefix_invalid_mode.go +++ b/rules/magicmodules/google_compute_public_delegated_prefix_invalid_mode.go @@ -72,7 +72,7 @@ func (r *GoogleComputePublicDelegatedPrefixInvalidModeRule) Check(runner tflint. } err := runner.EvaluateExpr(attribute.Expr, func(val string) error { - validateFunc := validation.StringInSlice([]string{"DELEGATION", "EXTERNAL_IPV6_FORWARDING_RULE_CREATION", "EXTERNAL_IPV6_SUBNETWORK_CREATION", ""}, false) + validateFunc := validation.StringInSlice([]string{"DELEGATION", "EXTERNAL_IPV6_FORWARDING_RULE_CREATION", "EXTERNAL_IPV6_SUBNETWORK_CREATION", "INTERNAL_IPV6_SUBNETWORK_CREATION", ""}, false) _, errors := validateFunc(val, r.attributeName) for _, err := range errors { diff --git a/rules/magicmodules/google_discovery_engine_control_invalid_solution_type.go b/rules/magicmodules/google_discovery_engine_control_invalid_solution_type.go new file mode 100644 index 00000000..ea617460 --- /dev/null +++ b/rules/magicmodules/google_discovery_engine_control_invalid_solution_type.go @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: MMv1 *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package magicmodules + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-linters/tflint-plugin-sdk/hclext" + "github.com/terraform-linters/tflint-plugin-sdk/tflint" +) + +// GoogleDiscoveryEngineControlInvalidSolutionTypeRule checks the pattern is valid +type GoogleDiscoveryEngineControlInvalidSolutionTypeRule struct { + tflint.DefaultRule + + resourceType string + attributeName string +} + +// NewGoogleDiscoveryEngineControlInvalidSolutionTypeRule returns new rule with default attributes +func NewGoogleDiscoveryEngineControlInvalidSolutionTypeRule() *GoogleDiscoveryEngineControlInvalidSolutionTypeRule { + return &GoogleDiscoveryEngineControlInvalidSolutionTypeRule{ + resourceType: "google_discovery_engine_control", + attributeName: "solution_type", + } +} + +// Name returns the rule name +func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Name() string { + return "google_discovery_engine_control_invalid_solution_type" +} + +// Enabled returns whether the rule is enabled by default +func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Enabled() bool { + return true +} + +// Severity returns the rule severity +func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Severity() tflint.Severity { + return tflint.ERROR +} + +// Link returns the rule reference link +func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Link() string { + return "" +} + +// Check checks the pattern is valid +func (r *GoogleDiscoveryEngineControlInvalidSolutionTypeRule) Check(runner tflint.Runner) error { + resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{ + Attributes: []hclext.AttributeSchema{{Name: r.attributeName}}, + }, nil) + if err != nil { + return err + } + + for _, resource := range resources.Blocks { + attribute, exists := resource.Body.Attributes[r.attributeName] + if !exists { + continue + } + + err := runner.EvaluateExpr(attribute.Expr, func(val string) error { + validateFunc := validation.StringInSlice([]string{"SOLUTION_TYPE_RECOMMENDATION", "SOLUTION_TYPE_SEARCH", "SOLUTION_TYPE_CHAT", "SOLUTION_TYPE_GENERATIVE_CHAT"}, false) + + _, errors := validateFunc(val, r.attributeName) + for _, err := range errors { + if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil { + return err + } + } + return nil + }, nil) + if err != nil { + return err + } + } + + return nil +} diff --git a/rules/magicmodules/google_netapp_host_group_invalid_os_type.go b/rules/magicmodules/google_netapp_host_group_invalid_os_type.go new file mode 100644 index 00000000..d98430b9 --- /dev/null +++ b/rules/magicmodules/google_netapp_host_group_invalid_os_type.go @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: MMv1 *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package magicmodules + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-linters/tflint-plugin-sdk/hclext" + "github.com/terraform-linters/tflint-plugin-sdk/tflint" +) + +// GoogleNetappHostGroupInvalidOsTypeRule checks the pattern is valid +type GoogleNetappHostGroupInvalidOsTypeRule struct { + tflint.DefaultRule + + resourceType string + attributeName string +} + +// NewGoogleNetappHostGroupInvalidOsTypeRule returns new rule with default attributes +func NewGoogleNetappHostGroupInvalidOsTypeRule() *GoogleNetappHostGroupInvalidOsTypeRule { + return &GoogleNetappHostGroupInvalidOsTypeRule{ + resourceType: "google_netapp_host_group", + attributeName: "os_type", + } +} + +// Name returns the rule name +func (r *GoogleNetappHostGroupInvalidOsTypeRule) Name() string { + return "google_netapp_host_group_invalid_os_type" +} + +// Enabled returns whether the rule is enabled by default +func (r *GoogleNetappHostGroupInvalidOsTypeRule) Enabled() bool { + return true +} + +// Severity returns the rule severity +func (r *GoogleNetappHostGroupInvalidOsTypeRule) Severity() tflint.Severity { + return tflint.ERROR +} + +// Link returns the rule reference link +func (r *GoogleNetappHostGroupInvalidOsTypeRule) Link() string { + return "" +} + +// Check checks the pattern is valid +func (r *GoogleNetappHostGroupInvalidOsTypeRule) Check(runner tflint.Runner) error { + resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{ + Attributes: []hclext.AttributeSchema{{Name: r.attributeName}}, + }, nil) + if err != nil { + return err + } + + for _, resource := range resources.Blocks { + attribute, exists := resource.Body.Attributes[r.attributeName] + if !exists { + continue + } + + err := runner.EvaluateExpr(attribute.Expr, func(val string) error { + validateFunc := validation.StringInSlice([]string{"LINUX", "WINDOWS", "ESXI"}, false) + + _, errors := validateFunc(val, r.attributeName) + for _, err := range errors { + if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil { + return err + } + } + return nil + }, nil) + if err != nil { + return err + } + } + + return nil +} diff --git a/rules/magicmodules/google_netapp_host_group_invalid_type.go b/rules/magicmodules/google_netapp_host_group_invalid_type.go new file mode 100644 index 00000000..b551fc8b --- /dev/null +++ b/rules/magicmodules/google_netapp_host_group_invalid_type.go @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: MMv1 *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package magicmodules + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-linters/tflint-plugin-sdk/hclext" + "github.com/terraform-linters/tflint-plugin-sdk/tflint" +) + +// GoogleNetappHostGroupInvalidTypeRule checks the pattern is valid +type GoogleNetappHostGroupInvalidTypeRule struct { + tflint.DefaultRule + + resourceType string + attributeName string +} + +// NewGoogleNetappHostGroupInvalidTypeRule returns new rule with default attributes +func NewGoogleNetappHostGroupInvalidTypeRule() *GoogleNetappHostGroupInvalidTypeRule { + return &GoogleNetappHostGroupInvalidTypeRule{ + resourceType: "google_netapp_host_group", + attributeName: "type", + } +} + +// Name returns the rule name +func (r *GoogleNetappHostGroupInvalidTypeRule) Name() string { + return "google_netapp_host_group_invalid_type" +} + +// Enabled returns whether the rule is enabled by default +func (r *GoogleNetappHostGroupInvalidTypeRule) Enabled() bool { + return true +} + +// Severity returns the rule severity +func (r *GoogleNetappHostGroupInvalidTypeRule) Severity() tflint.Severity { + return tflint.ERROR +} + +// Link returns the rule reference link +func (r *GoogleNetappHostGroupInvalidTypeRule) Link() string { + return "" +} + +// Check checks the pattern is valid +func (r *GoogleNetappHostGroupInvalidTypeRule) Check(runner tflint.Runner) error { + resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{ + Attributes: []hclext.AttributeSchema{{Name: r.attributeName}}, + }, nil) + if err != nil { + return err + } + + for _, resource := range resources.Blocks { + attribute, exists := resource.Body.Attributes[r.attributeName] + if !exists { + continue + } + + err := runner.EvaluateExpr(attribute.Expr, func(val string) error { + validateFunc := validation.StringInSlice([]string{"ISCSI_INITIATOR"}, false) + + _, errors := validateFunc(val, r.attributeName) + for _, err := range errors { + if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil { + return err + } + } + return nil + }, nil) + if err != nil { + return err + } + } + + return nil +} diff --git a/rules/magicmodules/google_netapp_storage_pool_invalid_type.go b/rules/magicmodules/google_netapp_storage_pool_invalid_type.go new file mode 100644 index 00000000..4b7c4bc0 --- /dev/null +++ b/rules/magicmodules/google_netapp_storage_pool_invalid_type.go @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: MMv1 *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package magicmodules + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-linters/tflint-plugin-sdk/hclext" + "github.com/terraform-linters/tflint-plugin-sdk/tflint" +) + +// GoogleNetappStoragePoolInvalidTypeRule checks the pattern is valid +type GoogleNetappStoragePoolInvalidTypeRule struct { + tflint.DefaultRule + + resourceType string + attributeName string +} + +// NewGoogleNetappStoragePoolInvalidTypeRule returns new rule with default attributes +func NewGoogleNetappStoragePoolInvalidTypeRule() *GoogleNetappStoragePoolInvalidTypeRule { + return &GoogleNetappStoragePoolInvalidTypeRule{ + resourceType: "google_netapp_storage_pool", + attributeName: "type", + } +} + +// Name returns the rule name +func (r *GoogleNetappStoragePoolInvalidTypeRule) Name() string { + return "google_netapp_storage_pool_invalid_type" +} + +// Enabled returns whether the rule is enabled by default +func (r *GoogleNetappStoragePoolInvalidTypeRule) Enabled() bool { + return true +} + +// Severity returns the rule severity +func (r *GoogleNetappStoragePoolInvalidTypeRule) Severity() tflint.Severity { + return tflint.ERROR +} + +// Link returns the rule reference link +func (r *GoogleNetappStoragePoolInvalidTypeRule) Link() string { + return "" +} + +// Check checks the pattern is valid +func (r *GoogleNetappStoragePoolInvalidTypeRule) Check(runner tflint.Runner) error { + resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{ + Attributes: []hclext.AttributeSchema{{Name: r.attributeName}}, + }, nil) + if err != nil { + return err + } + + for _, resource := range resources.Blocks { + attribute, exists := resource.Body.Attributes[r.attributeName] + if !exists { + continue + } + + err := runner.EvaluateExpr(attribute.Expr, func(val string) error { + validateFunc := validation.StringInSlice([]string{"STORAGE_POOL_TYPE_UNSPECIFIED", "FILE", "UNIFIED", ""}, false) + + _, errors := validateFunc(val, r.attributeName) + for _, err := range errors { + if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil { + return err + } + } + return nil + }, nil) + if err != nil { + return err + } + } + + return nil +} diff --git a/rules/magicmodules/google_network_management_organization_vpc_flow_logs_config_invalid_cross_project_metadata.go b/rules/magicmodules/google_network_management_organization_vpc_flow_logs_config_invalid_cross_project_metadata.go new file mode 100644 index 00000000..6d5a6444 --- /dev/null +++ b/rules/magicmodules/google_network_management_organization_vpc_flow_logs_config_invalid_cross_project_metadata.go @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: MMv1 *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package magicmodules + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-linters/tflint-plugin-sdk/hclext" + "github.com/terraform-linters/tflint-plugin-sdk/tflint" +) + +// GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule checks the pattern is valid +type GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule struct { + tflint.DefaultRule + + resourceType string + attributeName string +} + +// NewGoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule returns new rule with default attributes +func NewGoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule() *GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule { + return &GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule{ + resourceType: "google_network_management_organization_vpc_flow_logs_config", + attributeName: "cross_project_metadata", + } +} + +// Name returns the rule name +func (r *GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule) Name() string { + return "google_network_management_organization_vpc_flow_logs_config_invalid_cross_project_metadata" +} + +// Enabled returns whether the rule is enabled by default +func (r *GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule) Enabled() bool { + return true +} + +// Severity returns the rule severity +func (r *GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule) Severity() tflint.Severity { + return tflint.ERROR +} + +// Link returns the rule reference link +func (r *GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule) Link() string { + return "" +} + +// Check checks the pattern is valid +func (r *GoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule) Check(runner tflint.Runner) error { + resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{ + Attributes: []hclext.AttributeSchema{{Name: r.attributeName}}, + }, nil) + if err != nil { + return err + } + + for _, resource := range resources.Blocks { + attribute, exists := resource.Body.Attributes[r.attributeName] + if !exists { + continue + } + + err := runner.EvaluateExpr(attribute.Expr, func(val string) error { + validateFunc := validation.StringInSlice([]string{"CROSS_PROJECT_METADATA_ENABLED", "CROSS_PROJECT_METADATA_DISABLED", ""}, false) + + _, errors := validateFunc(val, r.attributeName) + for _, err := range errors { + if err := runner.EmitIssue(r, err.Error(), attribute.Expr.Range()); err != nil { + return err + } + } + return nil + }, nil) + if err != nil { + return err + } + } + + return nil +} diff --git a/rules/magicmodules/provider.go b/rules/magicmodules/provider.go index 90537afa..ccc2b615 100644 --- a/rules/magicmodules/provider.go +++ b/rules/magicmodules/provider.go @@ -134,6 +134,7 @@ var Rules = []tflint.Rule{ NewGoogleComputeNodeTemplateInvalidCpuOvercommitTypeRule(), NewGoogleComputePreviewFeatureInvalidActivationStatusRule(), NewGoogleComputeProjectCloudArmorTierInvalidCloudArmorTierRule(), + NewGoogleComputePublicAdvertisedPrefixInvalidIpv6AccessTypeRule(), NewGoogleComputePublicAdvertisedPrefixInvalidPdpScopeRule(), NewGoogleComputePublicDelegatedPrefixInvalidModeRule(), NewGoogleComputeRegionBackendServiceInvalidIpAddressSelectionPolicyRule(), @@ -200,6 +201,7 @@ var Rules = []tflint.Rule{ NewGoogleDialogflowEntityTypeInvalidKindRule(), NewGoogleDialogflowIntentInvalidWebhookStateRule(), NewGoogleDiscoveryEngineChatEngineInvalidIndustryVerticalRule(), + NewGoogleDiscoveryEngineControlInvalidSolutionTypeRule(), NewGoogleDiscoveryEngineDataStoreInvalidContentConfigRule(), NewGoogleDiscoveryEngineDataStoreInvalidIndustryVerticalRule(), NewGoogleDiscoveryEngineLicenseConfigInvalidSubscriptionTermRule(), @@ -251,8 +253,11 @@ var Rules = []tflint.Rule{ NewGoogleMonitoringSloInvalidSloIdRule(), NewGoogleMonitoringUptimeCheckConfigInvalidCheckerTypeRule(), NewGoogleNetappBackupVaultInvalidBackupVaultTypeRule(), + NewGoogleNetappHostGroupInvalidOsTypeRule(), + NewGoogleNetappHostGroupInvalidTypeRule(), NewGoogleNetappStoragePoolInvalidQosTypeRule(), NewGoogleNetappStoragePoolInvalidServiceLevelRule(), + NewGoogleNetappStoragePoolInvalidTypeRule(), NewGoogleNetappVolumeInvalidSecurityStyleRule(), NewGoogleNetappVolumeQuotaRuleInvalidTypeRule(), NewGoogleNetappVolumeReplicationInvalidReplicationScheduleRule(), @@ -263,6 +268,7 @@ var Rules = []tflint.Rule{ NewGoogleNetworkConnectivityInternalRangeInvalidUsageRule(), NewGoogleNetworkConnectivityPolicyBasedRouteInvalidNextHopOtherRoutesRule(), NewGoogleNetworkConnectivityRegionalEndpointInvalidAccessTypeRule(), + NewGoogleNetworkManagementOrganizationVpcFlowLogsConfigInvalidCrossProjectMetadataRule(), NewGoogleNetworkSecurityAddressGroupInvalidTypeRule(), NewGoogleNetworkSecurityAuthzPolicyInvalidActionRule(), NewGoogleNetworkSecurityBackendAuthenticationConfigInvalidWellKnownRootsRule(), diff --git a/tools/magic-modules b/tools/magic-modules index d3a48f39..8f7bc5a9 160000 --- a/tools/magic-modules +++ b/tools/magic-modules @@ -1 +1 @@ -Subproject commit d3a48f39aaea4df5b18c2ebfe91a036a55ff54af +Subproject commit 8f7bc5a94f36c323557856cad12076d82abbb91a