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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/cfn_status/aws_service.rb +32 -1
- data/lib/cfn_status/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b8d3f2b5eaaab5d41d434b53fdb4ed16337bac065772db5efd0da6869f03d7c
|
4
|
+
data.tar.gz: 7412b786f0ab988f2c20100222026a13fa8cd1385742efc2cc074d6bfb319925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/cfn_status/version.rb
CHANGED
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
|
+
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-
|
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
|