Skip to content

Instantly share code, notes, and snippets.

@okram999
Last active November 6, 2018 19:32
Show Gist options
  • Save okram999/ca28a924771aee5f08f198cede3bd1d3 to your computer and use it in GitHub Desktop.
Save okram999/ca28a924771aee5f08f198cede3bd1d3 to your computer and use it in GitHub Desktop.
Lamba
502 serverless
503 serverless -version
504 serverless config credentials --provider aws --key XXXXXXX --secret XXXXX --profile serverlessAdmin
### AWS profile for sls cli
You must specify the aws profile | region | timeout | memorySize in the serverless.yml
provider:
name: aws
runtime: python3.6
profile: serverlessAdmin
region: us-east-1
########################3
506 sls
507 mkdir lambda
508 cd lambda/
509 sls create --template aws-python --path hello-world-python
511 cd hello-world-python/
513 sls deploy -v
### invoke function
sls invoke -f hello -l
### Deploy just the function
sls deploy function -f hello
##Get logs on console
sls logs -f hello -t
##Remove the function
sls remove
####
# you can add statements to the Lambda function's IAM Role here in the serverless.yaml file
iamRoleStatements:
- Effect: "Allow"
Action:
- "lambda:*"
Resource:
- "*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment