Guest User

AWS CloudFormation

a guest
May 19th, 2021
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.52 KB | None | 0 0
  1. {
  2.   "AWSTemplateFormatVersion": "2010-09-09",
  3.   "Transform": "AWS::Serverless-2016-10-31",
  4.   "Resources": {
  5.     "Myfunc01": {
  6.       "Type": "AWS::Serverless::Function",
  7.       "Properties": {
  8.         "Handler": "index.handler",
  9.         "Runtime": "nodejs12.x",
  10.         "MemorySize": 512,
  11.         "Timeout": 6,
  12.         "Environment": {
  13.           "Variables": {
  14.             "ALTO_FUNCTION_ID": "Myfunc01",
  15.             "ALTO_FUNCTION_NAME": "get-users",
  16.             "ALTO_DEPLOYMENT_TIME": "2021-05-19T08:42:52.693Z",
  17.             "TOPIC_MYSNS01": {
  18.               "Ref": "MySns01"
  19.             },
  20.             "TABLE_DYNAMO01": {
  21.               "Ref": "Dynamo01"
  22.             }
  23.           }
  24.         },
  25.         "Layers": [],
  26.         "Events": {
  27.           "ApiEndpoint03": {
  28.             "Type": "Api",
  29.             "Properties": {
  30.               "Path": "/users",
  31.               "RestApiId": {
  32.                 "Ref": "Api02"
  33.               },
  34.               "Method": "get"
  35.             }
  36.           }
  37.         },
  38.         "Policies": [
  39.           {
  40.             "SNSPublishMessagePolicy": {
  41.               "TopicName": {
  42.                 "Fn::GetAtt": [
  43.                   "MySns01",
  44.                   "TopicName"
  45.                 ]
  46.               }
  47.             }
  48.           },
  49.           {
  50.             "DynamoDBCrudPolicy": {
  51.               "TableName": {
  52.                 "Ref": "Dynamo01"
  53.               }
  54.             }
  55.           }
  56.         ],
  57.         "InlineCode": "module.exports.handler = async (event, context) => { return { statusCode: 200 } }"
  58.       }
  59.     },
  60.     "Api02": {
  61.       "Type": "AWS::Serverless::Api",
  62.       "Properties": {
  63.         "StageName": "Prod"
  64.       }
  65.     },
  66.     "MySns01": {
  67.       "Type": "AWS::SNS::Topic",
  68.       "Properties": {
  69.         "DisplayName": ""
  70.       }
  71.     },
  72.     "Dynamo01": {
  73.       "Type": "AWS::Serverless::SimpleTable",
  74.       "Properties": {
  75.         "PrimaryKey": {
  76.           "Name": "id",
  77.           "Type": "String"
  78.         },
  79.         "ProvisionedThroughput": {
  80.           "ReadCapacityUnits": 5,
  81.           "WriteCapacityUnits": 5
  82.         }
  83.       }
  84.     },
  85.     "NewUser01": {
  86.       "Type": "AWS::Serverless::Function",
  87.       "Properties": {
  88.         "Handler": "index.handler",
  89.         "Runtime": "nodejs12.x",
  90.         "MemorySize": 512,
  91.         "Timeout": 6,
  92.         "Environment": {
  93.           "Variables": {
  94.             "ALTO_FUNCTION_ID": "NewUser01",
  95.             "ALTO_FUNCTION_NAME": "new-user",
  96.             "ALTO_DEPLOYMENT_TIME": "2021-05-19T08:42:52.693Z",
  97.             "TABLE_DYNAMO01": {
  98.               "Ref": "Dynamo01"
  99.             }
  100.           }
  101.         },
  102.         "Layers": [],
  103.         "Events": {
  104.           "ApiEndpoint04": {
  105.             "Type": "Api",
  106.             "Properties": {
  107.               "Path": "/users",
  108.               "RestApiId": {
  109.                 "Ref": "Api02"
  110.               },
  111.               "Method": "post"
  112.             }
  113.           }
  114.         },
  115.         "Policies": [
  116.           {
  117.             "DynamoDBCrudPolicy": {
  118.               "TableName": {
  119.                 "Ref": "Dynamo01"
  120.               }
  121.             }
  122.           }
  123.         ],
  124.         "InlineCode": "module.exports.handler = async (event, context) => { return { statusCode: 200 } }"
  125.       }
  126.     }
  127.   },
  128.   "Outputs": {
  129.     "Domain15Api02StageProd": {
  130.       "Value": {
  131.         "Fn::Sub": [
  132.           "https://${apiId}.execute-api.${AWS::Region}.amazonaws.com/Prod",
  133.           {
  134.             "apiId": {
  135.               "Ref": "Api02"
  136.             }
  137.           }
  138.         ]
  139.       }
  140.     }
  141.   }
  142. }
Advertisement
Add Comment
Please, Sign In to add comment