AWS::EC2::VPCDHCPOptionsAssociation - AWS CloudFormation


Associates a set of DHCP options with a VPC, or associates no DHCP options with the VPC.

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::EC2::VPCDHCPOptionsAssociation", "Properties" : { "DhcpOptionsId" : String, "VpcId" : String } }


Type: AWS::EC2::VPCDHCPOptionsAssociation Properties: DhcpOptionsId: String VpcId: String



The ID of the DHCP options set, or default to associate no DHCP options with the VPC.

Required: Yes

Type: String

Update requires: No interruption


The ID of the VPC.

Required: Yes

Type: String

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the DHCP options association.

For more information about using the Ref function, see Ref.


VPC DHCP options association

The following example uses the Ref intrinsic function to associate the myDHCPOptions DHCP options with the myVPC VPC. The VPC and DHCP options can be declared in the same template or added as input parameters. For more information about the VPC or the DHCP options resources, see AWS::EC2::VPC or AWS::EC2::DHCPOptions.


"myVPCDHCPOptionsAssociation" : { "Type" : "AWS::EC2::VPCDHCPOptionsAssociation", "Properties" : { "VpcId" : {"Ref" : "myVPC"}, "DhcpOptionsId" : {"Ref" : "myDHCPOptions"} } }


myVPCDHCPOptionsAssociation: Type: AWS::EC2::VPCDHCPOptionsAssociation Properties: VpcId: Ref: myVPC DhcpOptionsId: Ref: myDHCPOptions

See also