diff --git a/package.json b/package.json index e7c7104..749e2e6 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test": "mocha", "test-coverage": "istanbul cover _mocha", "predeploy": "git log -1 --pretty=format:'{ \"date\":\"%cI\", \"commit\":\"%H\" }' > git-commit.json", - "deploy": "zip -r LATE-standard-redirects-for-cloudfront.zip . -i \\*.js -i git-commit.json -i node_modules/\\* -x test/\\* -x node_modules/aws-sdk/\\* -x node_modules/mocha/\\* && echo Uploading... && aws lambda update-function-code --region us-east-1 --function-name LATE-standard-redirects-for-cloudfront --zip-file fileb://LATE-standard-redirects-for-cloudfront.zip --publish" + "deploy": "zip -r LATE-standard-redirects-for-cloudfront.zip . -i \\*.js -i git-commit.json -i node_modules/\\* -x test/\\* -x node_modules/aws-sdk/\\* -x node_modules/mocha/\\* && echo Uploading... && aws lambda update-function-code --region us-east-1 --function-name LATE-standard-redirects-for-cloudfront --zip-file fileb://LATE-standard-redirects-for-cloudfront.zip --publish", + "package": "aws cloudformation package --template-file sam.yaml --output-template-file standard-redirects-for-cloudfront-sam.yaml --s3-bucket public.digital-sailors.de --s3-prefix serverless-application-repo/standard-redirects-for-cloudfront" }, "dependencies": {}, "license": "Apache-2.0", diff --git a/sam.yaml b/sam.yaml new file mode 100644 index 0000000..d4b4175 --- /dev/null +++ b/sam.yaml @@ -0,0 +1,11 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Resources: + StandardRedirectsForCloudFront: + Type: AWS::Serverless::Function + Properties: + Handler: index.handler + Runtime: nodejs6.10 + Description: 'Standard Redirects for CloudFront by Digital Sailors via the Serverless Application Repository' + MemorySize: 128 + Timeout: 3 diff --git a/standard-redirects-for-cloudfront-sam.yaml b/standard-redirects-for-cloudfront-sam.yaml new file mode 100644 index 0000000..cbbb3df --- /dev/null +++ b/standard-redirects-for-cloudfront-sam.yaml @@ -0,0 +1,13 @@ +AWSTemplateFormatVersion: '2010-09-09' +Resources: + StandardRedirectsForCloudFront: + Properties: + CodeUri: s3://public.digital-sailors.de/serverless-application-repo/standard-redirects-for-cloudfront//f67fc421792d57dd0adf0dbb485b974a + Description: Standard Redirects for CloudFront by Digital Sailors via the Serverless + Application Repository + Handler: index.handler + MemorySize: 128 + Runtime: nodejs6.10 + Timeout: 3 + Type: AWS::Serverless::Function +Transform: AWS::Serverless-2016-10-31