Пример #1
0
func deleteDefaultRoute(svc *ec2.EC2, rtid *string) error {
	defr := "0.0.0.0/0"
	dri := &ec2.DeleteRouteInput{DestinationCidrBlock: &defr, RouteTableId: rtid}
	_, err := svc.DeleteRoute(dri)
	if err != nil {
		return err
	}

	return nil
}
Пример #2
0
func deleteAwsRoute(conn *ec2.EC2, routeTableId string, cidr string) error {
	deleteOpts := &ec2.DeleteRouteInput{
		RouteTableId:         aws.String(routeTableId),
		DestinationCidrBlock: aws.String(cidr),
	}
	log.Printf("[DEBUG] Route delete opts: %s", awsutil.Prettify(deleteOpts))

	resp, err := conn.DeleteRoute(deleteOpts)
	log.Printf("[DEBUG] Route delete result: %s", awsutil.Prettify(resp))
	if err != nil {
		return err
	}
	return nil
}