commit
3817cf8c67
|
@ -1,6 +1,7 @@
|
|||
package aws
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/snyk/driftctl/pkg/remote/aws/repository"
|
||||
remoteerror "github.com/snyk/driftctl/pkg/remote/error"
|
||||
"github.com/snyk/driftctl/pkg/resource"
|
||||
|
@ -32,6 +33,10 @@ func (e *EC2EipEnumerator) Enumerate() ([]*resource.Resource, error) {
|
|||
results := make([]*resource.Resource, 0, len(addresses))
|
||||
|
||||
for _, address := range addresses {
|
||||
if address.AllocationId == nil {
|
||||
logrus.Warn("Elastic IP does not have an allocation ID, ignoring")
|
||||
continue
|
||||
}
|
||||
results = append(
|
||||
results,
|
||||
e.factory.CreateAbstractResource(
|
||||
|
|
|
@ -232,7 +232,9 @@ func TestEC2Eip(t *testing.T) {
|
|||
test: "no eips",
|
||||
dirName: "aws_ec2_eip_empty",
|
||||
mocks: func(repository *repository.MockEC2Repository, alerter *mocks.AlerterInterface) {
|
||||
repository.On("ListAllAddresses").Return([]*ec2.Address{}, nil)
|
||||
repository.On("ListAllAddresses").Return([]*ec2.Address{
|
||||
{}, // Test Eip without AllocationId because it can happen (seen in sentry)
|
||||
}, nil)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue