How to check the whether elastic ip is already associated or not?

Hi Chefellas!

I’ve the following aws resource in my recipe.

aws_elastic_ip “eip_product” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip eip
action :associate
end

But what I want is a conditional guard like only_if, not_if, etc…

So, if the elastic ip already attached, I don’t want to try it to reattach. Something like not_if { associated }

I looked inside the aws cookbook, but couldn’t find anything?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

i think the resource is already idempotent.

On Tue, May 29, 2012 at 11:13 PM, Sachin Sagar Rai millisami@gmail.comwrote:

Hi Chefellas!

I've the following aws resource in my recipe.

aws_elastic_ip "eip_product" do
aws_access_key aws['aws_access_key_id']
aws_secret_access_key aws['aws_secret_access_key']
ip eip
action :associate
end

But what I want is a conditional guard like only_if, not_if, etc...

So, if the elastic ip already attached, I don't want to try it to
reattach. Something like not_if { associated }

I looked inside the aws cookbook, but couldn't find anything?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow http://www.sparrowmailapp.com/?sig