简体   繁体   中英

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. eg 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'

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM