From 827c41a1e3b05e3cfeb45f55ea9355c84d062676 Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:31:28 +0800 Subject: [PATCH] `azurerm_sentinel_alert_rule_scheduled` - remove the limit on number of `entity_mapping` and `sentinel_entity_mapping` --- .../sentinel_alert_rule_scheduled_resource.go | 11 +---------- .../r/sentinel_alert_rule_scheduled.html.markdown | 2 -- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/internal/services/sentinel/sentinel_alert_rule_scheduled_resource.go b/internal/services/sentinel/sentinel_alert_rule_scheduled_resource.go index 6d0209379432..527813f6bb3a 100644 --- a/internal/services/sentinel/sentinel_alert_rule_scheduled_resource.go +++ b/internal/services/sentinel/sentinel_alert_rule_scheduled_resource.go @@ -308,7 +308,7 @@ func resourceSentinelAlertRuleScheduled() *pluginsdk.Resource { "entity_mapping": { Type: pluginsdk.TypeList, Optional: true, - MaxItems: 5, + MaxItems: 10, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "entity_type": { @@ -526,20 +526,11 @@ func resourceSentinelAlertRuleScheduledCreateUpdate(d *pluginsdk.ResourceData, m param.Properties.CustomDetails = utils.ExpandPtrMapStringString(v.(map[string]interface{})) } - entityMappingCount := 0 - sentinelEntityMappingCount := 0 if v, ok := d.GetOk("entity_mapping"); ok { param.Properties.EntityMappings = expandAlertRuleEntityMapping(v.([]interface{})) - entityMappingCount = len(*param.Properties.EntityMappings) } if v, ok := d.GetOk("sentinel_entity_mapping"); ok { param.Properties.SentinelEntitiesMappings = expandAlertRuleSentinelEntityMapping(v.([]interface{})) - sentinelEntityMappingCount = len(*param.Properties.SentinelEntitiesMappings) - } - - // the max number of `sentinel_entity_mapping` and `entity_mapping` together is 5 - if entityMappingCount+sentinelEntityMappingCount > 5 { - return fmt.Errorf("`entity_mapping` and `sentinel_entity_mapping` together can't exceed 5") } if !d.IsNewResource() { diff --git a/website/docs/r/sentinel_alert_rule_scheduled.html.markdown b/website/docs/r/sentinel_alert_rule_scheduled.html.markdown index 98a43758b28e..716621443050 100644 --- a/website/docs/r/sentinel_alert_rule_scheduled.html.markdown +++ b/website/docs/r/sentinel_alert_rule_scheduled.html.markdown @@ -95,8 +95,6 @@ The following arguments are supported: * `sentinel_entity_mapping` - (Optional) A list of `sentinel_entity_mapping` blocks as defined below. --> **NOTE:** `entity_mapping` and `sentinel_entity_mapping` together can't exceed 5. - * `tactics` - (Optional) A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`. * `techniques` - (Optional) A list of techniques of attacks by which to classify the rule.