Skip to content

Commit b4a521d

Browse files
committed
Added metadata so it can be published to the SAR
1 parent d2899cb commit b4a521d

File tree

3 files changed

+42
-10
lines changed

3 files changed

+42
-10
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Solve HQ
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

build.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o pipefail
44

55
echo '***Start***'
66

7-
INSTRUCTION="If you want to deploy, try running the script with 'deploy region bucket-prefix profile', e.g. 'deploy eu-west-2 solveless-stack-source-code solve-dev-eric'"
7+
INSTRUCTION="If you want to deploy, try running the script with 'deploy region bucket profile', e.g. 'deploy eu-west-2 solveless-stack-source-code solve-dev-eric'"
88

99
if [ $# -eq 0 ]; then
1010
echo "Missing arguments."
@@ -18,6 +18,13 @@ elif [ "$1" = "deploy" ] && [ $# -eq 4 ]; then
1818
sam build
1919
sam package --template-file ./.aws-sam/build/template.yaml --s3-bucket $BUCKET_NAME --output-template-file ./.aws-sam/build/packaged.yml --region $AWS_REGION --profile $PROFILE
2020
aws cloudformation deploy --template-file ./.aws-sam/build/packaged.yml --stack-name custom-aws-sdk-layer --capabilities CAPABILITY_IAM --region $AWS_REGION --profile $PROFILE
21+
elif [ "$1" = "publish" ] && [ $# -eq 3 ]; then
22+
REGION=$2
23+
BUCKET_NAME=$3
24+
25+
sam build
26+
aws cloudformation package --template-file .aws-sam/build/template.yaml --output-template-file .aws-sam/build/packaged.yml --s3-bucket $BUCKET_NAME --region $REGION
27+
sam publish --template .aws-sam/build/packaged.yml --region $REGION
2128
else
2229
echo $INSTRUCTION
2330
exit 1

template.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ AWSTemplateFormatVersion: "2010-09-09"
22
Transform: AWS::Serverless-2016-10-31
33
Description: A Layer that packages the newest versions of aws-sdk and aws-xray-sdk
44

5+
Metadata:
6+
AWS::ServerlessRepo::Application:
7+
Name: lambda-nodejs-custom-sdks-layer
8+
Description: A Lambda Layer that packages the newest versions of aws-sdk and aws-xray-sdk for nodejs8.10 functions
9+
Author: Solve HQ
10+
SpdxLicenseId: MIT
11+
LicenseUrl: LICENSE
12+
ReadmeUrl: README.md
13+
Labels: ['lambda', 'layer', 'sdks', 'nodejs']
14+
HomePageUrl: https://github.com/solve-hq/lambda-custom-sdks-layer
15+
SemanticVersion: 2.423.0
16+
SourceCodeUrl: https://github.com/solve-hq/lambda-custom-sdks-layer
17+
518
Resources:
619
nodejs:
720
Type: AWS::Serverless::Function
@@ -13,22 +26,13 @@ Resources:
1326
NodeJSLayer:
1427
Type: AWS::Serverless::LayerVersion
1528
Properties:
16-
LayerName: CustomSdksLayer
1729
Description: A Layer that packages the newest versions of aws-sdk and aws-xray-sdk
1830
ContentUri: ./.aws-sam/build
1931
CompatibleRuntimes:
2032
- nodejs8.10
2133
LicenseInfo: "Available under the MIT-0 license."
2234
RetentionPolicy: Retain
2335

24-
LayerVersionARN:
25-
Type: AWS::SSM::Parameter
26-
Properties:
27-
Type: String
28-
Name: /Solve/Layers/NodeJS/CustomSDKs/ARN
29-
Value: !Ref NodeJSLayer
30-
Description: The LayerVersion ARN of the NodeJS layer that packages aws-sdk and aws-xray-sdk
31-
3236
Outputs:
3337
LayerVersionArn:
3438
Description: "The Layer Version ARN to use when setting the layers of a function"

0 commit comments

Comments
 (0)