Class: Chef::Provider::AwsInstance

Inherits:
Chef::Provisioning::AWSDriver::AWSProvider
  • Object
show all
Defined in:
lib/chef/provider/aws_instance.rb

Instance Method Summary collapse

Instance Method Details

#create_aws_object(instance) ⇒ Object



4
# File 'lib/chef/provider/aws_instance.rb', line 4

def create_aws_object(instance); end

#destroy_aws_object(instance) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/chef/provider/aws_instance.rb', line 8

def destroy_aws_object(instance)
  message = "delete instance #{new_resource}"
  message += " in VPC #{instance.vpc.id}" unless instance.vpc.nil?
  message += " in #{region}"
  converge_by message do
    instance.delete
  end
  converge_by "waited until instance #{new_resource} is :terminated" do
    # When purging, we must wait until the instance is fully terminated - thats the only way
    # to delete the network interface that I can see
    wait_for_status(instance, :terminated, [AWS::EC2::Errors::InvalidInstanceID::NotFound])
  end
end

#update_aws_object(instance) ⇒ Object



6
# File 'lib/chef/provider/aws_instance.rb', line 6

def update_aws_object(instance); end