puppetlabs-aws icon indicating copy to clipboard operation
puppetlabs-aws copied to clipboard

Error provisioning new ec2_instance (instanceInitiatedShutdownBehavior)

Open daveseff opened this issue 10 years ago • 3 comments
trafficstars

I'm getting the following error:

Error: Could not set 'present' on ensure: The attribute instanceInitiatedShutdownBehavior can only be used for elastic images. at 20:/etc/puppetlabs/puppet/environments/production/modules/infra/manifests/perf.pp

This is my puppet code :: ec2_instance { "perf-www1" : ensure => present, image_id => 'ami-b040bad8', key_name => 'Corporate', security_groups => ['perf'], subnet => 'performance-test', instance_type => 'c3.2xlarge', tags => { type => 'perf-app-server', }, user_data => template("${module_name}/app_template.erb"), }

Is this an issue with puppet, or the aws-sdk? I'm using aws-sdk-core 2.0.48

daveseff avatar Jun 09 '15 16:06 daveseff

A workaround is to add instance_initiated_shutdown_behavior => 'terminate' This works, but it would seem that this would be a required parameter, not an optional one.

daveseff avatar Jun 09 '15 17:06 daveseff

@daveseff mmm, interesting. I can't find reference to elastic images anywhere. This could be related to the instance type or to the specific image. Could I ask what the image is?

garethr avatar Jul 05 '15 21:07 garethr

This AMI happens to be a generic ubuntu 14.04 image from amazon. I suspect this error is coming from the aws ruby sdk and not this puppet module. I'm just saying that I was not able to provision the instance until I added instance_initiated_shutdown_behavior

daveseff avatar Jul 07 '15 22:07 daveseff