pointer bug fix
This commit is contained in:
parent
d8bccb81a9
commit
377dc47eac
@ -77,11 +77,11 @@ func PrintInstanceInfo(instance *types.Instance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Instances returns all instances for a config i.e. a region
|
// Instances returns all instances for a config i.e. a region
|
||||||
func Instances(config aws.Config) ([]*types.Instance, error) {
|
func Instances(config aws.Config) ([]types.Instance, error) {
|
||||||
svc := ec2.NewFromConfig(config)
|
svc := ec2.NewFromConfig(config)
|
||||||
|
|
||||||
input := &ec2.DescribeInstancesInput{}
|
input := &ec2.DescribeInstancesInput{}
|
||||||
var instances []*types.Instance
|
var instances []types.Instance
|
||||||
|
|
||||||
paginator := ec2.NewDescribeInstancesPaginator(svc, input)
|
paginator := ec2.NewDescribeInstancesPaginator(svc, input)
|
||||||
|
|
||||||
@ -93,10 +93,9 @@ func Instances(config aws.Config) ([]*types.Instance, error) {
|
|||||||
|
|
||||||
for _, reservation := range page.Reservations {
|
for _, reservation := range page.Reservations {
|
||||||
for _, instance := range reservation.Instances {
|
for _, instance := range reservation.Instances {
|
||||||
instances = append(instances, &instance)
|
instances = append(instances, instance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return instances, nil
|
return instances, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user