diff --git a/drivers/amazonec2/amazonec2.go b/drivers/amazonec2/amazonec2.go index b82a9f42a3754d8a0551b39f374c8bb43e6c63fd..9f50c25d3b5496e95a7aa3007568b1aa0c0fe963 100644 --- a/drivers/amazonec2/amazonec2.go +++ b/drivers/amazonec2/amazonec2.go @@ -1121,28 +1121,29 @@ func (d *Driver) createTagSpecifications() []*ec2.TagSpecification { } } - tagSpecification := []*ec2.TagSpecification{ - { - ResourceType: aws.String("volume"), - Tags: tags, - }, - { - ResourceType: aws.String("network-interface"), - Tags: tags, - }, - } - if d.RequestSpotInstance { - return append(tagSpecification, &ec2.TagSpecification{ - ResourceType: aws.String("spot-instances-request"), - Tags: tags, - }) + return []*ec2.TagSpecification{ + { + ResourceType: aws.String("spot-instances-request"), + Tags: tags, + }, + } + } else { + return []*ec2.TagSpecification{ + { + ResourceType: aws.String("instance"), + Tags: tags, + }, + { + ResourceType: aws.String("volume"), + Tags: tags, + }, + { + ResourceType: aws.String("network-interface"), + Tags: tags, + }, + } } - - return append(tagSpecification, &ec2.TagSpecification{ - ResourceType: aws.String("instance"), - Tags: tags, - }) } func (d *Driver) getTagResources() []*string {