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
|
context.creating(name) do |
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"}
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
puppetlabs-amazon_aws/lib/puppet/provider/aws_instances/aws_instances.rb
Line 183 in 8087479
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"}