class SparkleFormation::Resources::Azure

Azure specific resources collection

Constants

RESOURCE_TYPE_NAMESPACE_SPLITTER

String to split for resource namespacing

RESOURCE_TYPE_TR

Characters to be removed from supplied key on matching

Public Class Methods

included(_klass) click to toggle source

Auto load data when included

# File lib/sparkle_formation/resources/azure.rb, line 35
def included(_klass)
  load!
end
load!() click to toggle source

Load the builtin AWS resources

@return [TrueClass]

# File lib/sparkle_formation/resources/azure.rb, line 22
def load!
  memoize(:azure_resources, :global) do
    load(
      File.join(
        File.dirname(__FILE__),
        "azure_resources.json"
      )
    )
    true
  end
end
resource_customizer(struct, lookup_key) click to toggle source

Automatically add api version information and location if required by resource and not provided

@param struct [SparkleStruct] @param lookup_key [String] @return [SparkleStruct]

# File lib/sparkle_formation/resources/azure.rb, line 45
def resource_customizer(struct, lookup_key)
  info = registry[lookup_key]
  if info[:required].include?("apiVersion") && struct.api_version.nil?
    struct.api_version info[:api_version]
  end
  if info[:required].include?("location") && struct.location.nil?
    struct.location struct.resource_group!.location
  end
  struct
end