Sha256: 2376ef1b8979af18865635c8d815a3671f3cd424ef3405988118ebd4e7ef8ea3
Contents?: true
Size: 1.08 KB
Versions: 5
Compression:
Stored size: 1.08 KB
Contents
module TerraspaceBundler class Terrafile include Singleton extend Memoist include TB::Util::Logging # dsl meta example: # {:global=>{:org=>"boltopspro"}, # :mods=> # [{:args=>["eks"], :options=>{:source=>"terraform-aws-eks"}}, # {:args=>["vpc"], :options=>{:source=>"terraform-aws-vpc"}}]} def mods TB.dsl.meta[:mods].map do |params| new_mod(params) end end memoize :mods def new_mod(params) props = Mod::PropsBuilder.new(params).build Mod.new(props) end # Checks if any of the mods defined in Terrafile has an inferred an org # In this case the org must be set # When a source is set with an inferred org and org is not set it looks like this: # # dsl.meta has {:source=>"terraform-random-pet"} # mod.source is /terraform-random-pet # # Using info to detect that the org is missing and the Terrafile definition # has at least one mod line that has an inferred org. # def missing_org? !!mods.detect { |mod| mod.source.starts_with?('/') } end end end
Version data entries
5 entries across 5 versions & 1 rubygems