Class: TerraspacePluginAzurerm::Interfaces::Expander
- Inherits:
-
Object
- Object
- TerraspacePluginAzurerm::Interfaces::Expander
- Includes:
- Terraspace::Plugin::Expander::Interface
- Defined in:
- lib/terraspace_plugin_azurerm/interfaces/expander.rb
Instance Method Summary collapse
- #app_hash ⇒ Object
- #azure_info ⇒ Object
- #env_hash ⇒ Object
-
#location_hash ⇒ Object
(also: #region_hash)
location_hash is a short 4-char consistent hash of the longer subscription id.
-
#subscription_hash ⇒ Object
(also: #namespace_hash)
subscription_hash is a short 4-char consistent hash of the longer subscription id.
Instance Method Details
#app_hash ⇒ Object
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_info ⇒ Object
21 22 23 |
# File 'lib/terraspace_plugin_azurerm/interfaces/expander.rb', line 21 def azure_info AzureInfo end |
#env_hash ⇒ Object
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_hash ⇒ Object 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_hash ⇒ Object 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 |