- From: "John E. Vincent (lusis)" <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: Managing an ec2 instance and security group together with chef?
- Date: Tue, 20 Sep 2011 11:15:51 -0400
On Tue, Sep 20, 2011 at 11:03 AM, Peter Norton
<
>
wrote:
>
>
def run
>
$stdout.sync = true
>
>
secgroup_def = { :name => config[:name], :description =>
>
config[:description], :ip_permissions => nil, :owner_id => nil }
>
>
>
conn = Fog::Compute.new(
>
:provider => 'AWS',
>
:aws_access_key_id => Chef::Config[:knife][:aws_access_key_id],
>
:aws_secret_access_key =>
>
Chef::Config[:knife][:aws_secret_access_key],
>
:region => locate_config_value(:region)
>
)
>
# conn = connection.create()
>
secgroup = conn.security_groups.new(secgroup_def)
>
Works fine for me. The only thing I see you missing is a call to:
secgroup.save
You can also omit the :ip_permissions => nil, :owner_id => nil parts
>
Does anyone know of a place I can look for an example of how to do
>
this? I don't want to spend much more time on this now, and I'm
>
pretty sure I can do this in python+boto in about an hour, but I'd
>
prefer to not have to write yet another tool.
>
>
-Peter
[chef] Getting my node's ip address, Geoff Meakin Acid, 09/19/2011
Archive powered by MHonArc 2.6.16.