Address PR feedback on #194

This commit is contained in:
Luke Hoban 2017-06-03 14:47:27 -07:00
parent ee987c9961
commit 9f4d48b8f8
2 changed files with 11 additions and 7 deletions

View file

@ -174,6 +174,8 @@ func (p *instanceProvider) Get(ctx context.Context, id resource.ID) (*ec2.Instan
secgrpIDs = &ids
}
var instanceTags *[]ec2.Tag
if len(inst.Tags) > 0 {
var tags []ec2.Tag
for _, tag := range inst.Tags {
tags = append(tags, ec2.Tag{
@ -181,6 +183,8 @@ func (p *instanceProvider) Get(ctx context.Context, id resource.ID) (*ec2.Instan
Value: aws.StringValue(tag.Value),
})
}
instanceTags = &tags
}
instanceType := ec2.InstanceType(aws.StringValue(inst.InstanceType))
return &ec2.Instance{
@ -193,7 +197,7 @@ func (p *instanceProvider) Get(ctx context.Context, id resource.ID) (*ec2.Instan
PublicDNSName: inst.PublicDnsName,
PrivateIP: inst.PrivateIpAddress,
PublicIP: inst.PublicIpAddress,
Tags: &tags,
Tags: instanceTags,
}, nil
}