Skip to content

Commit

Permalink
fix rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Jan 28, 2022
1 parent 6fb5691 commit 322647c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions internal/service/ec2/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,31 @@ func FindEBSVolume(conn *ec2.EC2, input *ec2.DescribeVolumesInput) (*ec2.Volume,
return output[0], nil
}

func FindEIPs(conn *ec2.EC2, input *ec2.DescribeAddressesInput) ([]*ec2.Address, error) {
var addresses []*ec2.Address

output, err := conn.DescribeAddresses(input)

if tfawserr.ErrCodeEquals(err, ErrCodeInvalidAddressNotFound, ErrCodeInvalidAllocationIDNotFound) {
return nil, &resource.NotFoundError{
LastError: err,
LastRequest: input,
}
}

if err != nil {
return nil, err
}

for _, v := range output.Addresses {
if v != nil {
addresses = append(addresses, v)
}
}

return addresses, nil
}

func FindHostByID(conn *ec2.EC2, id string) (*ec2.Host, error) {
input := &ec2.DescribeHostsInput{
HostIds: aws.StringSlice([]string{id}),
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/network_acls_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestAccEC2NetworkACLsDataSource_basic(t *testing.T) {
{
Config: testAccNetworkACLsDataSourceConfig_basic(rName),
Check: resource.ComposeTestCheckFunc(
testCheckResourceAttrGreaterThanValue(dataSourceName, "ids.#", "1"),
acctest.CheckResourceAttrGreaterThanValue(dataSourceName, "ids.#", "1"),
),
},
},
Expand Down

0 comments on commit 322647c

Please sign in to comment.