Skip to content

Commit

Permalink
Add String() and remove err return from detach action
Browse files Browse the repository at this point in the history
  • Loading branch information
sas-pemcne committed Dec 17, 2021
1 parent d35fae4 commit 45a29b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions resources/ec2-network-interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ func ListEC2NetworkInterfaces(sess *session.Session) ([]Resource, error) {
}

func (e *EC2NetworkInterface) Remove() error {

if e.eni.Attachment != nil {
_, err := e.svc.DetachNetworkInterface(&ec2.DetachNetworkInterfaceInput{
e.svc.DetachNetworkInterface(&ec2.DetachNetworkInterfaceInput{
AttachmentId: e.eni.Attachment.AttachmentId,
Force: aws.Bool(true),
})
if err != nil {
return err
}
}

params := &ec2.DeleteNetworkInterfaceInput{
Expand Down Expand Up @@ -73,3 +71,7 @@ func (r *EC2NetworkInterface) Properties() types.Properties {
Set("Status", r.eni.Status)
return properties
}

func (r *EC2NetworkInterface) String() string {
return *r.eni.NetworkInterfaceId
}

0 comments on commit 45a29b4

Please sign in to comment.