Skip to content

Instantly share code, notes, and snippets.

@olivergeorge
Last active July 25, 2018 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olivergeorge/c3918c52b89278a9c1807c9d47a9860e to your computer and use it in GitHub Desktop.
Save olivergeorge/c3918c52b89278a9c1807c9d47a9860e to your computer and use it in GitHub Desktop.
{"AWSTemplateFormatVersion":"2010-09-09",
"Description":"API Gateway for Datomic Web Service Ions",
"Parameters":{"CodeDeployDeploymentGroup":{"Type":"String"}},
"Resources":
{"RestApi":
{"Type":"AWS::ApiGateway::RestApi",
"Properties":
{"Name":"og-condense-sandbox-api",
"BinaryMediaTypes":["*\/*"],
"EndpointConfiguration":{"Types":["REGIONAL"]}}},
"Resource":
{"Type":"AWS::ApiGateway::Resource",
"Properties":
{"RestApiId":{"Ref":"RestApi"},
"ParentId":{"Fn::GetAtt":["RestApi", "RootResourceId"]},
"PathPart":"hello-world"}},
"Method":
{"Type":"AWS::ApiGateway::Method",
"Properties":
{"RestApiId":{"Ref":"RestApi"},
"ResourceId":{"Ref":"Resource"},
"HttpMethod":"ANY",
"AuthorizationType":"NONE",
"Integration":
{"Type":"AWS_PROXY",
"IntegrationHttpMethod":"POST",
"Uri":
{"Fn::Join":
["",
["arn:aws:apigateway:", {"Ref":"AWS::Region"},
":lambda:path\/2015-03-31\/functions\/", "arn:aws:lambda:",
{"Ref":"AWS::Region"}, ":function:",
{"Ref":"CodeDeployDeploymentGroup"}, "-", "hello-world-web",
"\/invocations"]]}}}},
"Permission":
{"Type":"AWS::Lambda::Permission",
"Properties":
{"Action":"lambda:invokeFunction",
"FunctionName":
{"Fn::Join":
["",
["arn:aws:lambda:", {"Ref":"AWS::Region"}, ":function:",
{"Ref":"CodeDeployDeploymentGroup"}, "-", "hello-world-web"]]},
"Principal":"apigateway.amazonaws.com",
"SourceArn":
{"Fn::Join":
["",
["arn:aws:execute-api:", {"Ref":"AWS::Region"}, ":",
{"Ref":"AWS::AccountId"}, ":", {"Ref":"RestApi"}, "\/*\/*\/",
"hello-world"]]}}},
"Deployment":
{"Type":"AWS::ApiGateway::Deployment",
"Properties":{"RestApiId":{"Ref":"RestApi"}, "StageName":"dev"},
"DependsOn":
["Resource", "Method", "Permission"]}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment