From 2835aa154398acf39f2eed446deea4f26887855d Mon Sep 17 00:00:00 2001 From: Briana Swift Date: Fri, 1 Nov 2019 09:31:09 +0100 Subject: [PATCH 1/5] add sam-template.yml --- sam-template.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sam-template.yml diff --git a/sam-template.yml b/sam-template.yml new file mode 100644 index 0000000..bf691ab --- /dev/null +++ b/sam-template.yml @@ -0,0 +1,49 @@ +Transform: 'AWS::Serverless-2016-10-31' +Resources: + + MainFunction: + # This resource creates a Lambda function. + Type: 'AWS::Serverless::Function' + + Properties: + + # This function uses the Nodejs v8.10 runtime. + Runtime: nodejs8.10 + + # This is the Lambda function's handler. + Handler: handler.lambdaHandler + + # The location of the Lambda function code. + CodeUri: . + + # Event sources to attach to this function. In this case, we are attaching + # one API Gateway endpoint to the Lambda function. The function is + # called when a HTTP request is made to the API Gateway endpoint. + Events: + + MainPage: + # Define an API Gateway endpoint that responds to HTTP GET at /thumbnail + Type: Api + Properties: + Path: / + Method: GET + CSSFile: + # Define an API Gateway endpoint that responds to HTTP GET at /thumbnail + Type: Api + Properties: + Path: /public/index.css + Method: GET + JSFile: + # Define an API Gateway endpoint that responds to HTTP GET at /thumbnail + Type: Api + Properties: + Path: /public/main.js + Method: GET + +Outputs: + # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function + # Find out more about other implicit resources you can reference within SAM + # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api + StagingUrl: + Description: "Staging URL" + Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" \ No newline at end of file From 2c9220ec4583e76b5e47d7ed4919ae8cbc1b2529 Mon Sep 17 00:00:00 2001 From: Briana Swift Date: Fri, 1 Nov 2019 09:31:43 +0100 Subject: [PATCH 2/5] add aws-config.yml to .github directory --- .github/aws-config.yml | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/aws-config.yml diff --git a/.github/aws-config.yml b/.github/aws-config.yml new file mode 100644 index 0000000..b54c056 --- /dev/null +++ b/.github/aws-config.yml @@ -0,0 +1,43 @@ +--- + +########################################################## +# AWS Configuration file for NodeJS Deploy GitHub Action # +# # +# NOTE: This file holds the variables needed # +# to configure the GitHub Deploy NodeJS # +# on AWS Serverless # +# # +# This file needs to be in the location: # +# - .github/aws-config.yml # +# in your repository to be parsed at run time # +########################################################## + +######################################## +# AWS S3 Bucket for package and deploy # +######################################## +# NOTE: This bucket must exist before the GitHub Action +s3_bucket: github-sam-test + +################################## +# AWS Cloud Formation Stack name # +################################## +# NOTE: Defaults to "mystack" if left empty +aws_stack_name: mystack + +#################### +# AWS SAM Template # +#################### +# NOTE: This is the AWS SAM template.yml file that we need to deploy +# Pathing is from root of repository: +# Example: +# if file is called `template.yml` and is in the root of repository +# under the '.github' folder: +# sam_template: .github/template.yml +sam_template: sam-template.yml + +################################ +# region for connection to AWS # +################################ +# Default region is: us-west-2 +# if not provided below +region: us-west-2 From 4213f2a7bc1c29488e5ae5a6b2b57b94159b6ea3 Mon Sep 17 00:00:00 2001 From: Briana Swift Date: Sun, 3 Nov 2019 12:24:06 +0100 Subject: [PATCH 3/5] clarify notes in aws-config.yml about s3 bucket name --- .github/aws-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/aws-config.yml b/.github/aws-config.yml index b54c056..0160f00 100644 --- a/.github/aws-config.yml +++ b/.github/aws-config.yml @@ -15,7 +15,7 @@ ######################################## # AWS S3 Bucket for package and deploy # ######################################## -# NOTE: This bucket must exist before the GitHub Action +# NOTE: This bucket must exist before the GitHub Action, and match the name of your S3 bucket on Amazon s3_bucket: github-sam-test ################################## From 451075431f80b98f43e57f000b0fa619cb118a2d Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Wed, 25 Mar 2020 13:30:15 -0400 Subject: [PATCH 4/5] update node runtime --- sam-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sam-template.yml b/sam-template.yml index bf691ab..06ed612 100644 --- a/sam-template.yml +++ b/sam-template.yml @@ -7,8 +7,8 @@ Resources: Properties: - # This function uses the Nodejs v8.10 runtime. - Runtime: nodejs8.10 + # This function uses the Nodejs v12 runtime. + Runtime: nodejs12.x # This is the Lambda function's handler. Handler: handler.lambdaHandler From 2b9f4207d8642bec89b217415a4039ef60abe80d Mon Sep 17 00:00:00 2001 From: Eric R Date: Mon, 8 Jun 2020 18:51:49 -0400 Subject: [PATCH 5/5] Update the AWS config with the actual bucket details --- .github/aws-config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/aws-config.yml b/.github/aws-config.yml index 0160f00..60f0df5 100644 --- a/.github/aws-config.yml +++ b/.github/aws-config.yml @@ -16,7 +16,7 @@ # AWS S3 Bucket for package and deploy # ######################################## # NOTE: This bucket must exist before the GitHub Action, and match the name of your S3 bucket on Amazon -s3_bucket: github-sam-test +s3_bucket: githubactions-training ################################## # AWS Cloud Formation Stack name # @@ -40,4 +40,4 @@ sam_template: sam-template.yml ################################ # Default region is: us-west-2 # if not provided below -region: us-west-2 +region: ca-central-1