Skip to content

Commit

Permalink
fixes and readme for private api
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwelin committed May 6, 2020
1 parent a98946f commit defdc94
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>


**Alviss** is a scaffolding project that let's you provision and deploy production ready serverless API:s in seconds on AWS using API Gateway and Lambda
**Alviss** is a scaffolding project that let's you provision and deploy production ready serverless API:s in seconds on AWS using API Gateway and Lambda using your preferred programming language


Rationale
Expand Down
2 changes: 2 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/urfave/cli"
)

var version = "dev"

type enumValue struct {
Enum []string
Default string
Expand Down
6 changes: 5 additions & 1 deletion tmpl-languages.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ const rubyFunction = `
require 'json'
def handler(event:, context:)
{ statusCode: 200, body: JSON.generate('hello world') }
msg = {:msg => 'hello world'}
return {
:statusCode => 200,
:body => msg.to_json
}
end
`
const gemFile = `
Expand Down
5 changes: 4 additions & 1 deletion tmpl-readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ $ pip install --user aws-sam-cli
` + "```" + `bash
$ sam build --template-file apigw.yml
` + "```" + `
{{ if and (eq .APIEndpoints "private") }}
### Private API
Since this is a private API it will be deployed inside of your VPC. You will need to supply parameter values to SAM, example; vpc-id, your private subnets to use and the vpc cidr. The deployment will also create a VPC Endpoint to bridge your VPC to the API Gateway service, normally you want to keep this as a separate deploymnent (since it will be deleted if you delete this stack), but for simplicity sake it's included here. If you already have a VPC Endpoint for API Gateway you can just delete it from the apigw.yml template
{{ end }}
### Package & Deploy the Project
` + "```" + `bash
$ sam deploy --guided
Expand Down
6 changes: 3 additions & 3 deletions tmpl-sam.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Resources:
Properties:
CodeUri: src/{{ .LambdaFunctionName }}/app/
{{ if and (eq .Language "python")}}Handler: app.handler
Runtime: python3.8{{ end }}{{ if and (eq .Language "ruby")}}Handler: app.handler
Runtime: python3.7{{ end }}{{ if and (eq .Language "ruby")}}Handler: app.handler
Runtime: ruby2.7{{ end }}{{ if and (eq .Language "node")}}Handler: index.handler
Runtime: nodejs12.x{{ end }}{{ if and (eq .Language "go")}}Handler: helloworld
Runtime: go1.x{{ end }}{{ if and (eq .Language "java")}}Handler: com.api.HelloWorld
Expand All @@ -153,8 +153,8 @@ Resources:
Method: GET
{{ if and (eq .APIEndpoints "private") }} VpcConfig:
SecurityGroupIds:
- !GetAtt LambdaSecurityGroup.GroupId
SubnetIds: !Ref SubnetIDs
- !GetAtt LambdaSecurityGroup.GroupId
SubnetIds: !Ref SubnetIDs
{{ end }}
Outputs:
Expand Down

0 comments on commit defdc94

Please sign in to comment.