Python runtime support for Architect provisioned AWS Lambda functions
cd path/to/lambda
pip install --target ./vendor architect-functions
# example lambda function
import json
import arc
def handler(event, context):
return {'body': json.dumps(arc.reflect())}
arc.reflect
returns a dict of the the current AWS resources.
Example output:
{
"events": {
"ping": "arn:aws:sns:us-east-1:555:TestStaging-PingTopic-11111111111",
},
"queues": {
"continuum": "https://sqs.us-east-1.amazonaws.com/555/TestStaging-ContinuumQueue-8888888888"
},
"static": {
"bucket": "teststaging-staticbucket-11111111",
"fingerprint": "false"
},
"tables": {
"noises": "TestStaging-NoisesTable-111111111"
},
"ws": {
"https": "https://xxx.execute-api.us-east-1.amazonaws.com/production/@connections",
"wss": "wss://xxx.execute-api.us-east-1.amazonaws.com/production"
}
}
arc.http.session_read()
arc.http.session_write()
arc.ws.send(id, payload)
arc.events.publish(name, payload)
arc.queues.publish(name, payload)
arc.tables.name(tablename)
Install Pipenv
pipenv install --dev
pipenv run pytest
pipenv run python -m pep517.build --source --binary --out-dir dist/ .
twine upload dist/*