cloudformation-template-update-stack.json 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. {
  2. "AWSTemplateFormatVersion": "2010-09-09",
  3. "Description": "The AWS CloudFormation template for this Serverless application",
  4. "Resources": {
  5. "ServerlessDeploymentBucket": {
  6. "Type": "AWS::S3::Bucket",
  7. "Properties": {
  8. "BucketEncryption": {
  9. "ServerSideEncryptionConfiguration": [
  10. {
  11. "ServerSideEncryptionByDefault": {
  12. "SSEAlgorithm": "AES256"
  13. }
  14. }
  15. ]
  16. }
  17. }
  18. },
  19. "ServerlessDeploymentBucketPolicy": {
  20. "Type": "AWS::S3::BucketPolicy",
  21. "Properties": {
  22. "Bucket": {
  23. "Ref": "ServerlessDeploymentBucket"
  24. },
  25. "PolicyDocument": {
  26. "Statement": [
  27. {
  28. "Action": "s3:*",
  29. "Effect": "Deny",
  30. "Principal": "*",
  31. "Resource": [
  32. {
  33. "Fn::Join": [
  34. "",
  35. [
  36. "arn:",
  37. {
  38. "Ref": "AWS::Partition"
  39. },
  40. ":s3:::",
  41. {
  42. "Ref": "ServerlessDeploymentBucket"
  43. },
  44. "/*"
  45. ]
  46. ]
  47. },
  48. {
  49. "Fn::Join": [
  50. "",
  51. [
  52. "arn:",
  53. {
  54. "Ref": "AWS::Partition"
  55. },
  56. ":s3:::",
  57. {
  58. "Ref": "ServerlessDeploymentBucket"
  59. }
  60. ]
  61. ]
  62. }
  63. ],
  64. "Condition": {
  65. "Bool": {
  66. "aws:SecureTransport": false
  67. }
  68. }
  69. }
  70. ]
  71. }
  72. }
  73. },
  74. "NumpyLogGroup": {
  75. "Type": "AWS::Logs::LogGroup",
  76. "Properties": {
  77. "LogGroupName": "/aws/lambda/ambt-anoicos-dev-numpy"
  78. }
  79. },
  80. "IamRoleLambdaExecution": {
  81. "Type": "AWS::IAM::Role",
  82. "Properties": {
  83. "AssumeRolePolicyDocument": {
  84. "Version": "2012-10-17",
  85. "Statement": [
  86. {
  87. "Effect": "Allow",
  88. "Principal": {
  89. "Service": [
  90. "lambda.amazonaws.com"
  91. ]
  92. },
  93. "Action": [
  94. "sts:AssumeRole"
  95. ]
  96. }
  97. ]
  98. },
  99. "Policies": [
  100. {
  101. "PolicyName": {
  102. "Fn::Join": [
  103. "-",
  104. [
  105. "ambt-anoicos",
  106. "dev",
  107. "lambda"
  108. ]
  109. ]
  110. },
  111. "PolicyDocument": {
  112. "Version": "2012-10-17",
  113. "Statement": [
  114. {
  115. "Effect": "Allow",
  116. "Action": [
  117. "logs:CreateLogStream",
  118. "logs:CreateLogGroup"
  119. ],
  120. "Resource": [
  121. {
  122. "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/ambt-anoicos-dev*:*"
  123. }
  124. ]
  125. },
  126. {
  127. "Effect": "Allow",
  128. "Action": [
  129. "logs:PutLogEvents"
  130. ],
  131. "Resource": [
  132. {
  133. "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/ambt-anoicos-dev*:*:*"
  134. }
  135. ]
  136. }
  137. ]
  138. }
  139. }
  140. ],
  141. "Path": "/",
  142. "RoleName": {
  143. "Fn::Join": [
  144. "-",
  145. [
  146. "ambt-anoicos",
  147. "dev",
  148. {
  149. "Ref": "AWS::Region"
  150. },
  151. "lambdaRole"
  152. ]
  153. ]
  154. }
  155. }
  156. },
  157. "PythonRequirementsLambdaLayer": {
  158. "Type": "AWS::Lambda::LayerVersion",
  159. "Properties": {
  160. "Content": {
  161. "S3Bucket": {
  162. "Ref": "ServerlessDeploymentBucket"
  163. },
  164. "S3Key": "serverless/ambt-anoicos/dev/1623974011018-2021-06-17T23:53:31.018Z/pythonRequirements.zip"
  165. },
  166. "LayerName": "ambt-anoicos-dev-python-requirements",
  167. "Description": "Python requirements generated by serverless-python-requirements.",
  168. "CompatibleRuntimes": [
  169. "python3.8"
  170. ]
  171. }
  172. },
  173. "NumpyLambdaFunction": {
  174. "Type": "AWS::Lambda::Function",
  175. "Properties": {
  176. "Code": {
  177. "S3Bucket": {
  178. "Ref": "ServerlessDeploymentBucket"
  179. },
  180. "S3Key": "serverless/ambt-anoicos/dev/1623974011018-2021-06-17T23:53:31.018Z/ambt-anoicos.zip"
  181. },
  182. "Handler": "handler.main",
  183. "Runtime": "python3.8",
  184. "FunctionName": "ambt-anoicos-dev-numpy",
  185. "MemorySize": 1024,
  186. "Timeout": 6,
  187. "Role": {
  188. "Fn::GetAtt": [
  189. "IamRoleLambdaExecution",
  190. "Arn"
  191. ]
  192. },
  193. "Layers": [
  194. {
  195. "Ref": "PythonRequirementsLambdaLayer"
  196. }
  197. ]
  198. },
  199. "DependsOn": [
  200. "NumpyLogGroup"
  201. ]
  202. },
  203. "NumpyLambdaVersion4nqiRdtNg2AbGSGlzGV12aNY2OuUh7esxvqofgY": {
  204. "Type": "AWS::Lambda::Version",
  205. "DeletionPolicy": "Retain",
  206. "Properties": {
  207. "FunctionName": {
  208. "Ref": "NumpyLambdaFunction"
  209. },
  210. "CodeSha256": "IVZ5bTPa382jcJBMQHlQd0Zn9gjSEEfl2vSmrUqAhWk="
  211. }
  212. }
  213. },
  214. "Outputs": {
  215. "ServerlessDeploymentBucketName": {
  216. "Value": {
  217. "Ref": "ServerlessDeploymentBucket"
  218. },
  219. "Export": {
  220. "Name": "sls-ambt-anoicos-dev-ServerlessDeploymentBucketName"
  221. }
  222. },
  223. "PythonRequirementsLambdaLayerQualifiedArn": {
  224. "Description": "Current Lambda layer version",
  225. "Value": {
  226. "Ref": "PythonRequirementsLambdaLayer"
  227. },
  228. "Export": {
  229. "Name": "sls-ambt-anoicos-dev-PythonRequirementsLambdaLayerQualifiedArn"
  230. }
  231. },
  232. "PythonRequirementsLambdaLayerHash": {
  233. "Description": "Current Lambda layer hash",
  234. "Value": "35b9f3a28aa474ce779bef4f48b8e95d200c045e",
  235. "Export": {
  236. "Name": "sls-ambt-anoicos-dev-PythonRequirementsLambdaLayerHash"
  237. }
  238. },
  239. "PythonRequirementsLambdaLayerS3Key": {
  240. "Description": "Current Lambda layer S3Key",
  241. "Value": "serverless/ambt-anoicos/dev/1623974011018-2021-06-17T23:53:31.018Z/pythonRequirements.zip",
  242. "Export": {
  243. "Name": "sls-ambt-anoicos-dev-PythonRequirementsLambdaLayerS3Key"
  244. }
  245. },
  246. "NumpyLambdaFunctionQualifiedArn": {
  247. "Description": "Current Lambda function version",
  248. "Value": {
  249. "Ref": "NumpyLambdaVersion4nqiRdtNg2AbGSGlzGV12aNY2OuUh7esxvqofgY"
  250. },
  251. "Export": {
  252. "Name": "sls-ambt-anoicos-dev-NumpyLambdaFunctionQualifiedArn"
  253. }
  254. }
  255. }
  256. }