Skip to main content

snippets_py

Integration

New integration from credential
aws_lambda_client = yepcode.integration.aws_lambda("credential-slug")
New integration from plain authentication data
import boto3

session = boto3.Session(
aws_access_key_id="accessKeyId",
aws_secret_access_key="secretAccessKey",
region_name="region"
)
aws_lambda_client = session.client("lambda")

List Functions

List functions
response = aws_lambda_client.list_functions()

for function in response['Functions']:
print(function)

Invoke Function

Invoke function
import json

payload = {
"foo": "bar"
}

response = aws_lambda_client.invoke(
FunctionName='funcName',
Payload=json.dumps(payload),
)
print(response['Payload'].read().decode('utf-8'))

Get Function

Get function
response = aws_lambda_client.get_function(
FunctionName='funcName',
)

print(response)