Skip to content

Commit

Permalink
Merge pull request #6 from raykrishardi/master
Browse files Browse the repository at this point in the history
add output and fnsub
  • Loading branch information
tarunmenon95 authored Sep 20, 2024
2 parents ec46e8f + ab900b8 commit d311e69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lambda.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Create Lambda function
Lambda_Function(function_name) do
Code({
S3Bucket: distribution['bucket'],
S3Bucket: FnSub(distribution['bucket']),
S3Key: FnSub("#{distribution['prefix']}/#{lambda_config['code_uri']}")
})

Expand All @@ -71,6 +71,11 @@
Tags tags
end

Output("#{function_name}Arn") {
Value FnGetAtt(function_name , 'Arn')
Export FnSub("${EnvironmentName}-#{external_parameters[:component_name]}-#{function_name}-arn")
}

Logs_LogGroup("#{function_name}LogGroup") do
LogGroupName FnSub("/aws/lambda/${EnvironmentName}/#{function_name}")
RetentionInDays lambda_config['log_retention'] if lambda_config.has_key? 'log_retention'
Expand Down

0 comments on commit d311e69

Please sign in to comment.