Variable Name | Description |
---|---|
_HANDLER | The handler location configured on the function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF | |
deb http://repo.pritunl.com/stable/apt focal main | |
EOF | |
# Import signing key from keyserver | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A | |
# Alternative import from download if keyserver offline | |
curl https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | sudo apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signal | |
import boto3 | |
import os | |
def lambda_handler(event, context): | |
signal.alarm(int(context.get_remaining_time_in_millis() / 1000) - 1) | |
signal.signal(signal.SIGALRM, timeout_handler) | |
# Do other stuff | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
def lambda_handler(event, context): | |
FILE_NAME = '/mnt/lambda/test2.txt' | |
with open(FILE_NAME, "w") as F: | |
F.write("Hello from lambda") | |
os.system("ls -alth /mnt/lambda/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sysntax | |
# comments | |
command argument argument1… | |
# Example | |
Run echo "print from dockerfile" |
Triggers | Description | Requirement |
---|---|---|
API Gateway | Trigger AWS Lambda function over HTTPS |
Settings | Limits | ||
---|---|---|
Description | Settings | Limits | Explained | Can be increased |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"key1": "value1", | |
"key2": "value2", | |
"key3": "value3" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "aws_region" { | |
default = "us-east-1" | |
type = string | |
} | |
provider "aws" { | |
region = var.aws_region | |
} | |
################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
import requests | |
from datetime import datetime, timedelta | |
CLIENT = boto3.client('ce') | |
SLACK_WEBHOOK_URL = '' # Enter the slack webhook url. | |
def lambda_handler(event, context): |
NewerOlder