Skip to content

Commit ac8d4da

Browse files
author
Justin D. Fetherolf
committed
Add lambda snippets.
This creates snippets for the 4 (current) lambda cloudformation blocks: lambda function, lambda version, lambda permission, and lambda alias.
1 parent b3f3923 commit ac8d4da

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

snippets/snippets.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,30 @@
245245
"description": "",
246246
"scope": "source.cloudformation"
247247
},
248+
"lambda-alias": {
249+
"prefix": "lambda-alias",
250+
"body": "\r\n\"${1:lambdaAlias}\": {\r\n \"Type\": \"AWS::Lambda::Alias\",\r\n \"Properties\": {\r\n \"FunctionName\": \"${2}\",\r\n \"FunctionVersion\": \"${3}\",\r\n \"Name\": \"${4}\",\r\n \"Description\": \"${5}\"\r\n }\r\n}\r\n",
251+
"description": "",
252+
"scope": "source.cloudformation"
253+
},
254+
"lambda-function": {
255+
"prefix": "lambda-function",
256+
"body": "\r\n\"${1:lambdaFunction}\": {\r\n \"Type\": \"AWS::Lambda::Function\",\r\n \"Properties\": {\r\n \"Code\": {\r\n \"S3Bucket\": \"${2}\",\r\n \"S3Key\": \"${3}\",\r\n \"S3ObjectVersion\": \"${4}\",\r\n \"ZipFile\": \"${5}\"\r\n },\r\n \"Handler\": \"${6}\",\r\n \"Role\": \"${7}\",\r\n \"Runtime\": \"${8}\",\r\n \"FunctionName\": \"${9}\",\r\n \"MemorySize\": ${10:128},\r\n \"Timeout\": ${11:5},\r\n \"KmsKeyArn\": \"${12}\",\r\n \"Environment\": {\r\n \"Variables\": {\r\n \"\":\"\",\r\n \"\":\"\"\r\n }\r\n },\r\n \"VpcConfig\": {\r\n \"SecurityGroupIds\": [ ],\r\n \"SubnetIds\": [ ]\r\n },\r\n \"Description\": \"${13}\"\r\n }\r\n}\r\n",
257+
"description": "",
258+
"scope": "source.cloudformation"
259+
},
260+
"lambda-permission": {
261+
"prefix": "lambda-permission",
262+
"body": "\r\n\"${1:lambdaPermission}\": {\r\n \"Type\": \"AWS::Lambda::Permission\",\r\n \"Properties\": {\r\n \"Action\": \"${2}\",\r\n \"FunctionName\": \"${3}\",\r\n \"Principal\": \"${4}\",\r\n \"SourceAccount\": \"${5}\",\r\n \"SourceArn\": \"${6}\"\r\n }\r\n}\r\n",
263+
"description": "",
264+
"scope": "source.cloudformation"
265+
},
266+
"lambda-version": {
267+
"prefix": "lambda-version",
268+
"body": "\r\n\"${1:lambdaVersion}\": {\r\n \"Type\": \"AWS::Lambda::Version\",\r\n \"Properties\": {\r\n \"CodeSha256\": \"${2}\",\r\n \"Description\": \"${3}\",\r\n \"FunctionName\": \"${4}\"\r\n }\r\n}\r\n",
269+
"description": "",
270+
"scope": "source.cloudformation"
271+
},
248272
"launch-config": {
249273
"prefix": "launch-config",
250274
"body": "\r\n\"${1:launchConfigName}\": {\r\n \"Type\" : \"AWS::AutoScaling::LaunchConfiguration\",\r\n \"Properties\" : {\r\n \"IamInstanceProfile\" : ${2:\"--\"},\r\n \"ImageId\" : ${3:\"--\"},\r\n \"InstanceMonitoring\" : ${4:\"--\"},\r\n \"InstanceType\" : \"${5:--}\",\r\n \"KeyName\" : ${6:\"--\"},\r\n \"SecurityGroups\" : [ ${7:\"--\"} ],\r\n \"UserData\" : {\r\n \"Fn::Base64\": \r\n { \"Fn::Join\": [\r\n \"\",\r\n [\r\n \"#!/bin/bash -ex\",\r\n \"${8:-}\"\r\n ]\r\n \r\n ] \r\n }\r\n }\r\n }\r\n}\r\n",
@@ -647,4 +671,4 @@
647671
"description": "",
648672
"scope": "source.cloudformation"
649673
}
650-
}
674+
}

0 commit comments

Comments
 (0)