Class: Chef::Provisioning::AzureRM::AzureResource

Inherits:
Resource::LWRPBase
  • Object
show all
Defined in:
lib/chef/provisioning/azurerm/azure_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ AzureResource

Returns a new instance of AzureResource.



8
9
10
11
12
13
14
15
16
# File 'lib/chef/provisioning/azurerm/azure_resource.rb', line 8

def initialize(*args)
  super
  return unless run_context
  @chef_environment = run_context.cheffish.current_environment
  @chef_server = run_context.cheffish.current_chef_server
  @driver = run_context.chef_provisioning.current_driver
  Chef::Log.error 'No driver set. (has it been set in your recipe using with_driver?)' unless driver
  @driver_name, @subscription_id = driver.split(':', 2)
end

Instance Attribute Details

#driverObject

Returns the value of attribute driver.



18
19
20
# File 'lib/chef/provisioning/azurerm/azure_resource.rb', line 18

def driver
  @driver
end

#driver_nameObject

Returns the value of attribute driver_name.



19
20
21
# File 'lib/chef/provisioning/azurerm/azure_resource.rb', line 19

def driver_name
  @driver_name
end

#subscription_idObject

Returns the value of attribute subscription_id.



20
21
22
# File 'lib/chef/provisioning/azurerm/azure_resource.rb', line 20

def subscription_id
  @subscription_id
end