安全规则具有无效的端口范围地形 [英] Security rule has invalid Port range terraform

查看:31
本文介绍了安全规则具有无效的端口范围地形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法使用 terraform 在 azure 中为 nsg 安全规则提供 destination_port_range.Terraform v0.12.28 provider.azurerm v2.18.0

security_rule {name = databricks-control-plane-inbound-rule";优先级 = 110方向 = 入站"访问=允许"协议=Tcp";source_port_range = "*";目的地端口范围 = 225557}

<块引用>

错误:发送请求失败:StatusCode=400 -- 原始错误:
代码 =SecurityRuleInvalidPortRange"Message=安全规则无效端口范围.提供的值:225557.值应为整数或带-"分隔符的整数范围.有效范围 0-65535."详情=[]

解决方案

对于您的问题,您希望在一个 NSG 规则中添加多个目标端口.所以你需要像这样使用 destination_port_ranges 而不是 destination_port_range :

security_rule {name = databricks-control-plane-inbound-rule";优先级 = 110方向 = 入站"访问=允许"协议=Tcp";source_port_range = "*";destination_port_ranges = [22",5557"]}

Unable to provide destination_port_range for nsg security rule in azure using terraform. Terraform v0.12.28 provider.azurerm v2.18.0

security_rule {
    name                       = "databricks-control-plane-inbound-rule"
    priority                   = 110
    direction                  = "Inbound"
    access                     = "Allow"
    protocol                   = "Tcp"
    source_port_range          = "*"
    destination_port_range     = 225557
  }

Error: Failure sending request: StatusCode=400 -- Original Error:
Code="SecurityRuleInvalidPortRange" Message="Security rule has invalid Port range. Value provided: 225557. Value should be an integer OR integer range with '-' delimiter. Valid range 0-65535." Details=[]

解决方案

For your issue, you want to add multiple destination ports in one NSG rule. So you need to use the destination_port_ranges instead of the destination_port_range like this:

security_rule {
    name                       = "databricks-control-plane-inbound-rule"
    priority                   = 110
    direction                  = "Inbound"
    access                     = "Allow"
    protocol                   = "Tcp"
    source_port_range          = "*"
    destination_port_ranges    = ["22", "5557"]
  }

这篇关于安全规则具有无效的端口范围地形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆