Sha256: f71be56e8bc4cab3bf3be3fc2ba3e16ba011cabe5e47cf7feacffe25f4c92f35

Contents?: true

Size: 545 Bytes

Versions: 6

Compression:

Stored size: 545 Bytes

Contents

module TerraspacePluginAws::Interfaces::Helper
  class SSM < SecretBase
    def fetch(name)
      value = fetch_value(name)
      value = Base64.strict_encode64(value).strip if @base64
      value
    end

    def fetch_value(name)
      resp = ssm.get_parameter(name: name, with_decryption: true)
      resp.parameter.value
    rescue Aws::SSM::Errors::ParameterNotFound => e
      logger.info "WARN: name #{name} not found".color(:yellow)
      logger.info e.message
      "NOT FOUND #{name}" # simple string so tfvars valid
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
terraspace_plugin_aws-0.3.5 lib/terraspace_plugin_aws/interfaces/helper/ssm.rb
terraspace_plugin_aws-0.3.4 lib/terraspace_plugin_aws/interfaces/helper/ssm.rb
terraspace_plugin_aws-0.3.3 lib/terraspace_plugin_aws/interfaces/helper/ssm.rb
terraspace_plugin_aws-0.3.2 lib/terraspace_plugin_aws/interfaces/helper/ssm.rb
terraspace_plugin_aws-0.3.1 lib/terraspace_plugin_aws/interfaces/helper/ssm.rb
terraspace_plugin_aws-0.3.0 lib/terraspace_plugin_aws/interfaces/helper/ssm.rb