lambda_wrap 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcab068ec4b93c5c11e66bdd0686aad997b52e48573e5e581f8363c56dbc96f0
4
- data.tar.gz: 267570d242c1343f5c1d9197272eecdce1f9ce658cf73c960791c4a83afb8674
3
+ metadata.gz: a8cf94fc97bbe6e881bc2fc94352bed9154fa1edd3c19ae513c6142b38f77c61
4
+ data.tar.gz: fdd54e1c41474aa11414726f16a07c6ca20175bbcba6d4ad70e5846536b28f97
5
5
  SHA512:
6
- metadata.gz: 78708a6551a1ff4296d156b941489e5782163e01f79ba96ffca23cbc1af9abc609ae8fc9c835b8de01908a6d7ad54247bf4df1e103361f4af79ab69bc1186a2a
7
- data.tar.gz: 1d5c73b0c6054339e74f6566937a2e18064443c23f68085ab900d505a2ecd820f6a43167ef9eea3546729581e7fa0b54378879ac50aade775eb72e768d2a3c2e
6
+ metadata.gz: 067104c8cecb2d375ef7ec5f1c16ad47f360e8aaf1492ad029b9e0329a54ed36a3a13c9abda7ebe0e6f66df2e2f7f039d1e0ccb5586b84b83edc1c1a93a98186
7
+ data.tar.gz: 3ffa8ac2a92e0109ede827aa888ff91da1e4eccd3e725546b03e96f896b374ac4cea8d882e68a4a30d7ce4f54fc31210fe2e10499d560c7ca19acb006f4d1c67
@@ -33,13 +33,13 @@ module LambdaWrap
33
33
  # provide at least one security group and one subnet ID.
34
34
  # @option options [Boolean] :delete_unreferenced_versions (true) Option to delete any Lambda Function Versions upon
35
35
  # deployment that do not have an alias pointing to them.
36
+ # @option options [String] :dead_letter_queue_arn ('') The ARN of the SQS Queue for failed async invocations.
36
37
  def initialize(options)
37
38
  defaults = {
38
39
  description: 'Deployed with LambdaWrap', subnet_ids: [], security_group_ids: [], timeout: 30, memory_size: 128,
39
- delete_unreferenced_versions: true
40
+ delete_unreferenced_versions: true, dead_letter_queue_arn: ''
40
41
  }
41
42
  options_with_defaults = options.reverse_merge(defaults)
42
-
43
43
  unless (options_with_defaults[:lambda_name]) && (options_with_defaults[:lambda_name].is_a? String)
44
44
  raise ArgumentError, 'lambda_name must be provided (String)!'
45
45
  end
@@ -73,17 +73,11 @@ module LambdaWrap
73
73
  raise ArgumentError, "Invalid Runtime specified: #{options_with_defaults[:runtime]}. Only accepts: \
74
74
  nodejs4.3, nodejs6.10, java8, python2.7, python3.6, dotnetcore1.0, or nodejs4.3-edge"
75
75
  end
76
-
77
- @description = options_with_defaults[:description]
78
-
79
- @timeout = options_with_defaults[:timeout]
80
-
81
76
  unless (options_with_defaults[:memory_size] % 64).zero? && (options_with_defaults[:memory_size] >= 128) &&
82
77
  (options_with_defaults[:memory_size] <= 3008)
83
78
  raise ArgumentError, 'Invalid Memory Size.'
84
79
  end
85
80
  @memory_size = options_with_defaults[:memory_size]
86
-
87
81
  # VPC
88
82
  if options_with_defaults[:subnet_ids].empty? ^ options_with_defaults[:security_group_ids].empty?
89
83
  raise ArgumentError, 'Must supply values for BOTH Subnet Ids and Security Group ID if VPC is desired.'
@@ -94,8 +88,10 @@ nodejs4.3, nodejs6.10, java8, python2.7, python3.6, dotnetcore1.0, or nodejs4.3-
94
88
  security_group_ids: options_with_defaults[:security_group_ids]
95
89
  }
96
90
  end
97
-
91
+ @description = options_with_defaults[:description]
92
+ @timeout = options_with_defaults[:timeout]
98
93
  @delete_unreferenced_versions = options_with_defaults[:delete_unreferenced_versions]
94
+ @dead_letter_queue_arn = options_with_defaults[:dead_letter_queue_arn]
99
95
  end
100
96
 
101
97
  # Deploys the Lambda to the specified Environment. Creates a Lambda Function if one didn't exist.
@@ -187,7 +183,8 @@ nodejs4.3, nodejs6.10, java8, python2.7, python3.6, dotnetcore1.0, or nodejs4.3-
187
183
  options = {
188
184
  function_name: @lambda_name, runtime: @runtime, role: @role_arn, handler: @handler,
189
185
  code: { zip_file: File.binread(@path_to_zip_file) }, description: @description, timeout: @timeout,
190
- memory_size: @memory_size, vpc_config: @vpc_configuration, publish: true
186
+ memory_size: @memory_size, vpc_config: @vpc_configuration, publish: true,
187
+ dead_letter_config: { target_arn: @dead_letter_queue_arn }
191
188
  }
192
189
  lambda_version = @client.create_function(options).version
193
190
  puts "Successfully created Lambda: #{@lambda_name}!"
@@ -204,7 +201,8 @@ nodejs4.3, nodejs6.10, java8, python2.7, python3.6, dotnetcore1.0, or nodejs4.3-
204
201
 
205
202
  options = {
206
203
  function_name: @lambda_name, role: @role_arn, handler: @handler, description: @description, timeout: @timeout,
207
- memory_size: @memory_size, vpc_config: @vpc_configuration, runtime: @runtime
204
+ memory_size: @memory_size, vpc_config: @vpc_configuration, runtime: @runtime,
205
+ dead_letter_config: { target_arn: @dead_letter_queue_arn }
208
206
  }
209
207
 
210
208
  @client.update_function_configuration(options)
@@ -1,4 +1,4 @@
1
1
  module LambdaWrap
2
2
  # @!visibility private
3
- VERSION = '1.0.3'.freeze
3
+ VERSION = '1.1.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lambda_wrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Thurner
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-21 00:00:00.000000000 Z
13
+ date: 2018-01-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project:
80
- rubygems_version: 2.7.3
80
+ rubygems_version: 2.7.4
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: Easy deployment of AWS Lambda functions and dependencies.