全部产品
Search
文档中心

资源编排:ALIYUN::KMS::NetworkRule

更新时间:Dec 03, 2024

ALIYUN::KMS::NetworkRule类型用于创建一条网络控制规则。

语法

{
  "Type": "ALIYUN::KMS::NetworkRule",
  "Properties": {
    "NetworkRuleName": String,
    "Description": String,
    "SourcePrivateIp": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

NetworkRuleName

String

网络控制规则名称。

Description

String

描述信息。

SourcePrivateIp

List

私网IP地址或者私网网段列表。

最多支持800个私网IP地址或者私网网段。

返回值

Fn::GetAtt

  • Description:描述信息。

  • SourcePrivateIp:私网IP地址或者私网网段列表。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SourcePrivateIp:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          en: CIDR format IP.
        Required: false
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: VPC network whitelist, The private IP address or private CIDR block, Supports binding up to 800 CIDR blocks or IP addresses.
    Required: false
    MinLength: 1
    MaxLength: 800
  NetworkRuleName:
    Type: String
    Description:
      en: The name of the access control rule.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::KMS::NetworkRule
    Properties:
      SourcePrivateIp:
        Ref: SourcePrivateIp
      NetworkRuleName:
        Ref: NetworkRuleName
Outputs:
  Description:
    Description: Description.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  SourcePrivateIp:
    Description: VPC network whitelist.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SourcePrivateIp
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SourcePrivateIp": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "en": "CIDR format IP."
          },
          "Required": false
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "VPC network whitelist, The private IP address or private CIDR block, Supports binding up to 800 CIDR blocks or IP addresses."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 800
    },
    "NetworkRuleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the access control rule."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::KMS::NetworkRule",
      "Properties": {
        "SourcePrivateIp": {
          "Ref": "SourcePrivateIp"
        },
        "NetworkRuleName": {
          "Ref": "NetworkRuleName"
        }
      }
    }
  },
  "Outputs": {
    "Description": {
      "Description": "Description.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "SourcePrivateIp": {
      "Description": "VPC network whitelist.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SourcePrivateIp"
        ]
      }
    }
  }
}