Class: TerraspacePluginAzurerm::Interfaces::Expander

Inherits:
Object
  • Object
show all
Includes:
Terraspace::Plugin::Expander::Interface
Defined in:
lib/terraspace_plugin_azurerm/interfaces/expander.rb

Instance Method Summary collapse

Instance Method Details

#app_hashObject



41
42
43
# File 'lib/terraspace_plugin_azurerm/interfaces/expander.rb', line 41

def app_hash
  Digest::SHA1.hexdigest(ENV['TS_APP'])[0..3] if ENV['TS_APP']
end

#azure_infoObject



21
22
23
# File 'lib/terraspace_plugin_azurerm/interfaces/expander.rb', line 21

def azure_info
  AzureInfo
end

#env_hashObject



45
46
47
# File 'lib/terraspace_plugin_azurerm/interfaces/expander.rb', line 45

def env_hash
  Digest::SHA1.hexdigest(ENV['TS_ENV'])[0..3] if ENV['TS_ENV']
end

#location_hashObject Also known as: region_hash

location_hash is a short 4-char consistent hash of the longer subscription id. This is useful because azure storage account names are not allowed special characters and are limited to 24 chars. NOTE: be careful to not change this! or else state path will change



36
37
38
# File 'lib/terraspace_plugin_azurerm/interfaces/expander.rb', line 36

def location_hash
  Digest::SHA1.hexdigest(location)[0..3]
end

#subscription_hashObject Also known as: namespace_hash

subscription_hash is a short 4-char consistent hash of the longer subscription id. This is useful because azure storage account names are not allowed special characters and are limited to 24 chars. NOTE: be careful to not change this! or else state path will change



28
29
30
# File 'lib/terraspace_plugin_azurerm/interfaces/expander.rb', line 28

def subscription_hash
  Digest::SHA1.hexdigest(subscription)[0..3]
end