Skip to content

Commit

Permalink
Add SAM Template outputs for Lambda function name, Lambda function AR…
Browse files Browse the repository at this point in the history
…N and IAM Role ARN
  • Loading branch information
girodav committed Dec 7, 2023
1 parent abfb93d commit 7fdd592
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .internal/aws/cloudformation/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Resources:
ApplicationElasticServerlessForwarder:
Type: AWS::Serverless::Function
Properties:
FunctionName: %sarAppName%-lambda-function
Timeout: 900
MemorySize: 512
CodeUri: %codeUri%
Expand Down Expand Up @@ -93,3 +94,13 @@ Metadata:
LicenseUrl: %codeUri%/LICENSE.txt
HomePageUrl: https://github.com/elastic/elastic-serverless-forwarder
SourceCodeUrl: https://github.com/elastic/elastic-serverless-forwarder
Outputs:
EsfLambdaFunctionARN:
Description: ARN of the ESF Lambda Function
Value: !GetAtt ApplicationElasticServerlessForwarder.Arn
EsfLambdaFunctionName:
Description: Name of the ESF Lambda Function
Value: %sarAppName%-lambda-function
EsfLambdaFunctionRole:
Description: ARN of the IAM role associated with the ESF Lambda function
Value: !GetAtt ApplicationElasticServerlessForwarderRole.Arn
10 changes: 10 additions & 0 deletions .internal/aws/cloudformation/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,13 @@ Metadata:
ReadmeUrl: %codeUri%/README.md
HomePageUrl: https://github.com/elastic/elastic-serverless-forwarder
SourceCodeUrl: https://github.com/elastic/elastic-serverless-forwarder
Outputs:
EsfLambdaFunctionARN:
Description: ARN of the ESF Lambda Function
Value: !GetAtt ElasticServerlessForwarderApplication.Outputs.EsfLambdaFunctionARN
EsfLambdaFunctionName:
Description: The name of ESF Lambda Function
Value: !GetAtt ElasticServerlessForwarderApplication.Outputs.EsfLambdaFunctionName
EsfLambdaFunctionRole:
Description: The name of ESF Lambda Function
Value: !GetAtt ElasticServerlessForwarderApplication.Outputs.EsfLambdaFunctionRole
4 changes: 2 additions & 2 deletions .internal/aws/scripts/dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# or more contributor license agreements. Licensed under the Elastic License 2.0;
# you may not use this file except in compliance with the Elastic License 2.0.

set -e
set -ex

echo " AWS CLI (https://aws.amazon.com/cli/), AWS SAM CLI (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html), docker and Python3.9 with pip3 required"
echo " Please, execute from root folder of the repo"
Expand Down Expand Up @@ -38,7 +38,7 @@ trap "rm -rf ${TMPDIR}" EXIT
aws s3api get-bucket-location --bucket "${BUCKET}" --region "${REGION}" || aws s3api create-bucket --acl private --bucket "${BUCKET}" --region "${REGION}" --create-bucket-configuration LocationConstraint="${REGION}"

# Check if region is in AWS GovCloud and create bucket arn
if [[ ${REGION} == *"$gov"* ]]; then
if [[ "${REGION}" == *gov* ]]; then
BUCKET_ARN="arn:aws-us-gov:s3:::${BUCKET}"
AWS_OR_AWS_GOV="aws-us-gov"
else
Expand Down

0 comments on commit 7fdd592

Please sign in to comment.