ALIYUN::VPC::DhcpOptionsSetAttachment is used to associate a Dynamic Host Configuration Protocol (DHCP) options set with a virtual private cloud (VPC).

Syntax

{
  "Type": "ALIYUN::VPC::DhcpOptionsSetAttachment",
  "Properties": {
    "DhcpOptionsSetId": String,
    "VpcId": String
  }
}

Properties

Property Type Required Editable Description Constraint
DhcpOptionsSetId String Yes Yes The ID of the DHCP options set.

For more information about DHCP options sets, see Overview.

N/A
VpcId String Yes No The ID of the VPC that is associated with the DHCP options set. N/A

Response parameters

Fn::GetAtt

  • DhcpOptionsSetId: The ID of the DHCP options set.
  • VpcId: The ID of the VPC that is associated with the DHCP options set.

Examples

JSON format

{
  "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 format

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