cfn-status 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81771e2b6dbaf3b2110fef3f54f45b311a0f99ba3e21f33995260c48a10ccf20
4
- data.tar.gz: e39669027cf91efb0a14f8f8f0b365b130008a42b90bd3c57ecbd20ad29328c3
3
+ metadata.gz: 7b8d3f2b5eaaab5d41d434b53fdb4ed16337bac065772db5efd0da6869f03d7c
4
+ data.tar.gz: 7412b786f0ab988f2c20100222026a13fa8cd1385742efc2cc074d6bfb319925
5
5
  SHA512:
6
- metadata.gz: 53506afafeefe75a51d71352192b64ffed381688d837a61147d4477dacc1c0ff1b89cc4ff1f9858392d0df9aa7eeddd62c4e30c5e5ee5756698d8f37c775c8fb
7
- data.tar.gz: 38c5745c0faec6144f50135c1d7b392ed45b00d140d17623d76846dd49fe03db1eca213a093ceb3ebcd3fde03a7dee905538a5b6721c6053af8982dc4d6e27f2
6
+ metadata.gz: 1b32d13db397770b601204ec8c9dcc33d28c0f7671863d84a8e3e225adfd2feb5674eba8ff06e808cb8399f5452e3fb9b3d9f267cc4b90288da0e02c16ea5604
7
+ data.tar.gz: 97dfb7f30531b3269c255af4d892e4c67084cc6c21670adc43efa48c5927088317983fdfe00888ee29a5a3395fbfb3c162c632aba34470aa67b7b1056875b6aa
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely* adheres to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.4.5] - 2022-02-20
7
+ - [#5](https://github.com/tongueroo/cfn-status/pull/5) cfn-status retry options
8
+
6
9
  ## [0.4.4] - 2022-02-14
7
10
  - more generic time took message
8
11
 
@@ -3,7 +3,7 @@ require "aws-sdk-cloudformation"
3
3
  class CfnStatus
4
4
  module AwsService
5
5
  def cfn
6
- @cfn ||= Aws::CloudFormation::Client.new
6
+ @cfn ||= Aws::CloudFormation::Client.new(aws_options)
7
7
  end
8
8
 
9
9
  def stack_exists?(stack_name)
@@ -47,5 +47,36 @@ class CfnStatus
47
47
  def rollback_complete?(stack)
48
48
  stack&.stack_status == 'ROLLBACK_COMPLETE'
49
49
  end
50
+
51
+ # Override the AWS retry settings.
52
+ #
53
+ # The aws-sdk-core has exponential backup with this formula:
54
+ #
55
+ # 2 ** c.retries * c.config.retry_base_delay
56
+ #
57
+ # Source:
58
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb
59
+ #
60
+ # So the max delay will be 2 ** 7 * 0.6 = 76.8s
61
+ #
62
+ # Only scoping this to deploy because dont want to affect people's application that use the aws sdk.
63
+ #
64
+ # There is also additional rate backoff logic elsewhere, since this is only scoped to deploys.
65
+ #
66
+ # Useful links:
67
+ # https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb
68
+ # https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html
69
+ #
70
+ def aws_options
71
+ options = {
72
+ retry_limit: 7, # default: 3
73
+ retry_base_delay: 0.6, # default: 0.3
74
+ }
75
+ options.merge!(
76
+ log_level: :debug,
77
+ logger: Logger.new($stdout),
78
+ ) if ENV['CFN_STATUS_DEBUG_AWS_SDK']
79
+ options
80
+ end
50
81
  end
51
82
  end
@@ -1,3 +1,3 @@
1
1
  class CfnStatus
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-14 00:00:00.000000000 Z
11
+ date: 2022-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudformation