更新时间:2022-02-22 GMT+08:00

NAT.SNatRule

模型说明

NAT.SNatRule用于创建SNatRule规则,设置访问外网的网段。

模型属性

表1 模型定义属性说明

属性

是否必选

描述

subnetId

SNat规则所属子网的ID

参数类型:Cloud.VPC.Subnet.Id

取值说明:到VPC服务获取Subnet ID或通过连线SNatRule.Subnet来自动生成

取值约束:满足UUID规则,最大64位

使用建议:1. 将该字段通过get_input函数传入,在AOS界面创建堆栈填写输入参数时可自动选择 2. 通过连线到subnet对象以get_reference方式获取一个新建的subnet的ID

floatingIpId

用户EIP的ID

参数类型:Cloud.VPC.EIP.Id

取值说明:支持使用已有或新建弹性公网IP的ID

使用建议:1. 通过get_attribute获取由此模板创建的弹性公网IP的ID 2. 在弹性公网IP页面获取已经创建好的IP的ID

natGatewayId

Nat网关的ID

参数类型:string

取值说明:到Nat服务获取NatGateWay ID或通过放置SNatRule到NatGateWay中自动生成

取值约束:满足UUID规则,最大64位

使用建议:1. 将该字段通过get_input函数传入,在AOS界面创建堆栈填写输入参数时可自动选择 2. 通过放置到NatGateWay中以get_reference方式获取NatGateWay的ID

关联关系

表2 关联关系说明

关系说明

关联节点

关联关系

VPC.Subnet

被包含关系

NAT.Instance

关联关系

VPC.EIP

输出

属性

参数类型

描述

refID

string

NAT sNatRule ID

blueprint样例

tosca_definitions_version: cloud_tosca_version_1_0
node_templates:
  nat:
    type: Cloud.NAT.Instance
    properties:
      subnetId:
        get_input: nat_subnetId
      flavor: small
      vpcId:
        get_input: nat_vpcId
      name:
        get_input: nat_name
  snatrule:
    type: Cloud.NAT.SNatRule
    properties:
      subnetId:
        get_input: snatrule_subnetId
      floatingIpId:
        get_input: snatrule_floatingIpId
      natGatewayId:
        get_reference: nat
    requirements:
      - natGatewayId:
          node: nat
inputs:
  nat_subnetId:
    description: Nat网关所属子网的ID。
    label: ''
  nat_vpcId:
    description: Nat网关所属VPC的ID
    label: ''
  nat_name:
    description: nat的名称
    label: ''
  snatrule_subnetId:
    description: SNat规则所属子网的ID。
    label: ''
  snatrule_floatingIpId:
    description: 用户EIP的ID
    label: ''