MovableInkAWS 1.1.4 → 1.2.2

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: a81a0a05ca7f2dbd8f8b6d3e966e1e89f09ad5f38c0fcc27c19ed4e19177bc3c
4
- data.tar.gz: fb1e2c6618c0790bbaa9dcc5a5c4dba8d62bd9d0a7de5159079443f98ce71fb1
3
+ metadata.gz: 17ceb1cd0d9da92a94c3e5f7eb4d46d9303546bae02c68355f9257e26719e7d9
4
+ data.tar.gz: b70e2dcf79443ee2c2b8cdc700880de3976efe52af15517d7852ed69e2c444c0
5
5
  SHA512:
6
- metadata.gz: be347e295cd8c88b75d19d114e3a2f8ea8ca03377b2d5a6d521c2179453d994c3d620f5dc87e5b76bdc1603e1acc560d38d1d5354f9b6b5499b0da94f6acb98f
7
- data.tar.gz: a2b8833b9e95b7e980c112caf2516a85922df954744beda219b6b9150539bf7caa786ef1c79563a83e74eb1c13ebb349838245e186f6545f3c92262fdc0c1fe1
6
+ metadata.gz: 1eaced59806f774de531934dc18217f9fa699f8ca5a02829260f10bf1a0c293bb640c97dbb7270c884a7c0e217fc58a506c69cdd44cf5cc567e70f25b7f8fc4d
7
+ data.tar.gz: 8654770ca2b03ab180af4bcd9727aaa94c4cad1090f4e5002172f621b8c5c6ab90dfd49b90039312de7e86b68fdd2135d78d9882c643330d47f3f7fe0c861bd5
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- MovableInkAWS (1.1.4)
4
+ MovableInkAWS (1.2.2)
5
5
  aws-sdk-athena (~> 1)
6
6
  aws-sdk-autoscaling (~> 1)
7
7
  aws-sdk-cloudwatch (~> 1)
8
8
  aws-sdk-core (~> 3)
9
9
  aws-sdk-ec2 (~> 1)
10
+ aws-sdk-eks (~> 1)
10
11
  aws-sdk-elasticache (~> 1)
11
12
  aws-sdk-rds (~> 1)
12
13
  aws-sdk-route53 (~> 1)
@@ -20,48 +21,51 @@ GEM
20
21
  remote: https://rubygems.org/
21
22
  specs:
22
23
  aws-eventstream (1.1.0)
23
- aws-partitions (1.325.0)
24
- aws-sdk-athena (1.27.0)
25
- aws-sdk-core (~> 3, >= 3.71.0)
24
+ aws-partitions (1.353.0)
25
+ aws-sdk-athena (1.30.0)
26
+ aws-sdk-core (~> 3, >= 3.99.0)
26
27
  aws-sigv4 (~> 1.1)
27
- aws-sdk-autoscaling (1.37.0)
28
- aws-sdk-core (~> 3, >= 3.71.0)
28
+ aws-sdk-autoscaling (1.44.0)
29
+ aws-sdk-core (~> 3, >= 3.99.0)
29
30
  aws-sigv4 (~> 1.1)
30
- aws-sdk-cloudwatch (1.38.0)
31
- aws-sdk-core (~> 3, >= 3.71.0)
31
+ aws-sdk-cloudwatch (1.42.0)
32
+ aws-sdk-core (~> 3, >= 3.99.0)
32
33
  aws-sigv4 (~> 1.1)
33
- aws-sdk-core (3.97.1)
34
+ aws-sdk-core (3.104.3)
34
35
  aws-eventstream (~> 1, >= 1.0.2)
35
36
  aws-partitions (~> 1, >= 1.239.0)
36
37
  aws-sigv4 (~> 1.1)
37
38
  jmespath (~> 1.0)
38
- aws-sdk-ec2 (1.165.0)
39
- aws-sdk-core (~> 3, >= 3.71.0)
39
+ aws-sdk-ec2 (1.183.0)
40
+ aws-sdk-core (~> 3, >= 3.99.0)
40
41
  aws-sigv4 (~> 1.1)
41
- aws-sdk-elasticache (1.36.0)
42
- aws-sdk-core (~> 3, >= 3.71.0)
42
+ aws-sdk-eks (1.39.0)
43
+ aws-sdk-core (~> 3, >= 3.99.0)
43
44
  aws-sigv4 (~> 1.1)
44
- aws-sdk-kms (1.33.0)
45
- aws-sdk-core (~> 3, >= 3.71.0)
45
+ aws-sdk-elasticache (1.40.0)
46
+ aws-sdk-core (~> 3, >= 3.99.0)
46
47
  aws-sigv4 (~> 1.1)
47
- aws-sdk-rds (1.85.0)
48
- aws-sdk-core (~> 3, >= 3.71.0)
48
+ aws-sdk-kms (1.36.0)
49
+ aws-sdk-core (~> 3, >= 3.99.0)
49
50
  aws-sigv4 (~> 1.1)
50
- aws-sdk-route53 (1.35.0)
51
- aws-sdk-core (~> 3, >= 3.71.0)
51
+ aws-sdk-rds (1.95.0)
52
+ aws-sdk-core (~> 3, >= 3.99.0)
52
53
  aws-sigv4 (~> 1.1)
53
- aws-sdk-s3 (1.67.1)
54
- aws-sdk-core (~> 3, >= 3.96.1)
54
+ aws-sdk-route53 (1.40.0)
55
+ aws-sdk-core (~> 3, >= 3.99.0)
56
+ aws-sigv4 (~> 1.1)
57
+ aws-sdk-s3 (1.76.0)
58
+ aws-sdk-core (~> 3, >= 3.104.1)
55
59
  aws-sdk-kms (~> 1)
56
60
  aws-sigv4 (~> 1.1)
57
- aws-sdk-sns (1.24.0)
58
- aws-sdk-core (~> 3, >= 3.71.0)
61
+ aws-sdk-sns (1.29.0)
62
+ aws-sdk-core (~> 3, >= 3.99.0)
59
63
  aws-sigv4 (~> 1.1)
60
- aws-sdk-ssm (1.80.0)
61
- aws-sdk-core (~> 3, >= 3.71.0)
64
+ aws-sdk-ssm (1.86.0)
65
+ aws-sdk-core (~> 3, >= 3.99.0)
62
66
  aws-sigv4 (~> 1.1)
63
- aws-sigv4 (1.1.4)
64
- aws-eventstream (~> 1.0, >= 1.0.2)
67
+ aws-sigv4 (1.2.1)
68
+ aws-eventstream (~> 1, >= 1.0.2)
65
69
  diff-lcs (1.3)
66
70
  httparty (0.16.3)
67
71
  mime-types (~> 3.0)
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.add_runtime_dependency 'aws-sdk-autoscaling', '~> 1'
15
15
  s.add_runtime_dependency 'aws-sdk-cloudwatch', '~> 1'
16
16
  s.add_runtime_dependency 'aws-sdk-ec2', '~> 1'
17
+ s.add_runtime_dependency 'aws-sdk-eks', '~> 1'
17
18
  s.add_runtime_dependency 'aws-sdk-elasticache', '~> 1'
18
19
  s.add_runtime_dependency 'aws-sdk-rds', '~> 1'
19
20
  s.add_runtime_dependency 'aws-sdk-route53', '~> 1'
@@ -7,6 +7,7 @@ require_relative 'aws/route53'
7
7
  require_relative 'aws/ssm'
8
8
  require_relative 'aws/athena'
9
9
  require_relative 'aws/s3'
10
+ require_relative 'aws/eks'
10
11
  require_relative 'aws/elasticache'
11
12
  require_relative 'aws/api_gateway'
12
13
  require 'aws-sdk-cloudwatch'
@@ -24,6 +25,7 @@ module MovableInk
24
25
  include S3
25
26
  include ElastiCache
26
27
  include ApiGateway
28
+ include EKS
27
29
 
28
30
  class << self
29
31
  def regions
@@ -62,7 +64,9 @@ module MovableInk
62
64
  rescue Aws::EC2::Errors::RequestLimitExceeded,
63
65
  Aws::EC2::Errors::ResourceAlreadyAssociated,
64
66
  Aws::EC2::Errors::Unavailable,
67
+ Aws::EKS::Errors::TooManyRequestsException,
65
68
  Aws::SNS::Errors::ThrottledException,
69
+ Aws::AutoScaling::Errors::Throttling,
66
70
  Aws::AutoScaling::Errors::ThrottledException,
67
71
  Aws::S3::Errors::SlowDown,
68
72
  Aws::Route53::Errors::Throttling,
@@ -70,6 +74,7 @@ module MovableInk
70
74
  Aws::Route53::Errors::PriorRequestNotComplete,
71
75
  Aws::Route53::Errors::ServiceUnavailable,
72
76
  Aws::SSM::Errors::TooManyUpdates,
77
+ Aws::SSM::Errors::ThrottlingException,
73
78
  Aws::Athena::Errors::ThrottlingException,
74
79
  MovableInk::AWS::Errors::NoEnvironmentTagError
75
80
  sleep_time = (num+1)**2 + rand(10)
@@ -0,0 +1,60 @@
1
+ require 'aws-sdk-eks'
2
+ require 'yaml'
3
+
4
+ module MovableInk
5
+ class AWS
6
+ module EKS
7
+ def eks(region: my_region)
8
+ @eks_client ||= {}
9
+ @eks_client[region] ||= Aws::EKS::Client.new(region: region)
10
+ end
11
+
12
+ def generate_kubeconfig(region: my_region, cluster_name:)
13
+ client = eks(region: region)
14
+
15
+ resp = run_with_backoff do
16
+ begin
17
+ client.describe_cluster({ name: cluster_name })
18
+ rescue Aws::EKS::Errors::ResourceNotFoundException
19
+ return nil
20
+ end
21
+ end
22
+
23
+ cluster_arn = resp.cluster.arn
24
+ cluster_server_address = resp.cluster.endpoint
25
+ cluster_certificate_authority_data = resp.cluster.certificate_authority.data
26
+
27
+ {
28
+ 'apiVersion' => 'v1',
29
+ 'clusters' => [{
30
+ 'cluster' => {
31
+ 'certificate-authority-data' => cluster_certificate_authority_data,
32
+ 'server' => cluster_server_address,
33
+ },
34
+ 'name' => cluster_arn
35
+ }],
36
+ 'contexts' => [{
37
+ 'context' => {
38
+ 'cluster' => cluster_arn,
39
+ 'user' => cluster_arn,
40
+ },
41
+ 'name' => cluster_arn,
42
+ }],
43
+ 'current-context' => cluster_arn,
44
+ 'kind' => 'Config',
45
+ 'preferences' => {},
46
+ 'users' => [{
47
+ 'name' => cluster_arn,
48
+ 'user' => {
49
+ 'exec' => {
50
+ 'apiVersion' => 'client.authentication.k8s.io/v1alpha1',
51
+ 'args' => ['--region', region, 'eks', 'get-token', '--cluster-name', cluster_name],
52
+ 'command' => 'aws',
53
+ }
54
+ }
55
+ }]
56
+ }.to_yaml
57
+ end
58
+ end
59
+ end
60
+ end
@@ -1,5 +1,5 @@
1
1
  module MovableInk
2
2
  class AWS
3
- VERSION = '1.1.4'
3
+ VERSION = '1.2.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MovableInkAWS
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Chesler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-11 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: aws-sdk-eks
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: aws-sdk-elasticache
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -210,6 +224,7 @@ files:
210
224
  - lib/movable_ink/aws/athena.rb
211
225
  - lib/movable_ink/aws/autoscaling.rb
212
226
  - lib/movable_ink/aws/ec2.rb
227
+ - lib/movable_ink/aws/eks.rb
213
228
  - lib/movable_ink/aws/elasticache.rb
214
229
  - lib/movable_ink/aws/errors.rb
215
230
  - lib/movable_ink/aws/metadata.rb
@@ -245,8 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
260
  - !ruby/object:Gem::Version
246
261
  version: '0'
247
262
  requirements: []
248
- rubyforge_project:
249
- rubygems_version: 2.7.7
263
+ rubygems_version: 3.0.8
250
264
  signing_key:
251
265
  specification_version: 4
252
266
  summary: AWS Utility methods for MovableInk