Class: Chef::Provider::AwsElasticsearchDomain

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

Constant Summary

Constants inherited from Chef::Provisioning::AWSDriver::AWSProvider

Chef::Provisioning::AWSDriver::AWSProvider::AWSResource

Instance Attribute Summary

Attributes inherited from Chef::Provisioning::AWSDriver::AWSProvider

#purging

Instance Method Summary collapse

Methods inherited from Chef::Provisioning::AWSDriver::AWSProvider

#action_handler, #converge_by, #region, #whyrun_supported?

Instance Method Details

#aws_taggerObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/chef/provider/aws_elasticsearch_domain.rb', line 28

def aws_tagger
  @aws_tagger ||= begin
                    strategy = Chef::Provisioning::AWSDriver::TaggingStrategy::Elasticsearch.new(
                      es_client,
                      new_resource.aws_object.arn,
                      new_resource.aws_tags
                    )
                    Chef::Provisioning::AWSDriver::AWSTagger.new(strategy, action_handler)
                  end
end

#converge_tagsObject



39
40
41
# File 'lib/chef/provider/aws_elasticsearch_domain.rb', line 39

def converge_tags
  aws_tagger.converge_tags
end

#create_aws_objectObject



7
8
9
10
11
# File 'lib/chef/provider/aws_elasticsearch_domain.rb', line 7

def create_aws_object
  converge_by "create Elasticsearch domain #{new_resource.domain_name}" do
    es_client.create_elasticsearch_domain(update_payload)
  end
end

#destroy_aws_object(_domain) ⇒ Object



13
14
15
16
17
# File 'lib/chef/provider/aws_elasticsearch_domain.rb', line 13

def destroy_aws_object(_domain)
  converge_by "destroy Elasticsearch domain #{new_resource.domain_name}" do
    es_client.delete_elasticsearch_domain(domain_name: new_resource.domain_name)
  end
end

#update_aws_object(domain) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/chef/provider/aws_elasticsearch_domain.rb', line 19

def update_aws_object(domain)
  updates = required_updates(domain)
  unless updates.empty?
    converge_by updates do
      es_client.update_elasticsearch_domain_config(update_payload)
    end
  end
end