Skip to content

Commit cc676aa

Browse files
authored
Merge pull request #132 from movableink/arajeev/sc-169076/add-retries
add retries [sc-169076]
2 parents e02d9b9 + 775b975 commit cc676aa

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
MovableInkAWS (2.11.2)
4+
MovableInkAWS (2.11.3)
55
aws-sdk-athena (~> 1)
66
aws-sdk-autoscaling (~> 1)
77
aws-sdk-cloudwatch (~> 1)

lib/movable_ink/aws/ec2.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ def available_elastic_ips(role:)
258258
unassigned_elastic_ips.select { |address| address.tags.detect { |t| t.key == 'mi:roles' && t.value == role } }
259259
end
260260

261+
def assign_ip_address_with_retries(role:)
262+
run_with_backoff do
263+
ec2_with_retries.associate_address({
264+
instance_id: instance_id,
265+
allocation_id: available_elastic_ips(role: role).sample.allocation_id
266+
})
267+
end
268+
end
269+
261270
def assign_ip_address(role:)
262271
run_with_backoff do
263272
ec2.associate_address({

lib/movable_ink/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module MovableInk
22
class AWS
3-
VERSION = '2.11.2'
3+
VERSION = '2.11.3'
44
end
55
end

0 commit comments

Comments
 (0)