Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
/ functions-ruby Public archive

AWS Lambda Ruby runtime helpers for Architect apps

Notifications You must be signed in to change notification settings

architect/functions-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arc-functions-ruby

Helpers for working with the Architect generated runtime resources.

Install

cd path/to/lambda
bundle init
bundle install --path vendor/bundle 
bundle add architect-functions

API

# example lambda function
require 'json'
require 'architect/functions'

def handler
  {body: JSON.generate(Arc.reflect)}
end

Arc

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"
  }
}

Arc::HTTP::Session

  • read(request) read the current session cookie
  • write(session) write to the current session; returns a cookie string

Arc::Events

  • publish({name, payload}) to an SNS Topic

Arc::Queues

  • publish({name, payload}) to an SQS Queue

Arc::WS

  • send({id, payload}) a message to a Web Socket

Arc::Tables

  • name(table) return the physicalID for the given table name

Releasing

gem build architect-functions.gemspec
gem push architect-functions-X.X.X.gem

About

AWS Lambda Ruby runtime helpers for Architect apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages