spec/convection/model/template/resource/lambdas_spec.rb in convection-2.2.26 vs spec/convection/model/template/resource/lambdas_spec.rb in convection-2.2.27
- old
+ new
@@ -9,20 +9,27 @@
lambda_function 'TestLambda' do
description 'Test description'
handler 'index.handler'
runtime 'nodejs'
role 'arn:aws:x:y:z'
+ concurrency 100
code do
s3_bucket 'testbucket'
s3_key 'testkey'
end
vpc_config do
security_groups %w(group1 group2)
subnets %w(subnet1a subnet1b)
end
+
+ dead_letter_config do
+ target_arn 'arn:aws:sqs:us-east-1:XXXXXXXXXXXX:lambda-dlq'
+ end
+
+ tag 'test', 'value'
end
end
end
subject do
@@ -57,9 +64,21 @@
expect(subject['VpcConfig']['SubnetIds']).to be_a(Array)
end
it 'SubnetIds is an array of 2 group ids' do
expect(subject['VpcConfig']['SubnetIds'].size).to eq(2)
+ end
+
+ it 'ReservedConcurrentExecutions matches the value defined in the template' do
+ expect(subject['ReservedConcurrentExecutions']).to eq(100)
+ end
+
+ it 'dead letter config matches the value defined in the template' do
+ expect(subject['DeadLetterConfig']['TargetArn']).to eq('arn:aws:sqs:us-east-1:XXXXXXXXXXXX:lambda-dlq')
+ end
+
+ it 'sets tags' do
+ expect(subject['Tags']).to include(hash_including('Key' => 'test', 'Value' => 'value'))
end
private
def template_json