@@ -172,7 +172,7 @@ func deleteEC2DHCPOptions(ctx context.Context, client *ec2v2.Client, id string,
172172 DhcpOptionsId : & id ,
173173 })
174174 if err != nil {
175- if handleErrorCode (err ) == "InvalidDhcpOptions.NotFound" {
175+ if HandleErrorCode (err ) == "InvalidDhcpOptions.NotFound" {
176176 return nil
177177 }
178178 return err
@@ -189,7 +189,7 @@ func deleteEC2Image(ctx context.Context, client *ec2v2.Client, id string, logger
189189 ImageIds : []string {id },
190190 })
191191 if err != nil {
192- if handleErrorCode (err ) == "InvalidAMI.NotFound" {
192+ if HandleErrorCode (err ) == "InvalidAMI.NotFound" {
193193 return nil
194194 }
195195 return err
@@ -216,7 +216,7 @@ func deleteEC2Image(ctx context.Context, client *ec2v2.Client, id string, logger
216216 ImageId : & id ,
217217 })
218218 if err != nil {
219- if handleErrorCode (err ) == "InvalidAMI.NotFound" {
219+ if HandleErrorCode (err ) == "InvalidAMI.NotFound" {
220220 return nil
221221 }
222222 return err
@@ -231,7 +231,7 @@ func deleteEC2ElasticIP(ctx context.Context, client *ec2v2.Client, id string, lo
231231 AllocationId : aws .String (id ),
232232 })
233233 if err != nil {
234- if handleErrorCode (err ) == "InvalidAllocation.NotFound" {
234+ if HandleErrorCode (err ) == "InvalidAllocation.NotFound" {
235235 return nil
236236 }
237237 return err
@@ -246,7 +246,7 @@ func terminateEC2Instance(ctx context.Context, ec2Client *ec2v2.Client, iamClien
246246 InstanceIds : []string {id },
247247 })
248248 if err != nil {
249- if handleErrorCode (err ) == "InvalidInstance.NotFound" {
249+ if HandleErrorCode (err ) == "InvalidInstance.NotFound" {
250250 return nil
251251 }
252252 return err
@@ -300,7 +300,7 @@ func deleteEC2InternetGateway(ctx context.Context, client *ec2v2.Client, id stri
300300 })
301301 if err == nil {
302302 logger .WithField ("vpc" , * vpc .VpcId ).Debug ("Detached" )
303- } else if handleErrorCode (err ) == "Gateway.NotAttached" {
303+ } else if HandleErrorCode (err ) == "Gateway.NotAttached" {
304304 return nil
305305 }
306306 }
@@ -322,7 +322,7 @@ func deleteEC2CarrierGateway(ctx context.Context, client *ec2v2.Client, id strin
322322 CarrierGatewayId : & id ,
323323 })
324324 if err != nil {
325- if handleErrorCode (err ) == "InvalidCarrierGateway.NotFound" {
325+ if HandleErrorCode (err ) == "InvalidCarrierGateway.NotFound" {
326326 return nil
327327 }
328328 return err
@@ -337,7 +337,7 @@ func deleteEC2NATGateway(ctx context.Context, client *ec2v2.Client, id string, l
337337 NatGatewayId : aws .String (id ),
338338 })
339339 if err != nil {
340- if handleErrorCode (err ) == "NatGateway.NotFound" {
340+ if HandleErrorCode (err ) == "NatGateway.NotFound" {
341341 return nil
342342 }
343343 return err
@@ -390,7 +390,7 @@ func deleteEC2PlacementGroup(ctx context.Context, client *ec2v2.Client, id strin
390390 GroupIds : []string {id },
391391 })
392392 if err != nil {
393- if handleErrorCode (err ) == "InvalidPlacementGroup.NotFound" {
393+ if HandleErrorCode (err ) == "InvalidPlacementGroup.NotFound" {
394394 return nil
395395 }
396396 return err
@@ -413,7 +413,7 @@ func deleteEC2RouteTable(ctx context.Context, client *ec2v2.Client, id string, l
413413 RouteTableIds : []string {id },
414414 })
415415 if err != nil {
416- if handleErrorCode (err ) == "InvalidRouteTableID.NotFound" {
416+ if HandleErrorCode (err ) == "InvalidRouteTableID.NotFound" {
417417 return nil
418418 }
419419 return err
@@ -543,7 +543,7 @@ func deleteEC2SecurityGroup(ctx context.Context, client *ec2v2.Client, id string
543543 GroupIds : []string {id },
544544 })
545545 if err != nil {
546- if handleErrorCode (err ) == "InvalidGroup.NotFound" {
546+ if HandleErrorCode (err ) == "InvalidGroup.NotFound" {
547547 return nil
548548 }
549549 return err
@@ -593,7 +593,7 @@ func deleteEC2SecurityGroupObject(ctx context.Context, client *ec2v2.Client, gro
593593 GroupId : group .GroupId ,
594594 })
595595 if err != nil {
596- if handleErrorCode (err ) == "InvalidGroup.NotFound" {
596+ if HandleErrorCode (err ) == "InvalidGroup.NotFound" {
597597 return nil
598598 }
599599 return err
@@ -647,7 +647,7 @@ func deleteEC2Snapshot(ctx context.Context, client *ec2v2.Client, id string, log
647647 SnapshotId : & id ,
648648 })
649649 if err != nil {
650- if handleErrorCode (err ) == "InvalidSnapshot.NotFound" {
650+ if HandleErrorCode (err ) == "InvalidSnapshot.NotFound" {
651651 return nil
652652 }
653653 return err
@@ -662,7 +662,7 @@ func deleteEC2NetworkInterface(ctx context.Context, client *ec2v2.Client, id str
662662 NetworkInterfaceId : aws .String (id ),
663663 })
664664 if err != nil {
665- if handleErrorCode (err ) == "InvalidNetworkInterfaceID.NotFound" {
665+ if HandleErrorCode (err ) == "InvalidNetworkInterfaceID.NotFound" {
666666 return nil
667667 }
668668 return err
@@ -713,7 +713,7 @@ func deleteEC2Subnet(ctx context.Context, client *ec2v2.Client, id string, logge
713713 SubnetId : aws .String (id ),
714714 })
715715 if err != nil {
716- if handleErrorCode (err ) == "InvalidSubnetID.NotFound" {
716+ if HandleErrorCode (err ) == "InvalidSubnetID.NotFound" {
717717 return nil
718718 }
719719 return err
@@ -765,7 +765,7 @@ func deleteEC2Volume(ctx context.Context, client *ec2v2.Client, id string, logge
765765 VolumeId : aws .String (id ),
766766 })
767767 if err != nil {
768- if handleErrorCode (err ) == "InvalidVolume.NotFound" {
768+ if HandleErrorCode (err ) == "InvalidVolume.NotFound" {
769769 return nil
770770 }
771771 return err
@@ -844,7 +844,7 @@ func deleteEC2VPCEndpointsByVPC(ctx context.Context, client *ec2v2.Client, vpc s
844844 for _ , endpoint := range response .VpcEndpoints {
845845 err := deleteEC2VPCEndpoint (ctx , client , * endpoint .VpcEndpointId , logger .WithField ("VPC endpoint" , * endpoint .VpcEndpointId ))
846846 if err != nil {
847- if handleErrorCode (err ) == "InvalidVpcID.NotFound" {
847+ if HandleErrorCode (err ) == "InvalidVpcID.NotFound" {
848848 return nil
849849 }
850850 return err
@@ -859,7 +859,7 @@ func deleteEC2VPCPeeringConnection(ctx context.Context, client *ec2v2.Client, id
859859 VpcPeeringConnectionId : & id ,
860860 })
861861 if err != nil {
862- if handleErrorCode (err ) == "InvalidVpcPeeringConnection.NotFound" {
862+ if HandleErrorCode (err ) == "InvalidVpcPeeringConnection.NotFound" {
863863 return nil
864864 }
865865 return errors .Wrapf (err , "cannot delete VPC Peering Connection %s" , id )
@@ -906,7 +906,7 @@ func deleteEC2VPCEndpointService(ctx context.Context, client *ec2v2.Client, id s
906906 ServiceIds : []string {id },
907907 })
908908 if err != nil {
909- if handleErrorCode (err ) == "InvalidVpcEndpointService.NotFound" {
909+ if HandleErrorCode (err ) == "InvalidVpcEndpointService.NotFound" {
910910 return nil
911911 }
912912 return errors .Wrapf (err , "cannot delete VPC Endpoint Service %s" , id )
0 commit comments