cfn_manage 0.8.2 → 0.8.3
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/.gitignore +8 -0
- data/.rspec +2 -0
- data/.travis.yml +20 -0
- data/Dockerfile +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +311 -0
- data/Rakefile +9 -0
- data/cfn_manage.gemspec +58 -0
- data/{bin → exe}/cfn_manage +0 -0
- data/{bin → exe}/usage.txt +0 -0
- data/lib/cfn_manage/handlers/rds.rb +10 -2
- data/lib/cfn_manage/version.rb +1 -1
- metadata +23 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43ecbbdac266b5a5b658468b6419e8851058db5dc16e1ed8a147e607237c1157
|
4
|
+
data.tar.gz: 2ad869e839f2da3af86bf7af2bb848bf82ba553f43f24ad90c78f30b0c7808aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa465fca8812fce4f2d5c464fdb5492c0a44a51c5bde5812584093c6fd7f4abebb4186f6e0f02f16997d070ae597cbd9f6335b26621377d79fa034c3873ff57e
|
7
|
+
data.tar.gz: f8ad3a5549a5b3423fcfa0f49539418d0bf59271508efd74566711ea94b63557c50c8f40989ac16fbb173f3ea9e318b1d575b507ea9912f59dea347fa97409c1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
sudo: required
|
2
|
+
dist: trusty
|
3
|
+
language: ruby
|
4
|
+
rvm:
|
5
|
+
- 2.5
|
6
|
+
before_install:
|
7
|
+
- gem install -v 2.0.2 bundler --no-document
|
8
|
+
- bundle _2.0.2_ install
|
9
|
+
script:
|
10
|
+
- bundle exec rake spec
|
11
|
+
- gem build cfn_manage.gemspec
|
12
|
+
- gem install cfn_manage-*.gem
|
13
|
+
- cfn_manage --version
|
14
|
+
deploy:
|
15
|
+
provider: rubygems
|
16
|
+
api_key: "${RUBYGEMS_API_KEY}"
|
17
|
+
gem: cfn_manage
|
18
|
+
on:
|
19
|
+
all_branches: true
|
20
|
+
condition: $TRAVIS_BRANCH =~ ^develop|master && $TRAVIS_EVENT_TYPE =~ ^push|api$ && $TRAVIS_REPO_SLUG == "base2Services/cfn-start-stop-stack"
|
data/Dockerfile
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 base2Services
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,311 @@
|
|
1
|
+
# cfn-library
|
2
|
+
|
3
|
+
[](https://travis-ci.org/base2Services/cfn-start-stop-stack)
|
4
|
+
|
5
|
+
## About
|
6
|
+
|
7
|
+
Base2Services Common Cloud Formation stacks functionality
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
- As a gem `gem install cfn_manage`
|
12
|
+
|
13
|
+
- As a docker container `docker pull base2/cfn-manage`
|
14
|
+
|
15
|
+
- Download source code `git clone https://github.com/base2Services/cfn-start-stop-stack`
|
16
|
+
|
17
|
+
## Run As Docker Container
|
18
|
+
|
19
|
+
Running cfn_manage inside a docker container means you don't have to worry about
|
20
|
+
managing the runtime environment.
|
21
|
+
|
22
|
+
```bash
|
23
|
+
docker run -ti --rm -v $HOME/.aws/credentials:/root/.aws/credentials base2/cfn-manage
|
24
|
+
```
|
25
|
+
|
26
|
+
You can also pass in additional [Environment Variables](## Environment Variables) using the `-e` flag in the run command
|
27
|
+
|
28
|
+
```bash
|
29
|
+
docker run -ti --rm -v $HOME/.aws/credentials:/root/.aws/credentials -e AWS_REGION=us-east-1 base2/cfn-manage
|
30
|
+
```
|
31
|
+
|
32
|
+
## Functionality
|
33
|
+
|
34
|
+
### Stack traversal
|
35
|
+
|
36
|
+
Used to traverse through stack and all it's substacks
|
37
|
+
|
38
|
+
### Start-stop environment functionality
|
39
|
+
|
40
|
+
Stop environment will
|
41
|
+
|
42
|
+
- Set all ASG's size to 0
|
43
|
+
- Stops RDS instances
|
44
|
+
- If RDS instance is Multi-AZ, it is converted to single-az prior it
|
45
|
+
is being stopped
|
46
|
+
- Disable CloudWatch Alarm actions
|
47
|
+
|
48
|
+
Start environment operation will
|
49
|
+
|
50
|
+
- Set all ASG's size to what was prior stop operation
|
51
|
+
- Starts ASG instances
|
52
|
+
- If ASG instance was Mutli-AZ, it is converted back to Multi-AZ
|
53
|
+
- Enable CloudWatch Alarm actions
|
54
|
+
Metadata about environment, such as number of desired/max/min instances within ASG and MultiAZ property
|
55
|
+
for rds instances, is stored in S3 bucket specified via `--source-bucket` switch or `SOURCE_BUCKET` environment
|
56
|
+
variable.
|
57
|
+
|
58
|
+
Both start and stop environment operations are idempotent, so if you run `stop-environment`
|
59
|
+
two times in a row, initial configuration of ASG will persist in S3 bucket (rather than storing 0/0/0) as ASG configuration.
|
60
|
+
Same applies for `start` operation - running it against already running environment won't perform any operations.
|
61
|
+
|
62
|
+
In case of some configuration data being lost, script will continue and work with existing data (e.g data about asgs
|
63
|
+
removed from S3, but rds data persists will results in RDS instances being started)
|
64
|
+
|
65
|
+
Order of operations is supported at this point as hardcoded weights per resource type. Pull Requests are welcome
|
66
|
+
for supporting dynamic discovery of order of execution - local configuration file override is one of
|
67
|
+
the possible sources.
|
68
|
+
|
69
|
+
|
70
|
+
## Start - stop cloudformation stack
|
71
|
+
|
72
|
+
### Supported resources
|
73
|
+
|
74
|
+
#### AWS::AutoScaling::AutoScalingGroup
|
75
|
+
|
76
|
+
**Stop** operation will set desired capacity of ASG to 0
|
77
|
+
|
78
|
+
**Start** operation will restore previous capacity
|
79
|
+
|
80
|
+
#### AWS::EC2::Instance
|
81
|
+
|
82
|
+
**Stop** operation will stop instance [using StopInstances api call](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_StopInstances.html)
|
83
|
+
|
84
|
+
**Start** operation will start instance [using StartInstances api call](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_StartInstances.html)
|
85
|
+
|
86
|
+
|
87
|
+
#### AWS::RDS::DBInstance
|
88
|
+
|
89
|
+
**Stop** operation will stop rds instance. Aurora is not supported yet on AWS side. Note that RDS instance can be stopped
|
90
|
+
for two weeks at maximum. If instance is Multi-AZ, it will get converted to Single-AZ instance, before being stopped
|
91
|
+
(Amazon does not support stopping Multi-AZ rds instances)
|
92
|
+
|
93
|
+
|
94
|
+
**Start** operation will start rds instance. If instance was running in Multi-AZ mode before being stopped,
|
95
|
+
it will get converted to Multi-AZ prior being started
|
96
|
+
|
97
|
+
#### AWS::DocDB::DBCluster
|
98
|
+
|
99
|
+
**Stop** Cluster will be stopped, note that a cluster can only be stopped for a maximum of 7 days, after this time it will turn back on.
|
100
|
+
|
101
|
+
|
102
|
+
**Start** Cluster will be started
|
103
|
+
|
104
|
+
#### AWS::CloudWatch::Alarm
|
105
|
+
|
106
|
+
**Stop** operation will disable all of alarm's actions
|
107
|
+
|
108
|
+
**Start** operation will enable all of alarm's actions
|
109
|
+
|
110
|
+
#### AWS::EC2::SpotFleet
|
111
|
+
|
112
|
+
**Stop** operation will set spot fleet target to capacity to 0
|
113
|
+
|
114
|
+
**Start** operation will restore spot fleet target to capacity to what was set prior the stack being stopped.
|
115
|
+
|
116
|
+
#### AWS::ECS::Cluster
|
117
|
+
|
118
|
+
**Stop** operation will query all services running in the cluster and set desired capacity to 0
|
119
|
+
|
120
|
+
**Start** operation will query all services assocated with the cluster restore desired capacity to what was set prior the stack being stopped.
|
121
|
+
|
122
|
+
## CLI usage
|
123
|
+
|
124
|
+
You'll find usage of `cfn_manage` within [usage.txt](bin/usage.txt) file
|
125
|
+
|
126
|
+
```
|
127
|
+
Usage: cfn_manage [command] [options]
|
128
|
+
|
129
|
+
Commands:
|
130
|
+
|
131
|
+
cfn_manage help
|
132
|
+
|
133
|
+
cfn_manage version
|
134
|
+
|
135
|
+
cfn_manage stop-environment --stack-name [STACK_NAME]
|
136
|
+
|
137
|
+
cfn_manage start-environment --stack-name [STACK_NAME]
|
138
|
+
|
139
|
+
cfn_manage stop-asg --asg-name [ASG]
|
140
|
+
|
141
|
+
cfn_manage start-asg --asg-name [ASG]
|
142
|
+
|
143
|
+
cfn_manage stop-rds --rds-instance-id [RDS_INSTANCE_ID]
|
144
|
+
|
145
|
+
cfn_manage start-rds --rds-instance-id [RDS_INSTANCE_ID]
|
146
|
+
|
147
|
+
cfn_manage stop-aurora-cluster --aurora-cluster-id [AURORA_CLUSTER_ID]
|
148
|
+
|
149
|
+
cfn_manage start-aurora-cluster --aurora-cluster-id [AURORA_CLUSTER_ID]
|
150
|
+
|
151
|
+
cfn_manage stop-docdb-cluster --docdb-cluster-id [DOCDB_CLUSTER_ID]
|
152
|
+
|
153
|
+
cfn_manage start-docdb-cluster --docdb-cluster-id [DOCDB_CLUSTER_ID]
|
154
|
+
|
155
|
+
cfn_manage stop-ec2 --ec2-instance-id [EC2_INSTANCE_ID]
|
156
|
+
|
157
|
+
cfn_manage start-ec2 --ec2-instance-id [EC2_INSTANCE_ID]
|
158
|
+
|
159
|
+
cfn_manage stop-spot-fleet --spot-fleet [SPOT_FLEET]
|
160
|
+
|
161
|
+
cfn_manage start-spot-fleet --spot-fleet [SPOT_FLEET]
|
162
|
+
|
163
|
+
cfn_manage stop-ecs-cluster --ecs-cluster [ECS_CLUSTER]
|
164
|
+
|
165
|
+
cfn_manage start-ecs-cluster --ecs-cluster [ECS_CLUSTER]
|
166
|
+
|
167
|
+
cfn_manage disable-alarm --alarm [ALARM]
|
168
|
+
|
169
|
+
cfn_manage enable-alarm --alarm [ALARM]
|
170
|
+
|
171
|
+
General options:
|
172
|
+
|
173
|
+
--source-bucket [BUCKET]
|
174
|
+
|
175
|
+
Pucket used to store / pull information from
|
176
|
+
|
177
|
+
--aws-role [ROLE_ARN]
|
178
|
+
|
179
|
+
AWS Role to assume when performing operations. Any reads and
|
180
|
+
write to source bucket will be performed outside of this role
|
181
|
+
|
182
|
+
|
183
|
+
-r [AWS_REGION], --region [AWS_REGION]
|
184
|
+
|
185
|
+
AWS Region to use when making API calls
|
186
|
+
|
187
|
+
-p [AWS_PROFILE], --profile [AWS_PROFILE]
|
188
|
+
|
189
|
+
AWS Shared profile to use when making API calls
|
190
|
+
|
191
|
+
--dry-run
|
192
|
+
|
193
|
+
Applicable only to [start|stop-environment] commands. If dry run is enabled
|
194
|
+
info about assets being started / stopped will ne only printed to standard output,
|
195
|
+
without any action taken.
|
196
|
+
|
197
|
+
--debug
|
198
|
+
|
199
|
+
Displays debug logs
|
200
|
+
|
201
|
+
--continue-on-error
|
202
|
+
|
203
|
+
Applicable only to [start|stop-environment] commands. If there is problem with stopping a resource,
|
204
|
+
(e.g. cloudformation stack not being synced or manual resource deletion) script will continue it's
|
205
|
+
operation. By default script stops when there is problem with starting/stopping resource, and expects
|
206
|
+
manual intervention to fix the root cause for failure.
|
207
|
+
|
208
|
+
--skip-wait
|
209
|
+
|
210
|
+
Skips waiting for resources to achieve stopped or started states.
|
211
|
+
|
212
|
+
--wait-async
|
213
|
+
|
214
|
+
Default wait action is to wait for each individual resource to be stopped and started before continuing.
|
215
|
+
This will enabled waiting for resources in groups based on priority. Option only useful when used with
|
216
|
+
start-environment and stop-environment commands.
|
217
|
+
|
218
|
+
--ignore-missing-ecs-config
|
219
|
+
|
220
|
+
This option is required for starting a ecs service that was stopped outside of cfn_manage.
|
221
|
+
|
222
|
+
--asg-suspend-termination
|
223
|
+
|
224
|
+
Will stop instances in the autoscaling group(s) instead of the default behaviour of termination.
|
225
|
+
|
226
|
+
--asg-wait-state
|
227
|
+
|
228
|
+
Allowed values ['HealthyInASG','Running','HealthyInTargetGroup']
|
229
|
+
Default: 'HealthyInASG'
|
230
|
+
|
231
|
+
'HealthyInASG' - waits for all instances to reach a healthy state in the asg
|
232
|
+
'Running' - waits for all instances to reach the EC2 running state
|
233
|
+
'HealthyInTargetGroup' - waits for all instances to reach a healthy state in all asg assocated target groups
|
234
|
+
|
235
|
+
--ecs-wait-state
|
236
|
+
|
237
|
+
Allowed values ['Running','HealthyInTargetGroup']
|
238
|
+
Default: 'Skip'
|
239
|
+
|
240
|
+
'Running' - waits for all ecs services in cluster to reach the running state
|
241
|
+
'HealthyInTargetGroup' - waits for all ecs services in cluster to reach a healthy state in all assocated target groups
|
242
|
+
|
243
|
+
--tags
|
244
|
+
|
245
|
+
will query resource tags for individual resource settings.
|
246
|
+
`cfn_manage:priority` for prefered starting order
|
247
|
+
will default to defined resource order if no tag is found or resource doesn't support tags
|
248
|
+
|
249
|
+
--ecs-wait-container-instances
|
250
|
+
|
251
|
+
waits for a container instance to be active in the ecs cluster before starting services
|
252
|
+
```
|
253
|
+
|
254
|
+
## Environment Variables
|
255
|
+
|
256
|
+
Also, there are some environment variables that control behaviour of the application.
|
257
|
+
There are command line switch counter parts for all of the
|
258
|
+
|
259
|
+
`AWS_ASSUME_ROLE` as env var or `--aws-role` as CLI switch
|
260
|
+
|
261
|
+
`AWS_REGION` as env car or `-r`, `--region` as CLI switch
|
262
|
+
|
263
|
+
`AWS_PROFILE` as env var or `-p`, `--profile` as CLI switch
|
264
|
+
|
265
|
+
`SOURCE_BUCKET` as env var or `--source-bucket` as CLI switch
|
266
|
+
|
267
|
+
`DRY_RUN` as env var (set to '1' to enable) or `--dry-run` as CLI switch
|
268
|
+
|
269
|
+
`IGNORE_MISSING_ECS_CONFIG` as env var (set to '1' to enable) or `--ignore-missing-ecs-config` as CLI switch
|
270
|
+
|
271
|
+
`CFN_CONTINUE_ON_ERROR` as env var (set to '1' to enable) or `--continue-on-error` as CLI switch
|
272
|
+
|
273
|
+
`SKIP_WAIT` as env var (set to '1' to enable) or `--skip-wait` as CLI switch
|
274
|
+
|
275
|
+
`WAIT_ASYNC` as env var (set to '1' to enable) or `--wait-async` as CLI switch
|
276
|
+
|
277
|
+
`ASG_SUSPEND_TERMINATION` as env var (set to '1' to enable) or `--asg-suspend-termination` as CLI switch
|
278
|
+
|
279
|
+
`CFN_TAGS` as env var (set to '1' to enable) or `--tags` as CLI switch
|
280
|
+
|
281
|
+
`ECS_WAIT_CONTAINER_INSTANCES` as env var (set to '1' to enable) or `--ecs-wait-container-instances` as CLI switch
|
282
|
+
|
283
|
+
`CFN_DEBUG` as env var (set to '1' to enable) or `--debug` as CLI switch
|
284
|
+
|
285
|
+
## AWS Resource Tags
|
286
|
+
|
287
|
+
will query resource tags for individual resource settings. please see bellow the list of resources currently supported by tags and their options.
|
288
|
+
|
289
|
+
#### AWS::AutoScaling::AutoScalingGroup'
|
290
|
+
|
291
|
+
```yaml
|
292
|
+
cfn_manage:wait_state: 'HealthyInASG'
|
293
|
+
cfn_manage:skip_wait: true
|
294
|
+
cfn_manage:suspend_termination: true
|
295
|
+
```
|
296
|
+
|
297
|
+
#### AWS::ECS::Cluster
|
298
|
+
|
299
|
+
```yaml
|
300
|
+
cfn_manage:wait_state: 'Running'
|
301
|
+
cfn_manage:skip_wait: true
|
302
|
+
cfn_manage:wait_container_instances: true
|
303
|
+
cfn_manage:ignore_missing_ecs_config: true
|
304
|
+
```
|
305
|
+
|
306
|
+
## Release process
|
307
|
+
|
308
|
+
- Bump up version `gem install bump && bump [patch|minor|major]`
|
309
|
+
- Update timestamp in `cfn_manage.gemspec`
|
310
|
+
- Create and publish gem `gem build cfn_manage.gemspec && gem push cfn_manage-$VERSION.gem`
|
311
|
+
- Create release page on GitHub
|
data/Rakefile
ADDED
data/cfn_manage.gemspec
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'cfn_manage/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'cfn_manage'
|
7
|
+
spec.version = CfnManage::VERSION
|
8
|
+
spec.summary = 'Manage AWS Cloud Formation stacks'
|
9
|
+
spec.description = 'Start and stop aws resources in a cloudformation stack'
|
10
|
+
spec.authors = ['Base2Services', 'Nikola Tosic', 'Angus Vine']
|
11
|
+
spec.homepage = 'https://github.com/base2Services/cfn-start-stop-stack/blob/master/README.md'
|
12
|
+
spec.email = 'itsupport@base2services.com'
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata["allowed_push_host"] = 'https://rubygems.org'
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/base2services/aws-client-vpn"
|
22
|
+
else
|
23
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
24
|
+
"public gem pushes."
|
25
|
+
end
|
26
|
+
|
27
|
+
# Specify which files should be added to the gem when it is released.
|
28
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
29
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
30
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
31
|
+
end
|
32
|
+
spec.bindir = "exe"
|
33
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
|
+
spec.require_paths = ["lib"]
|
35
|
+
|
36
|
+
spec.required_ruby_version = '~> 2.5'
|
37
|
+
|
38
|
+
spec.add_runtime_dependency 'aws-sdk-core', '>=3.39.0','<4'
|
39
|
+
spec.add_runtime_dependency 'aws-sdk-s3', '~> 1', '<2'
|
40
|
+
spec.add_runtime_dependency 'aws-sdk-ec2', '~> 1', '<2'
|
41
|
+
spec.add_runtime_dependency 'aws-sdk-cloudformation', '~> 1', '<2'
|
42
|
+
spec.add_runtime_dependency 'aws-sdk-rds', '>=1.31.0', '<2'
|
43
|
+
spec.add_runtime_dependency 'aws-sdk-cloudwatch', '~> 1', '<2'
|
44
|
+
spec.add_runtime_dependency 'aws-sdk-iam', '~> 1', '<2'
|
45
|
+
spec.add_runtime_dependency 'aws-sdk-autoscaling', '~> 1', '<2'
|
46
|
+
spec.add_runtime_dependency 'aws-sdk-ecs', '~> 1', '<2'
|
47
|
+
spec.add_runtime_dependency 'aws-sdk-docdb', '>=1.9.0', '<2'
|
48
|
+
spec.add_runtime_dependency 'aws-sdk-transfer', '~>1', '<2'
|
49
|
+
spec.add_runtime_dependency 'aws-sdk-elasticloadbalancingv2', '~>1', '<2'
|
50
|
+
|
51
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
52
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
53
|
+
spec.add_development_dependency "rspec", "~> 0.9"
|
54
|
+
spec.add_development_dependency "rspec-core", "~> 3.8"
|
55
|
+
spec.add_development_dependency "rspec-expectations", "~> 3.8"
|
56
|
+
spec.add_development_dependency "rspec-mocks", "~> 3.8"
|
57
|
+
spec.add_development_dependency 'simplecov', '~> 0.16'
|
58
|
+
end
|
data/{bin → exe}/cfn_manage
RENAMED
File without changes
|
data/{bin → exe}/usage.txt
RENAMED
File without changes
|
@@ -81,12 +81,20 @@ module CfnManage
|
|
81
81
|
|
82
82
|
# stop rds instance and wait for it to be fully stopped
|
83
83
|
$log.info("Stopping instance #{@instance_id}")
|
84
|
-
|
84
|
+
begin
|
85
|
+
@rds_client.stop_db_instance({ db_instance_identifier: @instance_id })
|
86
|
+
rescue Aws::RDS::Errors::InvalidDBInstanceState => e
|
87
|
+
if e.message == "Cannot stop or start a Read-Replica instance"
|
88
|
+
$log.warn("Skipping due to error: #{e.message}")
|
89
|
+
return
|
90
|
+
else
|
91
|
+
raise e
|
92
|
+
end
|
93
|
+
end
|
85
94
|
unless CfnManage.skip_wait?
|
86
95
|
$log.info("Waiting db instance to be stopped #{@instance_id}")
|
87
96
|
wait('stopped')
|
88
97
|
end
|
89
|
-
|
90
98
|
return configuration
|
91
99
|
end
|
92
100
|
|
data/lib/cfn_manage/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn_manage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Base2Services
|
8
8
|
- Nikola Tosic
|
9
9
|
- Angus Vine
|
10
10
|
autorequire:
|
11
|
-
bindir:
|
11
|
+
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk-core
|
@@ -272,14 +272,14 @@ dependencies:
|
|
272
272
|
requirements:
|
273
273
|
- - "~>"
|
274
274
|
- !ruby/object:Gem::Version
|
275
|
-
version: '
|
275
|
+
version: '13.0'
|
276
276
|
type: :development
|
277
277
|
prerelease: false
|
278
278
|
version_requirements: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
280
|
- - "~>"
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version: '
|
282
|
+
version: '13.0'
|
283
283
|
- !ruby/object:Gem::Dependency
|
284
284
|
name: rspec
|
285
285
|
requirement: !ruby/object:Gem::Requirement
|
@@ -350,15 +350,25 @@ dependencies:
|
|
350
350
|
- - "~>"
|
351
351
|
- !ruby/object:Gem::Version
|
352
352
|
version: '0.16'
|
353
|
-
description:
|
353
|
+
description: Start and stop aws resources in a cloudformation stack
|
354
354
|
email: itsupport@base2services.com
|
355
355
|
executables:
|
356
356
|
- cfn_manage
|
357
|
+
- usage.txt
|
357
358
|
extensions: []
|
358
359
|
extra_rdoc_files: []
|
359
360
|
files:
|
360
|
-
-
|
361
|
-
-
|
361
|
+
- ".gitignore"
|
362
|
+
- ".rspec"
|
363
|
+
- ".travis.yml"
|
364
|
+
- Dockerfile
|
365
|
+
- Gemfile
|
366
|
+
- LICENSE
|
367
|
+
- README.md
|
368
|
+
- Rakefile
|
369
|
+
- cfn_manage.gemspec
|
370
|
+
- exe/cfn_manage
|
371
|
+
- exe/usage.txt
|
362
372
|
- lib/cfn_manage.rb
|
363
373
|
- lib/cfn_manage/aws_credentials.rb
|
364
374
|
- lib/cfn_manage/cf_common.rb
|
@@ -380,7 +390,10 @@ files:
|
|
380
390
|
homepage: https://github.com/base2Services/cfn-start-stop-stack/blob/master/README.md
|
381
391
|
licenses:
|
382
392
|
- MIT
|
383
|
-
metadata:
|
393
|
+
metadata:
|
394
|
+
allowed_push_host: https://rubygems.org
|
395
|
+
homepage_uri: https://github.com/base2Services/cfn-start-stop-stack/blob/master/README.md
|
396
|
+
source_code_uri: https://github.com/base2services/aws-client-vpn
|
384
397
|
post_install_message:
|
385
398
|
rdoc_options: []
|
386
399
|
require_paths:
|
@@ -396,7 +409,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
396
409
|
- !ruby/object:Gem::Version
|
397
410
|
version: '0'
|
398
411
|
requirements: []
|
399
|
-
rubygems_version: 3.
|
412
|
+
rubygems_version: 3.1.3
|
400
413
|
signing_key:
|
401
414
|
specification_version: 4
|
402
415
|
summary: Manage AWS Cloud Formation stacks
|