Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

aws_instances tag_specifications fails to create a valid tag  #3

Description

@gregohardy

What you expected to happen?

$tag = [{ key => 'Name', value => 'splunk-greghardy-pe-master'}, {key => lifetime , value => '1m'}]

aws_instances { $instance_name:
ensure => 'present',
image_id => 'ami-0ff760d16d9497662',
min_count => 1,
max_count => 1,
key_name => $key_name,
instance_type => 'm4.large',
subnet_id => $subnet_id,
tag_specifications => [ { resource_type => 'instance', tags => $tag } ]
}

Should have resulted in a tag getting applied to the instance.

What happened?

Error: aws_instances[{:name=>"splunk-greghardy-pe-master", :key_name=>"gregohardy"}]: Creating: Failed after 0.993813 seconds: expected params[:tags][0][:value] to be a String, got value {:name=>"splunk-greghardy-pe-master", :key_name=>"gregohardy"} (class: Puppet::ResourceApi::MonkeyHash) instead.

How to reproduce it?

Run the above manifest once you have created a vpc and subnet.

Anything else we need to know?

The bug is specifically in the create

This is creating a hash and not just the string we need for the value.

This is debug I injected in the context to check the name, this should not include the key_name? and just be a string with the name
:::: tag name is {:name=>"splunk-greghardy-pe-master", :key_name=>"gregohardy"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions