Sha256: 5155d01e73f60ffa3bbe6cc5e600ea83d1cef61e2f553b6315637e4f8bf461b8
Contents?: true
Size: 971 Bytes
Versions: 1
Compression:
Stored size: 971 Bytes
Contents
require "json" module BBC module Cosmos module Config class Cosmos attr_reader :aws_config def initialize(aws_config) @aws_config = aws_config end def stack_name @aws_config.tags["aws:cloudformation:stack-name"] end def component_name @aws_config.tags["Component"].downcase end def component_config @component_config ||= parse_component_config[:configuration] end private def parse_component_config JSON.parse(app_config_string, :symbolize_names => true) end def app_config_string File.open(config_location).read end def config_location BBC::Cosmos.production? ? cosmos_config_location : ENV["DEV_APP_CONF"] end def cosmos_config_location "/etc/#{component_name}/component_configuration.json" end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bbc-cosmos-config-0.0.4 | lib/bbc/cosmos/config/cosmos.rb |