ALIYUN::VPC::DhcpOptionsSetAttachment类型用于将动态主机配置协议DHCP(Dynamic Host Configuration Protocol)选项集关联到专有网络VPC(Virtual Private Cloud)。
语法
{
  "Type": "ALIYUN::VPC::DhcpOptionsSetAttachment",
  "Properties": {
    "DhcpOptionsSetId": String,
    "VpcId": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|---|---|---|---|---|
| DhcpOptionsSetId | String | 是 | 是 | DHCP选项集的ID。 关于DHCP选项集的更多信息,请参见DHCP选项集概述。 | 无 | 
| VpcId | String | 是 | 否 | DHCP选项集关联的VPC的ID。 | 无 | 
返回值
Fn::GetAtt
- DhcpOptionsSetId:DHCP选项集的ID。
- VpcId:DHCP选项集关联的VPC的ID。
示例
JSON格式
                  
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DhcpOptionsSetId": {
      "Type": "String",
      "Description": "The ID of the DHCP options set."
    },
    "VpcId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    }
  },
  "Resources": {
    "DhcpOptionsSetAttachment": {
      "Type": "ALIYUN::VPC::DhcpOptionsSetAttachment",
      "Properties": {
        "DhcpOptionsSetId": {
          "Ref": "DhcpOptionsSetId"
        },
        "VpcId": {
          "Ref": "VpcId"
        }
      }
    }
  },
  "Outputs": {
    "DhcpOptionsSetId": {
      "Description": "The ID of the DHCP options set.",
      "Value": {
        "Fn::GetAtt": [
          "DhcpOptionsSetAttachment",
          "DhcpOptionsSetId"
        ]
      }
    },
    "VpcId": {
      "Description": "The ID of the VPC network.",
      "Value": {
        "Fn::GetAtt": [
          "DhcpOptionsSetAttachment",
          "VpcId"
        ]
      }
    }
  }
}YAML格式
                  
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DhcpOptionsSetId:
    Type: String
    Description: The ID of the DHCP options set.
  VpcId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
Resources:
  DhcpOptionsSetAttachment:
    Type: ALIYUN::VPC::DhcpOptionsSetAttachment
    Properties:
      DhcpOptionsSetId:
        Ref: DhcpOptionsSetId
      VpcId:
        Ref: VpcId
Outputs:
  DhcpOptionsSetId:
    Description: The ID of the DHCP options set.
    Value:
      Fn::GetAtt:
      - DhcpOptionsSetAttachment
      - DhcpOptionsSetId
  VpcId:
    Description: The ID of the VPC network.
    Value:
      Fn::GetAtt:
      - DhcpOptionsSetAttachment
      - VpcId