Skip to content

Commit

Permalink
changes in template
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwelin committed Feb 10, 2020
1 parent 15de344 commit b100104
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tmpl-sam.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Resources:
# API GW Conf
########################
AnalyticsApi:
AWSApi:
Type: AWS::Serverless::Api
Properties:
StageName: !Ref Environment
Expand Down Expand Up @@ -126,18 +126,18 @@ Resources:
ApiAccessLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub "/aws/apigateway/AccessLog-${AnalyticsApi}"
LogGroupName: !Sub "/aws/apigateway/AccessLog-${AWSApi}"
RetentionInDays: 365
########################
# Functions Goes Here
########################
RecommendationsFunction:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/recommendations/app/
CodeUri: src/{{ .LambdaFunctionName }}/app/
Handler: recommendations.lambda_handler
Runtime: python3.7
MemorySize: 512
Expand All @@ -146,27 +146,27 @@ Resources:
Policies:
- AWSLambdaExecute
Layers:
- !Ref RecommendationsLayer
- !Ref HelloWorldLayer
Events:
AnyApi:
Type: Api
Properties:
RestApiId: !Ref AnalyticsApi
Path: '/recommendations/{userId}'
RestApiId: !Ref AWSApi
Path: '/{{ .LambdaFunctionName }}/{userId}'
Method: GET
RecommendationsLayer:
HelloWorldLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: recommendations-deps
Description: Dependencies for RecommendationsFunction
ContentUri: src/recommendations/dependencies/
Description: Dependencies for HelloWorldFunction
ContentUri: src/{{ .LambdaFunctionName }}/dependencies/
CompatibleRuntimes:
- python3.7
RetentionPolicy: Retain
Outputs:
ApiURL:
Description: {{ .ApiProjectName }}
Value: !Sub 'https://${AnalyticsApi}.execute-api.${AWS::Region}.amazonaws.com/${Environment}/'
Value: !Sub 'https://${AWSApi}.execute-api.${AWS::Region}.amazonaws.com/${Environment}/'
`

0 comments on commit b100104

Please sign in to comment.