{ "Parameters": { "VpcEndpointId": { "Type": "String" }, "EndpointConfigType": { "Type": "String" } }, "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", "Properties": { "Handler": "index.gethtml", "Code": { "S3Bucket": "sam-demo-bucket", "S3Key": "member_portal.zip" }, "Role": { "Fn::GetAtt": [ "ImplicitApiFunctionRole", "Arn" ] }, "Runtime": "nodejs12.x", "Tags": [ { "Value": "SAM", "Key": "lambda:createdBy" } ] } }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": [ "sts:AssumeRole" ], "Effect": "Allow", "Principal": { "Service": [ "lambda.amazonaws.com" ] } } ] }, "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ], "Tags": [ { "Value": "SAM", "Key": "lambda:createdBy" } ] } }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { "Ref": "ExplicitApi" }, "Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", "StageName": "Stage" } }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", "FunctionName": { "Ref": "ImplicitApiFunction" }, "SourceArn": { "Fn::Sub": [ "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/", { "__Stage__": "*", "__ApiId__": { "Ref": "ServerlessRestApi" } } ] } } }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", "Properties": { "EndpointConfiguration": { "Types": [ "SomeValue" ] }, "BodyS3Location": { "Bucket": "sam-demo-bucket", "Key": "webpage_swagger.json" }, "Parameters": { "endpointConfigurationTypes": "SomeValue" } } }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" }, "RestApiId": { "Ref": "ExplicitApi" }, "StageName": "Prod" } }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" }, "RestApiId": { "Ref": "ServerlessRestApi" }, "StageName": "Prod" } }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" }, "Description": "RestApi deployment id: 62b96c1a611878eefb13e8ef66dbc71b9ba3dd19", "StageName": "Stage" } }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", "Properties": { "Body": { "info": { "version": "1.0", "title": { "Ref": "AWS::StackName" } }, "paths": { "/": { "get": { "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ImplicitApiFunction.Arn}/invocations" } }, "responses": {} } } }, "swagger": "2.0" }, "EndpointConfiguration": { "VpcEndpointIds": [ { "Ref": "VpcEndpointId" } ], "Types": [ { "Ref": "EndpointConfigType" } ] }, "Parameters": { "endpointConfigurationTypes": [ { "Ref": "EndpointConfigType" } ] } } } } }