// AWS does not provide an API to disassociate a DHCP Options set from a VPC.
// So, we do this by setting the VPC to the default DHCP Options Set.
AWS does not provide an API to disassociate a DHCP Options set from a VPC.
So, we do this by setting the VPC to the default DHCP Options Set.
// AWS does not provide an API to disassociate a DHCP Options set from a VPC . // So we do this by setting the VPC to the default DHCP Options Set .
func resourceAwsVpcDhcpOptionsAssociationDelete(d *schema.ResourceData, meta interface{}) error {
	conn := meta.(*AWSClient).ec2conn
	log.Printf("[INFO] Disassociating DHCP Options Set %s from VPC %s...", d.Get("dhcp_options_id"), d.Get("vpc_id"))
	if d.Get("dhcp_options_id").(string) == VPCDefaultOptionsID {
		return nil
	}
	_, err := conn.AssociateDhcpOptions(&ec2.AssociateDhcpOptionsInput{
		DhcpOptionsId: aws.String(VPCDefaultOptionsID),
		VpcId:         aws.String(d.Get("vpc_id").(string)),
	})
	if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidVpcIDNotFound) {
		return nil
	}
	return err
}
func resourceAwsVpcDhcpOptionsAssociationDelete ( d * schema . ResourceData , meta interface { } ) error { conn := meta . ( * AWSClient ) . ec2conn log . Printf ( " " , d . Get ( " " ) , d . Get ( " " ) ) if d . Get ( " " ) . ( string ) == VPCDefaultOptionsID { return nil } _ , err := conn . AssociateDhcpOptions ( & ec2 . AssociateDhcpOptionsInput { DhcpOptionsId : aws . String ( VPCDefaultOptionsID ) , VpcId : aws . String ( d . Get ( " " ) . ( string ) ) , } ) if tfawserr . ErrCodeEquals ( err , tfec2 . ErrCodeInvalidVpcIDNotFound ) { return nil } return err }
AWS does not provide an API to disassociate a DHCP Options set from a VPC.
AWS does not provide an API to disassociate a DHCP Options set from a VPC .
// definition of deleted is DhcpOptionsId being equal to "default", nothing to do