Skip to content

Instantly share code, notes, and snippets.

@pierreis
Last active September 9, 2023 20:37
Show Gist options
  • Save pierreis/ca0c4fbe3a1f60a5729d386511d37fd8 to your computer and use it in GitHub Desktop.
Save pierreis/ca0c4fbe3a1f60a5729d386511d37fd8 to your computer and use it in GitHub Desktop.
AWS SAM Deploy Template
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Test API
Parameters:
Stage:
Type: String
AllowedValues:
- dev
- sat
- demo
- staging
- prod
Description: Enter dev, sat, demo, staging or prod
Resources:
MyApi:
Type: AWS::Serverless::Api
Properties:
StageName: !Ref Stage
EndpointConfiguration: PRIVATE
DefinitionBody:
swagger: '2.0'
x-amazon-apigateway-policy:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal: "*"
Action: execute-api:Invoke
Resource:
- !Sub arn:aws:execute-api:*:*:*/${Stage}/*
ThumbnailFunction:
Type: 'AWS::Serverless::Function'
Properties:
Runtime: nodejs8.10
Handler: get-config.handler
CodeUri: ./functions
Events:
ThumbnailApi:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /thumbnail
Method: GET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment