MovableInkAWS 2.9.2 → 2.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd541e2c6c70b23a168dbaf65963f4f05dd8ea8f08e0ff110e55649525590fec
4
- data.tar.gz: add03a4f9390d395a50c58a76ab122b6e59a083d7dd9b70b174b4950e21089e9
3
+ metadata.gz: cab1b5b821754a726bbb421ecaf107cf1cc3f211ca991d7e26195269e4b27f5a
4
+ data.tar.gz: afd82587e7c425d2c12cf9f2c5fecea75ea1dc567f8b6ec7dbb2ee6fd33071ba
5
5
  SHA512:
6
- metadata.gz: 7d25ba5150a0aa03699ca3b375e230e8daed9b655390d8c0b9844f32369b54a2a36b3b15c6e5aa658a5d6b4d24dd20ce8eef469fb7a1223835862bf92fb54ebb
7
- data.tar.gz: dc1aca65175bc2d03e295fbeabba103d78b696d02e3b2cb29a4836f43665252dc2e50b6c0a639bd714c86f60e1067221cc7ef63009d8827d2d0558ed6942d706
6
+ metadata.gz: 70c290e49b8001a2b967d3fb8bad1469a704e621f4b85d405c8ea96bdbffbe134ad1187e1b5034799716e203dcabac5ed5e2fe7b5f8e45e6072a7f4eaae58179
7
+ data.tar.gz: e62956e7400a4f99c099583622b85d0b660db07fabe24c08e35d3c5cd55a92644266294c5d3fc2b8bfc4017245cc1dabdf400fe4b2cd6ee5c1a0d61aa9def26e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- MovableInkAWS (2.9.2)
4
+ MovableInkAWS (2.9.3)
5
5
  aws-sdk-athena (~> 1)
6
6
  aws-sdk-autoscaling (~> 1)
7
7
  aws-sdk-cloudwatch (~> 1)
@@ -46,6 +46,20 @@ module MovableInk
46
46
  end
47
47
  end
48
48
 
49
+ def delete_role_tag_with_retries(role:)
50
+ run_with_backoff do
51
+ ec2_with_retries.delete_tags({
52
+ resources: [instance_id],
53
+ tags: [
54
+ {
55
+ key: "mi:roles",
56
+ value: role
57
+ }
58
+ ]
59
+ })
60
+ end
61
+ end
62
+
49
63
  def complete_lifecycle_action(lifecycle_hook_name:, auto_scaling_group_name:, lifecycle_action_token: nil, instance_id: nil)
50
64
  raise ArgumentError.new('lifecycle_action_token or instance_id required') if lifecycle_action_token.nil? && instance_id.nil?
51
65
 
@@ -10,6 +10,16 @@ module MovableInk
10
10
  @ec2_client[region] ||= (client) ? client : Aws::EC2::Client.new(region: region)
11
11
  end
12
12
 
13
+ def ec2_with_retries(region: my_region, client: nil)
14
+ @ec2_client_with_retries ||= {}
15
+ if (client)
16
+ @ec2_client_with_retries[region] ||= client
17
+ else
18
+ instance_credentials = Aws::InstanceProfileCredentials.new
19
+ @ec2_client_with_retries[region] ||= Aws::EC2::Client.new(region: region, credentials: instance_credentials, retries: 5)
20
+ end
21
+ end
22
+
13
23
  def mi_env_cache_file_path
14
24
  '/etc/movableink/environments.json'
15
25
  end
@@ -75,7 +75,6 @@ module MovableInk
75
75
  Aws::EC2::Errors::InternalError,
76
76
  Aws::EC2::Errors::Http503Error,
77
77
  Aws::EKS::Errors::TooManyRequestsException,
78
- Aws::Errors::MissingCredentialsError,
79
78
  Aws::SNS::Errors::ThrottledException,
80
79
  Aws::SNS::Errors::Throttling,
81
80
  Aws::AutoScaling::Errors::Throttling,
@@ -1,5 +1,5 @@
1
1
  module MovableInk
2
2
  class AWS
3
- VERSION = '2.9.2'
3
+ VERSION = '2.9.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MovableInkAWS
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.2
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MI SRE