Sha256: b082fa9172a1d2a8ba0f93c928192c4b96a6d720f28a2a420497766d720b51e2

Contents?: true

Size: 639 Bytes

Versions: 7

Compression:

Stored size: 639 Bytes

Contents

require "aws-sdk-ssm"

module Codepipe::Dsl
  module Ssm
    # This method grabs the ssm parameter store value at "compile" time vs
    # CloudFormation run time. In case we need it as part of the DSL compile phase.
    def ssm(name)
      resp = ssm_client.get_parameter(name: name)
      if resp.parameter.type == "SecureString"
        resp = ssm_client.get_parameter(name: name, with_decryption: true)
      end

      resp.parameter.value
    rescue Aws::SSM::Errors::ParameterNotFound
      puts "WARN: #{name} found on AWS SSM.".color(:yellow)
    end

    def ssm_client
      @ssm_client ||= Aws::SSM::Client.new
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
codepipeline-0.3.4 lib/codepipe/dsl/ssm.rb
codepipeline-0.3.3 lib/codepipe/dsl/ssm.rb
codepipeline-0.3.2 lib/codepipe/dsl/ssm.rb
codepipeline-0.3.1 lib/codepipe/dsl/ssm.rb
codepipeline-0.3.0 lib/codepipe/dsl/ssm.rb
codepipeline-0.2.1 lib/codepipe/dsl/ssm.rb
codepipeline-0.2.0 lib/codepipe/dsl/ssm.rb