rubyamazon-web-servicesaws-sdkssmaws-parameter-store

Getting data from AWS SSM Parameter Store in ruby script using aws-sdk-v1


I'm trying to get the secrets from SSM Parameter store. The issue is we're on aws-sdk-v1 (ruby). For V2, V3 I can get plenty of examples, but not for V1. e.g. code snippet for aws-sdk--v2.

  ssm_client = Aws::SSM::Client.new(
      region: region
  )

  param_response = ssm_client.get_parameter(
      name: parameter_id,
      with_decryption: true
  ).to_h

Do anyone know how to do it if I'm on aws-sdk-v1.

PS: Upgrading from aws-sdk V1 to V2/V3 is not the viable options, please suggest considering the solution should run on aws-sdk-v1. Ruby version: '1.9.3'


Solution

  • SSM is already present in the aws-sdk-v1. There was a dependency issue in my Gemfile. I was using aws-sdk-resources ~> 3, which is fundamentally incompatible with aws-sdk ~> 1.