{"id":60917,"date":"2016-10-17T19:00:55","date_gmt":"2016-10-17T16:00:55","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=60917"},"modified":"2016-10-17T14:55:08","modified_gmt":"2016-10-17T11:55:08","slug":"java-aws-cloud-using-lambda-api-gateway-cloudformation","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html","title":{"rendered":"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation"},"content":{"rendered":"<p>On a previous <a href=\"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda.html\">post<\/a> we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will integrate it with a http endpoint using <a href=\"https:\/\/aws.amazon.com\/api-gateway\/\">AWS API Gateway<\/a>.<\/p>\n<blockquote>\n<p>Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. With a few clicks in the AWS Management Console, you can create an API that acts as a \u201cfront door\u201d for applications to access data, business logic, or functionality from your back-end services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any Web application<\/p>\n<\/blockquote>\n<p>For this example imagine API gateway as if it is an HTTP Connector.\u00a0We will change our original function in order to implement a division.<\/p>\n<pre class=\"brush:java\">package com.gkatzioura.deployment.lambda;\r\n\r\nimport com.amazonaws.services.lambda.runtime.Context;\r\nimport com.amazonaws.services.lambda.runtime.RequestHandler;\r\n\r\nimport java.math.BigDecimal;\r\nimport java.util.Map;\r\nimport java.util.logging.Logger;\r\n\r\n\/**\r\n * Created by gkatzioura on 9\/10\/2016.\r\n *\/\r\npublic class RequestFunctionHandler implements RequestHandler&lt;Map&lt;String,String&gt;,String&gt; {\r\n\r\n    private static final String NUMERATOR_KEY = \"numerator\";\r\n    private static final String DENOMINATOR_KEY = \"denominator\";\r\n\r\n    private static final Logger LOGGER = Logger.getLogger(RequestFunctionHandler.class.getName());\r\n\r\n    public String handleRequest(Map &lt;String,String&gt; values, Context context) {\r\n\r\n        LOGGER.info(\"Handling request\");\r\n\r\n        if(!values.containsKey(NUMERATOR_KEY)||!values.containsKey(DENOMINATOR_KEY)) {\r\n            return \"You need both numberator and denominator\";\r\n        }\r\n\r\n        try {\r\n            BigDecimal numerator = new BigDecimal(values.get(NUMERATOR_KEY));\r\n            BigDecimal denominator= new BigDecimal(values.get(DENOMINATOR_KEY));\r\n            return  numerator.divide(denominator).toString();\r\n        } catch (Exception e) {\r\n            return \"Please provide valid values\";\r\n        }\r\n    }\r\n\r\n}<\/pre>\n<p>Then we will change our lambda code and update it on s3.<\/p>\n<pre class=\"brush:bash\">aws s3 cp build\/distributions\/JavaLambdaDeployment.zip s3:\/\/lambda-functions\/JavaLambdaDeployment.zip<\/pre>\n<p>Next step is to update our CloudFormation template and add the api gateway forwarding requests to our lambda function.<\/p>\n<p>First we have to declare our Rest api<\/p>\n<pre class=\"brush:java\">\"AGRA16PAA\": {\r\n      \"Type\": \"AWS::ApiGateway::RestApi\",\r\n      \"Properties\": {\"Name\": \"CalculationApi\"}\r\n    }<\/pre>\n<p>Then we need to add a rest resource. Inside the DependsOn element we can see the id of our rest api. Therefore cloudwatch will create the resource after the rest api has been created.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">\"AGR2JDQ8\": {\r\n      \"Type\": \"AWS::ApiGateway::Resource\",\r\n      \"Properties\": {\r\n        \"RestApiId\": {\"Ref\": \"AGRA16PAA\"},\r\n        \"ParentId\": {\r\n          \"Fn::GetAtt\": [\"AGRA16PAA\",\"RootResourceId\"]\r\n        },\r\n        \"PathPart\": \"divide\"\r\n      },\r\n      \"DependsOn\": [\r\n        \"AGRA16PAA\"\r\n      ]\r\n    }<\/pre>\n<p>Another crucial part is to add a permission in order to be able to invoke our lambda function.<\/p>\n<pre class=\"brush:java\">\"LPI6K5\": {\r\n      \"Type\": \"AWS::Lambda::Permission\",\r\n      \"Properties\": {\r\n        \"Action\": \"lambda:invokeFunction\",\r\n        \"FunctionName\": {\"Fn::GetAtt\": [\"LF9MBL\", \"Arn\"]},\r\n        \"Principal\": \"apigateway.amazonaws.com\",\r\n        \"SourceArn\": {\"Fn::Join\": [\"\",\r\n          [\"arn:aws:execute-api:\", {\"Ref\": \"AWS::Region\"}, \":\", {\"Ref\": \"AWS::AccountId\"}, \":\", {\"Ref\": \"AGRA16PAA\"}, \"\/*\"]\r\n        ]}\r\n      }\r\n    }<\/pre>\n<p>Last step would be to add the api gateway method in order to be able to invoke our lambda function from the api gateway. Furthermore we will add an api gateway deployment instruction.<\/p>\n<pre class=\"brush:java\">\"Deployment\": {\r\n      \"Type\": \"AWS::ApiGateway::Deployment\",\r\n      \"Properties\": {\r\n        \"RestApiId\": { \"Ref\": \"AGRA16PAA\" },\r\n        \"Description\": \"First Deployment\",\r\n        \"StageName\": \"StagingStage\"\r\n      },\r\n      \"DependsOn\" : [\"AGM25KFD\"]\r\n    },\r\n    \"AGM25KFD\": {\r\n      \"Type\": \"AWS::ApiGateway::Method\",\r\n      \"Properties\": {\r\n        \"AuthorizationType\": \"NONE\",\r\n        \"HttpMethod\": \"POST\",\r\n        \"ResourceId\": {\"Ref\": \"AGR2JDQ8\"},\r\n        \"RestApiId\": {\"Ref\": \"AGRA16PAA\"},\r\n        \"Integration\": {\r\n          \"Type\": \"AWS\",\r\n          \"IntegrationHttpMethod\": \"POST\",\r\n          \"IntegrationResponses\": [{\"StatusCode\": 200}],\r\n          \"Uri\": {\r\n            \"Fn::Join\": [\r\n              \"\",\r\n              [\r\n                \"arn:aws:apigateway:\",\r\n                {\"Ref\": \"AWS::Region\"},\r\n                \":lambda:path\/2015-03-31\/functions\/\",\r\n                {\"Fn::GetAtt\": [\"LF9MBL\", \"Arn\"]},\r\n                \"\/invocations\"\r\n              ]\r\n            ]\r\n          }\r\n        },\r\n        \"MethodResponses\": [{\r\n          \"StatusCode\": 200\r\n        }]\r\n      }<\/pre>\n<p>So we ended up with our new cloudwatch configuration.<\/p>\n<pre class=\"brush:java\">{\r\n  \"AWSTemplateFormatVersion\": \"2010-09-09\",\r\n  \"Resources\": {\r\n    \"LF9MBL\": {\r\n      \"Type\": \"AWS::Lambda::Function\",\r\n      \"Properties\": {\r\n        \"Code\": {\r\n          \"S3Bucket\": \"lambda-functions\",\r\n          \"S3Key\": \"JavaLambdaDeployment.zip\"\r\n        },\r\n        \"FunctionName\": \"SimpleRequest\",\r\n        \"Handler\": \"com.gkatzioura.deployment.lambda.RequestFunctionHandler\",\r\n        \"MemorySize\": 128,\r\n        \"Role\": \"arn:aws:iam::274402012893:role\/lambda_basic_execution\",\r\n        \"Runtime\": \"java8\"\r\n      }\r\n    },\r\n    \"Deployment\": {\r\n      \"Type\": \"AWS::ApiGateway::Deployment\",\r\n      \"Properties\": {\r\n        \"RestApiId\": { \"Ref\": \"AGRA16PAA\" },\r\n        \"Description\": \"First Deployment\",\r\n        \"StageName\": \"StagingStage\"\r\n      },\r\n      \"DependsOn\" : [\"AGM25KFD\"]\r\n    },\r\n    \"AGM25KFD\": {\r\n      \"Type\": \"AWS::ApiGateway::Method\",\r\n      \"Properties\": {\r\n        \"AuthorizationType\": \"NONE\",\r\n        \"HttpMethod\": \"POST\",\r\n        \"ResourceId\": {\"Ref\": \"AGR2JDQ8\"},\r\n        \"RestApiId\": {\"Ref\": \"AGRA16PAA\"},\r\n        \"Integration\": {\r\n          \"Type\": \"AWS\",\r\n          \"IntegrationHttpMethod\": \"POST\",\r\n          \"IntegrationResponses\": [{\"StatusCode\": 200}],\r\n          \"Uri\": {\r\n            \"Fn::Join\": [\r\n              \"\",\r\n              [\r\n                \"arn:aws:apigateway:\",\r\n                {\"Ref\": \"AWS::Region\"},\r\n                \":lambda:path\/2015-03-31\/functions\/\",\r\n                {\"Fn::GetAtt\": [\"LF9MBL\",\"Arn\"]},\r\n                \"\/invocations\"\r\n              ]\r\n            ]\r\n          }\r\n        },\r\n        \"MethodResponses\": [{\"StatusCode\": 200}]\r\n      },\r\n      \"DependsOn\": [\"LF9MBL\",\"AGR2JDQ8\",\"LPI6K5\"]\r\n    },\r\n    \"AGR2JDQ8\": {\r\n      \"Type\": \"AWS::ApiGateway::Resource\",\r\n      \"Properties\": {\r\n        \"RestApiId\": {\"Ref\": \"AGRA16PAA\"},\r\n        \"ParentId\": {\r\n          \"Fn::GetAtt\": [\"AGRA16PAA\",\"RootResourceId\"]\r\n        },\r\n        \"PathPart\": \"divide\"\r\n      },\r\n      \"DependsOn\": [\"AGRA16PAA\"]\r\n    },\r\n    \"AGRA16PAA\": {\r\n      \"Type\": \"AWS::ApiGateway::RestApi\",\r\n      \"Properties\": {\r\n        \"Name\": \"CalculationApi\"\r\n      }\r\n    },\r\n    \"LPI6K5\": {\r\n      \"Type\": \"AWS::Lambda::Permission\",\r\n      \"Properties\": {\r\n        \"Action\": \"lambda:invokeFunction\",\r\n        \"FunctionName\": {\"Fn::GetAtt\": [\"LF9MBL\", \"Arn\"]},\r\n        \"Principal\": \"apigateway.amazonaws.com\",\r\n        \"SourceArn\": {\"Fn::Join\": [\"\",\r\n          [\"arn:aws:execute-api:\", {\"Ref\": \"AWS::Region\"}, \":\", {\"Ref\": \"AWS::AccountId\"}, \":\", {\"Ref\": \"AGRA16PAA\"}, \"\/*\"]\r\n        ]}\r\n      }\r\n    }\r\n }\r\n}<\/pre>\n<p>Last but not least, we have to update our previous cloudformation stack.<\/p>\n<p>So we uploaded our latest template<\/p>\n<pre class=\"brush:bash\">aws s3 cp cloudformationjavalambda2.template s3:\/\/cloudformation-templates\/cloudformationjavalambda2.template<\/pre>\n<p>And all we have to do is to update our stack.<\/p>\n<pre class=\"brush:bash\">aws cloudformation update-stack --stack-name JavaLambdaStack --template-url https:\/\/s3.amazonaws.com\/cloudformation-templates\/cloudformationjavalambda2.template<\/pre>\n<p>Our stack has just been updated.<br \/>\nWe can got to our api gateway endpoint and try to issue a post.<\/p>\n<pre class=\"brush:bash\">curl -H \"Content-Type: application\/json\" -X POST -d '{\"numerator\":1,\"denominator\":\"2\"}' https:\/\/{you api gateway endpoint}\/StagingStage\/divide\r\n\"0.5\"<\/pre>\n<p>You can find the sourcecode on <a href=\"https:\/\/github.com\/gkatzioura\/AWSJavaDeploy\">github<\/a>.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/egkatzioura.wordpress.com\/2016\/10\/17\/java-on-the-aws-cloud-using-lambda-api-gateway-and-cloudformation\/\">Java on the AWS cloud using Lambda, Api Gateway and CloudFormation<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Emmanouil Gkatziouras at the <a href=\"http:\/\/egkatzioura.wordpress.com\/\">gkatzioura<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will integrate it with a http endpoint using AWS API Gateway. Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, &hellip;<\/p>\n","protected":false},"author":936,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[331,1300,1399],"class_list":["post-60917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-amazon-aws","tag-cloud-computing","tag-cloudformation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java on the AWS cloud using Lambda, Api Gateway and CloudFormation - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-17T16:00:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Emmanouil Gkatziouras\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Emmanouil Gkatziouras\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\"},\"author\":{\"name\":\"Emmanouil Gkatziouras\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/5eee031b356c7682e1fd24c8297561c6\"},\"headline\":\"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation\",\"datePublished\":\"2016-10-17T16:00:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\"},\"wordCount\":362,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Amazon AWS\",\"Cloud Computing\",\"CloudFormation\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\",\"name\":\"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2016-10-17T16:00:55+00:00\",\"description\":\"On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/10\\\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/5eee031b356c7682e1fd24c8297561c6\",\"name\":\"Emmanouil Gkatziouras\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c6d031d211ab786ec335687ad6f3f076f93f47e24c92d78041d2f805ee6c291?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c6d031d211ab786ec335687ad6f3f076f93f47e24c92d78041d2f805ee6c291?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c6d031d211ab786ec335687ad6f3f076f93f47e24c92d78041d2f805ee6c291?s=96&d=mm&r=g\",\"caption\":\"Emmanouil Gkatziouras\"},\"description\":\"He is a versatile software engineer with experience in a wide variety of applications\\\/services.He is enthusiastic about new projects, embracing new technologies, and getting to know people in the field of software.\",\"sameAs\":[\"http:\\\/\\\/egkatzioura.wordpress.com\\\/\",\"https:\\\/\\\/gr.linkedin.com\\\/in\\\/gkatziourasemmanouil\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/emmanouil-gkatziouras\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation - Java Code Geeks","description":"On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html","og_locale":"en_US","og_type":"article","og_title":"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation - Java Code Geeks","og_description":"On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will","og_url":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-10-17T16:00:55+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Emmanouil Gkatziouras","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Emmanouil Gkatziouras","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html"},"author":{"name":"Emmanouil Gkatziouras","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/5eee031b356c7682e1fd24c8297561c6"},"headline":"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation","datePublished":"2016-10-17T16:00:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html"},"wordCount":362,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Amazon AWS","Cloud Computing","CloudFormation"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html","url":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html","name":"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2016-10-17T16:00:55+00:00","description":"On a previous post we implemented a java based aws lambda function and deployed it using CloudFront.\u00a0Since we have our lambda function set up we will","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/10\/java-aws-cloud-using-lambda-api-gateway-cloudformation.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Java on the AWS cloud using Lambda, Api Gateway and CloudFormation"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/5eee031b356c7682e1fd24c8297561c6","name":"Emmanouil Gkatziouras","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c6d031d211ab786ec335687ad6f3f076f93f47e24c92d78041d2f805ee6c291?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c6d031d211ab786ec335687ad6f3f076f93f47e24c92d78041d2f805ee6c291?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c6d031d211ab786ec335687ad6f3f076f93f47e24c92d78041d2f805ee6c291?s=96&d=mm&r=g","caption":"Emmanouil Gkatziouras"},"description":"He is a versatile software engineer with experience in a wide variety of applications\/services.He is enthusiastic about new projects, embracing new technologies, and getting to know people in the field of software.","sameAs":["http:\/\/egkatzioura.wordpress.com\/","https:\/\/gr.linkedin.com\/in\/gkatziourasemmanouil"],"url":"https:\/\/www.javacodegeeks.com\/author\/emmanouil-gkatziouras"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/60917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/936"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=60917"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/60917\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=60917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=60917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=60917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}