Skip to content

Instantly share code, notes, and snippets.

View asishrs's full-sized avatar
🔥
<Coding>

asish asishrs

🔥
<Coding>
View GitHub Profile
ApiGatewayRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
ApiKeySourceType: HEADER
Description: An API Gateway for Lambda APIs
EndpointConfiguration:
Types:
- REGIONAL
Name: !Join ["", [{"Ref": "AWS::StackName"}, "-api"]]
ProxyResource:
Type: 'AWS::ApiGateway::Resource'
Properties:
RestApiId: !Ref ApiGatewayRestApi
ParentId: !GetAtt ApiGatewayRestApi.RootResourceId
PathPart: !Ref "apiResourcePath"
ProxyResourceANY:
Type: 'AWS::ApiGateway::Method'
Properties:
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"
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"
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
ApiGatewayRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
ApiKeySourceType: HEADER
Description: An API Gateway for Lambda APIs
EndpointConfiguration:
Types:
- REGIONAL
Name: !Join ["", [{"Ref": "AWS::StackName"}, "-api"]]
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"
apiStageName:
Type: "String"
Description: API Staging Name. (Recommend to keep default)
Default: "v1"
name: hugo publish
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-18.04
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 14d
xds-server ClusterIP 10.43.113.60 <none> 18000/TCP 5d
hello-server ClusterIP 10.43.78.196 <none> 50051/TCP 4d23h
howdy-server ClusterIP 10.43.228.201 <none> 50052/TCP 4d23h
NAME READY UP-TO-DATE AVAILABLE AGE
hello-client 1/1 1 1 4d23h
howdy-client 1/1 1 1 4d23h
hello-server 2/2 2 2 4d23h
howdy-server 2/2 2 2 4d23h
xds-server 1/1 1 1 5d