ALIYUN::PVTZ::Rule类型用于新增转发规则。

语法

{
  "Type": "ALIYUN::PVTZ::Rule",
  "Properties": {
    "ForwardIp": List,
    "ZoneName": String,
    "Type": String,
    "EndpointId": String,
    "RuleName": String
  }
}

属性

属性名称类型必须允许更新描述约束
ForwardIpList转发目标IP配置。更多信息,请参见ForwardIp属性
ZoneNameString转发Zone名称。
TypeString转发规则类型。取值:OUTBOUND: 转发至外部IP。
EndpointIdString终端节点ID。
RuleNameString转发规则名称。

ForwardIp语法

"ForwardIp": [
  {
    "Ip": String,
    "Port": Integer
  }
]

ForwardIp属性

属性名称类型必须允许更新描述约束
IpString转发目标IP地址。
PortInteger转发目标IP地址端口号。

返回值

Fn::GetAtt

  • ForwardIp:转发目标IP地址。
  • ZoneName:转发Zone名称。
  • Vpcs:转发规则绑定的VPC列表。
  • Type:转发规则类型。
  • EndpointName:终端节点名称。
  • EndpointId:终端节点ID。
  • CreateTime:转发规则的创建时间。
  • RuleName:转发规则名称。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      EndpointId:
        Type: String
        Description: The ID of the endpoint.
    Resources:
      ExtensionResource:
        Type: ALIYUN::PVTZ::Rule
        Properties:
          ForwardIp:
            Ip: 172.16.1.1
            Port: '8080'
          ZoneName: example.com
          Type: OUTBOUND
          EndpointId:
            Ref: EndpointId
          RuleName: TestRule
    Outputs:
      ForwardIp:
        Description: The information about each destination external server.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - ForwardIp
      ZoneName:
        Description: The domain name that requires Domain Name System (DNS) traffic forwarding.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - ZoneName
      Vpcs:
        Description: The information about each virtual private cloud (VPC) that is associated with the forwarding rule.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - Vpcs
      Type:
        Description: The type of the forwarding rule.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - Type
      EndpointName:
        Description: The name of the endpoint.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - EndpointName
      EndpointId:
        Description: The ID of the endpoint.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - EndpointId
      CreateTime:
        Description: The timestamp when the forwarding rule was created.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - CreateTime
      RuleName:
        Description: The name of the forwarding rule.
        Value:
          Fn::GetAtt:
            - ExtensionResource
            - RuleName
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "EndpointId": {
          "Type": "String",
          "Description": "The ID of the endpoint."
        }
      },
      "Resources": {
        "ExtensionResource": {
          "Type": "ALIYUN::PVTZ::Rule",
          "Properties": {
            "ForwardIp": {
              "Ip": "172.16.1.1",
              "Port": "8080"
            },
            "ZoneName": "example.com",
            "Type": "OUTBOUND",
            "EndpointId": {
              "Ref": "EndpointId"
            },
            "RuleName": "TestRule"
          }
        }
      },
      "Outputs": {
        "ForwardIp": {
          "Description": "The information about each destination external server.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "ForwardIp"
            ]
          }
        },
        "ZoneName": {
          "Description": "The domain name that requires Domain Name System (DNS) traffic forwarding.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "ZoneName"
            ]
          }
        },
        "Vpcs": {
          "Description": "The information about each virtual private cloud (VPC) that is associated with the forwarding rule.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "Vpcs"
            ]
          }
        },
        "Type": {
          "Description": "The type of the forwarding rule.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "Type"
            ]
          }
        },
        "EndpointName": {
          "Description": "The name of the endpoint.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "EndpointName"
            ]
          }
        },
        "EndpointId": {
          "Description": "The ID of the endpoint.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "EndpointId"
            ]
          }
        },
        "CreateTime": {
          "Description": "The timestamp when the forwarding rule was created.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "CreateTime"
            ]
          }
        },
        "RuleName": {
          "Description": "The name of the forwarding rule.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "RuleName"
            ]
          }
        }
      }
    }