This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ApiKey: | |
| Type: AWS::ApiGateway::ApiKey | |
| Properties: | |
| Name: !Join ["", [{"Ref": "AWS::StackName"}, "-apikey"]] | |
| Description: !Join ["", [{"Ref": "AWS::StackName"}, "api key"]] | |
| Enabled: true | |
| GenerateDistinctId: false | |
| ApiUsagePlan: | |
| Type: "AWS::ApiGateway::UsagePlan" | |
| DependsOn: ApiGatewayStage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LambdaFunction: | |
| Type: AWS::Lambda::Function | |
| Properties: | |
| Code: | |
| ZipFile: | | |
| exports.handler = async function(event, context) { | |
| return { statusCode: 200, body: 'Hello World!' }; | |
| }; | |
| Description: API Lambda function | |
| FunctionName: !Ref "lambdaFunctionName" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: AWS API Gateway with a Lambda Integration | |
| Parameters: | |
| lambdaFunctionName: | |
| Type: "String" | |
| AllowedPattern: "^[a-zA-Z0-9]+[a-zA-Z0-9-]+[a-zA-Z0-9]+$" | |
| Description: Lambda function name. (Recommend to keep default) | |
| Default: "lambda-api" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ProxyResource: | |
| Type: 'AWS::ApiGateway::Resource' | |
| Properties: | |
| RestApiId: !Ref ApiGatewayRestApi | |
| ParentId: !GetAtt ApiGatewayRestApi.RootResourceId | |
| PathPart: !Ref "apiResourcePath" | |
| ProxyResourceANY: | |
| Type: 'AWS::ApiGateway::Method' | |
| Properties: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ApiGatewayRestApi: | |
| Type: AWS::ApiGateway::RestApi | |
| Properties: | |
| ApiKeySourceType: HEADER | |
| Description: An API Gateway for Lambda APIs | |
| EndpointConfiguration: | |
| Types: | |
| - REGIONAL | |
| Name: !Join ["", [{"Ref": "AWS::StackName"}, "-api"]] |
NewerOlder