aws-cft-tools 0.1.3 → 0.1.4
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 +5 -5
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +6 -0
- data/code.json +2 -2
- data/lib/aws_cft_tools/client/cft/stack_management.rb +39 -5
- data/lib/aws_cft_tools/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4499923dca2675cb102a60ef38f7d4d82e16b83e1994f1455ad261b01f2f43a2
|
4
|
+
data.tar.gz: a15745bcf5f20afa876b6d2d4a224dc28f5771ae7a8c4ed9c05dd1a18eff1386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aaa1c95c70812853480948df86c02904ece394d86c49ddb966376deb88a7ad0fdba95305be643a405b44b3a1c3b1a43b982a927985141660ee1cb2c7623ca51
|
7
|
+
data.tar.gz: 4264f299d6fbf7cfa0266000d0f6e3fff512861cc78ce43f7c41986ce52c373db764760f440a568b6f222cba6ebc9796ee5c0447a7f38fb1f5b791c4b6cb343a
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/code.json
CHANGED
@@ -8,10 +8,10 @@
|
|
8
8
|
"repositoryURL": "https://github.com/USSBA/aws-cft-tools",
|
9
9
|
"description": "Command line tools to ease management of AWS infrastructure through CloudFormation",
|
10
10
|
"permissions": {
|
11
|
-
"
|
11
|
+
"licenses": [{
|
12
12
|
"name": "Apache v2",
|
13
13
|
"URL": "https://www.apache.org/licenses/LICENSE-2.0"
|
14
|
-
},
|
14
|
+
}],
|
15
15
|
"usageType": "openSource",
|
16
16
|
"exemptionText": null
|
17
17
|
},
|
@@ -23,7 +23,14 @@ module AwsCftTools
|
|
23
23
|
# @param template [AwsCftTools::Template]
|
24
24
|
#
|
25
25
|
def update_stack(template)
|
26
|
-
|
26
|
+
throttle_backoff = 0
|
27
|
+
begin
|
28
|
+
aws_client.update_stack(update_stack_params(template))
|
29
|
+
rescue Aws::CloudFormation::Errors::Throttling
|
30
|
+
throttle_backoff += 0.5
|
31
|
+
sleep 2**throttle_backoff
|
32
|
+
retry
|
33
|
+
end
|
27
34
|
# we want to wait for the update to complete before we proceed
|
28
35
|
wait_for_stack_operation(:stack_update_complete, template.name)
|
29
36
|
rescue Aws::CloudFormation::Errors::ValidationError => exception
|
@@ -37,7 +44,14 @@ module AwsCftTools
|
|
37
44
|
# @param template [AwsCftTools::Template]
|
38
45
|
#
|
39
46
|
def create_stack(template)
|
40
|
-
|
47
|
+
throttle_backoff = 0
|
48
|
+
begin
|
49
|
+
aws_client.create_stack(create_stack_params(template))
|
50
|
+
rescue Aws::CloudFormation::Errors::Throttling
|
51
|
+
throttle_backoff += 0.5
|
52
|
+
sleep 2**throttle_backoff
|
53
|
+
retry
|
54
|
+
end
|
41
55
|
# we want to wait for the create to complete before we proceed
|
42
56
|
wait_for_stack_operation(:stack_create_complete, template.name)
|
43
57
|
end
|
@@ -49,15 +63,35 @@ module AwsCftTools
|
|
49
63
|
# @param template [AwsCftTools::Template]
|
50
64
|
#
|
51
65
|
def delete_stack(template)
|
52
|
-
|
53
|
-
|
66
|
+
throttle_backoff = 0
|
67
|
+
begin
|
68
|
+
aws_client.delete_stack(delete_stack_params(template))
|
69
|
+
rescue Aws::CloudFormation::Errors::Throttling
|
70
|
+
throttle_backoff += 0.5
|
71
|
+
sleep 2**throttle_backoff
|
72
|
+
retry
|
73
|
+
end
|
74
|
+
begin
|
75
|
+
aws_client.wait_until(:stack_delete_complete, stack_name: template.name)
|
76
|
+
rescue Aws::CloudFormation::Errors::Throttling
|
77
|
+
throttle_backoff += 0.5
|
78
|
+
sleep 2**throttle_backoff
|
79
|
+
retry
|
80
|
+
end
|
54
81
|
end
|
55
82
|
|
56
83
|
private
|
57
84
|
|
58
85
|
def wait_for_stack_operation(op, stack_name, times_waited = 0)
|
59
86
|
times_waited += 1
|
60
|
-
|
87
|
+
throttle_backoff = 0
|
88
|
+
begin
|
89
|
+
aws_client.wait_until(op, stack_name: stack_name)
|
90
|
+
rescue Aws::CloudFormation::Errors::Throttling
|
91
|
+
throttle_backoff += 0.5
|
92
|
+
sleep 2**throttle_backoff
|
93
|
+
retry
|
94
|
+
end
|
61
95
|
rescue Aws::Waiters::Errors::FailureStateError
|
62
96
|
raise_if_too_many_retries(stack_name, times_waited)
|
63
97
|
sleep(2**times_waited + 1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-cft-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Small Business Administration
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
version: '0'
|
317
317
|
requirements: []
|
318
318
|
rubyforge_project:
|
319
|
-
rubygems_version: 2.
|
319
|
+
rubygems_version: 2.7.7
|
320
320
|
signing_key:
|
321
321
|
specification_version: 4
|
322
322
|
summary: Tools for managing CloudFormation Templates
|