Helpers for working with the Architect generated runtime resources.
cd path/to/lambda
bundle init
bundle install --path vendor/bundle
bundle add architect-functions
# example lambda function
require 'json'
require 'architect/functions'
def handler
{body: JSON.generate(Arc.reflect)}
end
Arc.reflect
returns a hash 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"
}
}
read(request)
read the current session cookiewrite(session)
write to the current session; returns a cookie string
publish({name, payload})
to an SNS Topic
publish({name, payload})
to an SQS Queue
send({id, payload})
a message to a Web Socket
name(table)
return the physicalID for the given table name
gem build architect-functions.gemspec
gem push architect-functions-X.X.X.gem