diff --git a/.rubocop.yml b/.rubocop.yml index e3cf91c..01cd170 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ --- AllCops: - TargetRubyVersion: 2.1 + TargetRubyVersion: 2.3 Metrics/LineLength: Max: 140 diff --git a/README.md b/README.md index f50d75e..994ca85 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ And then execute: ### CLI -After installation, 2 executeable scripts will be installed: `smps` & `smps-cli`: +After installation, 2 executable scripts will be installed: `smps` & `smps-cli`: - smps: the simple version of this utility. - smps-cli: The thor cli executable offers a different interface. @@ -122,10 +122,12 @@ Set the parameter to this value ## Development -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +After checking out the repo, run `./bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +To test the `smps` utility on your local machine, run `bundle exec smps --help` to see command-line options. + ## Contributing We use git flow in this project. To create your pull request, you can either use the git-flow helper or diff --git a/Rakefile b/Rakefile index 2d5637f..e8a19a4 100644 --- a/Rakefile +++ b/Rakefile @@ -43,9 +43,9 @@ end desc 'Tags version, pushes to remote, and pushes gem' task release: :build do sh 'git', 'tag', '-m', changelog, "v#{SmPs::VERSION}" - #sh 'git push origin master' - #sh "git push origin v#{SmPs::VERSION}" - #sh 'ls pkg/*.gem | xargs -n 1 gem push' + # sh 'git push origin master' + # sh "git push origin v#{SmPs::VERSION}" + # sh 'ls pkg/*.gem | xargs -n 1 gem push' end task doc: :yard diff --git a/changelog.md b/changelog.md index b456254..6efb987 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,12 @@ Version format based on http://semver.org/ ## [Unreleased] +## [0.5.4] - 2021-09-17 + +### Changed + +- Added automatic client side throttling to avoid Aws::SSM::Errors::ThrottlingException. + ## [0.5.3] - 2020-04-01 ### Changed diff --git a/lib/smps/client.rb b/lib/smps/client.rb index 9f67bd7..c7639e2 100644 --- a/lib/smps/client.rb +++ b/lib/smps/client.rb @@ -9,7 +9,7 @@ module SmPs # Allows querying and writing Paramstore parameters. class Client def initialize(options = {}) - @credentials = options[:credentials] + @options = options @parameters = {} end @@ -90,11 +90,11 @@ def store_parameters(params) # end def initialize_ssm_client - if @credentials.nil? - Aws::SSM::Client.new - else - Aws::SSM::Client.new(credentials: @credentials) - end + # see https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SSM/Client.html#initialize-instance_method + all_options = @options.merge(max_attempts: 10, + retry_mode: 'adaptive') + # puts all_options + Aws::SSM::Client.new(all_options) end end end diff --git a/lib/smps/version.rb b/lib/smps/version.rb index 78f4a95..3333f87 100644 --- a/lib/smps/version.rb +++ b/lib/smps/version.rb @@ -2,5 +2,5 @@ module SmPs # Current version. - VERSION = '0.5.3' + VERSION = '0.5.4' end diff --git a/smps.gemspec b/smps.gemspec index 425a138..024420e 100644 --- a/smps.gemspec +++ b/smps.gemspec @@ -37,5 +37,5 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'aws-sdk-core', '> 3.0' spec.add_runtime_dependency 'aws-sdk-ssm', '> 1.0' - spec.required_ruby_version = '>= 2.1' + spec.required_ruby_version = '>= 2.3' end