Class: Chef::Resource::AwsCloudwatchAlarm

Inherits:
Provisioning::AWSDriver::AWSResource show all
Includes:
Provisioning::AWSDriver::AWSTaggable
Defined in:
lib/chef/resource/aws_cloudwatch_alarm.rb

Constant Summary

Constants inherited from Provisioning::AWSDriver::AWSResource

Provisioning::AWSDriver::AWSResource::NOT_PASSED

Instance Method Summary collapse

Methods included from Provisioning::AWSDriver::AWSTaggable

included

Methods inherited from Provisioning::AWSDriver::AWSResource

#action, #action=, attribute, aws_id_attribute, aws_id_prefix, #aws_object_id, aws_option_handlers, aws_sdk_class, aws_sdk_class_id, aws_sdk_option_name, aws_sdk_type, get_aws_object, get_aws_object_id, #initialize, lookup_options

Methods inherited from Provisioning::AWSDriver::SuperLWRP

#_pv_is, attribute, lazy

Constructor Details

This class inherits a constructor from Chef::Provisioning::AWSDriver::AWSResource

Instance Method Details

#aws_objectObject



25
26
27
28
29
30
31
32
33
# File 'lib/chef/resource/aws_cloudwatch_alarm.rb', line 25

def aws_object
  # TODO exists? isn't defined yet
  # https://github.com/aws/aws-sdk-ruby/issues/1171
  a = driver.cloudwatch_resource.alarm(name)
  return nil if a.data.nil?
  a
rescue ::Aws::CloudWatch::Errors::NoSuchEntity
  nil
end