jflow 0.4.3 → 0.4.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 +4 -4
- data/lib/jflow/cli.rb +0 -1
- data/lib/jflow/termination_protector.rb +3 -3
- data/lib/jflow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 956d76dd7b71900c4ad74f8583f14df52fa6654d
|
4
|
+
data.tar.gz: 547c6ec4c4b1bf1decf737d5d8b9e7e008b7c85d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e444bde5d6ba6daec61b05b2b0f7881b694f042db91e8be84c24e2e4deb32211ffcdd15c231a72c59e17eea39334580abde8346ae6e55085ccf2cbb5744639ba
|
7
|
+
data.tar.gz: ea5996297a3c542d4a991c05f9dc0bd84d119c6001f64069d6c21ee45866dc5984fbff02895bfefa3383d26bda7d9629819cd0bc50f9ee6d3b3e90929c649519
|
data/lib/jflow/cli.rb
CHANGED
@@ -70,7 +70,6 @@ module JFlow
|
|
70
70
|
protector = JFlow::TerminationProtector.new
|
71
71
|
loop do
|
72
72
|
break if Thread.current.marked_for_shutdown?
|
73
|
-
JFlow.configuration.logger.debug "Should protect?: #{should_protect?}"
|
74
73
|
protector.set_protection(should_protect?) if is_ec2_instance?
|
75
74
|
stats.tick if enable_stats
|
76
75
|
sleep 30
|
@@ -18,7 +18,7 @@ module JFlow
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def get_asg_name
|
21
|
-
ec2_client = Aws::EC2::Client.new(region: region)
|
21
|
+
ec2_client = Aws::EC2::Client.new(region: region, credentials: Aws::InstanceProfileCredentials.new)
|
22
22
|
instance_tags = ec2_client.describe_tags(filters: [
|
23
23
|
{
|
24
24
|
name: "resource-id",
|
@@ -32,9 +32,9 @@ module JFlow
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def set_protection(protect_status)
|
35
|
-
JFlow.configuration.logger.debug "Setting termination protection status to #{protect_status} for instance #{
|
35
|
+
JFlow.configuration.logger.debug "Setting termination protection status to #{protect_status} for instance #{instance_id} in region #{region}"
|
36
36
|
begin
|
37
|
-
asg_client = Aws::AutoScaling::Client.new(region: region)
|
37
|
+
asg_client = Aws::AutoScaling::Client.new(region: region, credentials: Aws::InstanceProfileCredentials.new)
|
38
38
|
asg_client.set_instance_protection({
|
39
39
|
instance_ids: [instance_id],
|
40
40
|
auto_scaling_group_name: get_asg_name,
|
data/lib/jflow/version.rb
CHANGED