Usage of aws module from resource abstraction layer

asked 2016-03-03 07:12:19 -0600

szemlyanoy gravatar image

Hey folks,

How you guys maintain you ec2 instances using aws module from command line? I intend to rely on RAL or mco to be able to provision instances on demand, without declaring them in puppet/hiera at all. I want to let my build server to execute command like

puppet resource ec2_instance <hostname> ensure=present =<value>

so it could take defaults(ami, region etc) from hiera and kick few build instances with unique hostnames.

I faced with some issues here: not all params can be passed from command line, namely userdata, blockdevices

puppet resource ec2instance someinstance ensure=present region=eu-central-1 imageid=xxxxx securitygroups='xxxxx' subnet=xxxxx instancetype=m3.medium blockdevices=[{'deleteontermination':'true', 'volumesize':10, 'devicename':'/dev/sda'}] Error: Could not run: Invalid parameter setting volumesize:10,

seems its not possible to pass hash to 'puppet resource'

Any thoughts on how I can these attributes or how to force usage of defaults from hiera?

Much appreciated, Sergey

edit retag flag offensive close merge delete

Comments

https://github.com/example42/puppi You could use a tool like puppi to manage the module in a language closer to the puppet dsl You also could have a manifest that you run with puppet apply, and pass in a specific hieraconfig to pick your data

DarylW gravatar imageDarylW ( 2016-03-04 21:47:00 -0600 )edit