-
Notifications
You must be signed in to change notification settings - Fork 2.4k
docs: add hello world example with VPCConfig #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e3744f0
1f3d169
8098860
54efd32
a996341
8ef46b6
6aeb2bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
console.log('Loading function'); | ||
|
||
exports.handler = (event, context, callback) => { | ||
callback(null, 'Hello World!'); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
AWSTemplateFormatVersion : '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: A hello world application with VPC Access. | ||
|
||
Resources: | ||
HelloWorldFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs6.10 | ||
|
||
CodeUri: src/ | ||
Policies: | ||
- VPCAccessPolicy: {} | ||
# This policy gives permission for Lambdas to create/manage ENIs | ||
# SAM Policy templates you can use: https://github.com/awslabs/serverless-application-model/blob/develop/examples/2016-10-31/policy_templates/all_policy_templates.yaml | ||
VpcConfig: | ||
SecurityGroupIds: | ||
- String # add Security Group ID(s) for this Lambda | ||
|
||
SubnetIds: | ||
- String # add VPC Subnet(s) for this Lambda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll soon be able to do hello-world examples (examples where the function logic itself isn't important) like this:
InlineCode
has been merged into develop and will go out in the next release. Until then, we can just set this file to simply beexports.handler = async () => 'Hello world!'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty cool!!!! Changed file following this format