{"id":4834,"date":"2023-01-28T11:37:35","date_gmt":"2023-01-28T08:07:35","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/aws-cloud-quest-templating-serverless-applications-59bi\/"},"modified":"2023-01-28T11:37:35","modified_gmt":"2023-01-28T08:07:35","slug":"aws-cloud-quest-templating-serverless-applications-59bi","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/aws-cloud-quest-templating-serverless-applications-59bi\/","title":{"rendered":"AWS Cloud Quest: \u0642\u0627\u0644\u0628\u200c\u0628\u0646\u062f\u06cc \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u0628\u062f\u0648\u0646 \u0633\u0631\u0648\u0631"},"content":{"rendered":"<div data-article-id=\"1344215\" id=\"article-body\">\n<p>\u0627\u06cc\u0646 \u0686\u0627\u0644\u0634 DIY \u0648\u0638\u06cc\u0641\u0647 Templating Serverless Applications \u062f\u0631 AWS Cloud Quest \u0627\u0633\u062a.<\/p>\n<h3>\n<p>  \u0645\u0631\u0627\u062d\u0644 DIY:<br \/>\n<\/h3>\n<ol>\n<li>\n<p>\u06cc\u06a9 \u062c\u062f\u0648\u0644 DynamoDB \u0622\u0645\u0627\u0632\u0648\u0646 \u0631\u0627 \u0628\u0647 \u0642\u0627\u0644\u0628 AWS SAM \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f <code>template.yaml<\/code>\u060c \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u06cc\u0634\u062a\u0631\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0628\u062e\u0648\u0627\u0646\u06cc\u062f<\/p>\n<pre class=\"highlight plaintext\"><code>AWSTemplateFormatVersion: '2010-09-09'\nTransform: AWS::Serverless-2016-10-31\nDescription: &gt;\n  appfn\n\n  Sample SAM Template for appfn\n\n# More info about Globals: https:\/\/github.com\/awslabs\/serverless-application-model\/blob\/master\/docs\/globals.rst\nGlobals:\n  Function:\n    Timeout: 3\n\nResources:\n  HelloWorldFunction:\n    Type: AWS::Serverless::Function # More info about Function Resource: https:\/\/github.com\/awslabs\/serverless-application-model\/blob\/master\/versions\/2016-10-31.md#awsserverlessfunction\n    Properties:\n      CodeUri: hello_world\/\n      Handler: app.lambda_handler\n      Runtime: python3.7\n      Events:\n        HelloWorld:\n          Type: Api # More info about API Event Source: https:\/\/github.com\/awslabs\/serverless-application-model\/blob\/master\/versions\/2016-10-31.md#api\n          Properties:\n            Path: \/hello\n            Method: get\n  DynamoDBTable:\n    Type: AWS::DynamoDB::Table\n    Properties: \n      AttributeDefinitions: \n        - AttributeName: id\n          AttributeType: S\n      KeySchema: \n        - AttributeName: id\n          KeyType: HASH\n      ProvisionedThroughput: \n        ReadCapacityUnits: 5\n        WriteCapacityUnits: 5\n      StreamSpecification:\n        StreamViewType: NEW_IMAGE\nOutputs:\n  # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function\n  # Find out more about other implicit resources you can reference within SAM\n  # https:\/\/github.com\/awslabs\/serverless-application-model\/blob\/master\/docs\/internals\/generated_resources.rst#api\n  HelloWorldApi:\n    Description: \"API Gateway endpoint URL for Prod stage for Hello World function\"\n    Value: !Sub \"https:\/\/${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com\/Prod\/hello\/\"\n  HelloWorldFunction:\n    Description: \"Hello World Lambda Function ARN\"\n    Value: !GetAtt HelloWorldFunction.Arn\n  HelloWorldFunctionIamRole:\n    Description: \"Implicit IAM Role created for Hello World function\"\n    Value: !GetAtt HelloWorldFunctionRole.Arn\n<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0642\u0627\u0644\u0628 AWS SAM \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f<\/p>\n<\/li>\n<li>\n<p>\u0628\u0647 \u0631\u0648\u0632 \u0631\u0633\u0627\u0646\u06cc \u0631\u0627 \u0628\u0647 AWS CodeCommit \u0641\u0634\u0627\u0631 \u062f\u0647\u06cc\u062f<\/p>\n<pre class=\"highlight plaintext\"><code>git add .\ngit commit -m \"diy\"\ngit push\n<\/code><\/pre>\n<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u0627\u06cc\u0646 \u0686\u0627\u0644\u0634 DIY \u0648\u0638\u06cc\u0641\u0647 Templating Serverless Applications \u062f\u0631 AWS Cloud Quest \u0627\u0633\u062a. \u0645\u0631\u0627\u062d\u0644 DIY: \u06cc\u06a9 \u062c\u062f\u0648\u0644 DynamoDB \u0622\u0645\u0627\u0632\u0648\u0646 \u0631\u0627 \u0628\u0647 \u0642\u0627\u0644\u0628 AWS SAM \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f template.yaml\u060c \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u06cc\u0634\u062a\u0631\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0628\u062e\u0648\u0627\u0646\u06cc\u062f AWSTemplateFormatVersion: &#8216;2010-09-09&#8217; Transform: AWS::Serverless-2016-10-31 Description: &gt; appfn Sample SAM Template for appfn # More info about Globals: https:\/\/github.com\/awslabs\/serverless-application-model\/blob\/master\/docs\/globals.rst &hellip;<\/p>\n","protected":false},"author":2,"featured_media":4835,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-4834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/4834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=4834"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/4834\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/4835"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=4834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=4834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=4834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}