Skip to main content

Opinionated Modular Cloud Deployment Tool (EasySAM)

Project description

EasySAM - Opinionated Modular Cloud Deployment Tool

EasySAM is a simple, opinionated tool for deploying cloud resources with a focus on simplicity and modularity. It provides a streamlined way to define and deploy AWS resources using YAML configuration files, making cloud infrastructure management more accessible and maintainable.

Features

  • Simple YAML-based resource definitions
  • Modular architecture with import support
  • Comprehensive AWS resource support:
    • Lambda functions
    • DynamoDB tables
    • S3 buckets
    • SQS queues
    • Kinesis streams
    • API Gateway integrations
  • Easy initialization of new projects

Installation

pip install easysam

Quick Start

  1. Initialize a new application:
easysam init my-app
  1. Deploy your application:
easysam deploy my-app my-stack-name

For more options, use the --help flag:

easysam --help

Prerequisites

  • Python 3.8 or higher
  • AWS Credentials Configured
  • AWS SAM CLI

Usage

First, initialize a new application. This command creates a new directory with the given name and generates the necessary files for a single lambda function and table. This version only supports AWS as a backend, and Python as a language.

easysam init <app-name>

Deploy the application:

easysam deploy <app-directory> <aws-stack-name>

For more options, use the --help flag:

easysam --help

Resource Definitions

The entry point for all cloud resources definitions in the resources.yaml file. See example applications for how applications are structures.

Table Definitions

tables:
  - name: String (e.g., Items)
    attributes:
      - name: String (e.g., ItemID)
        type: String (e.g., S), dynamodb type
        hash: Boolean Optional (e.g., true), means Partition Key
        range: Boolean Optional (e.g., true) means Sort Key
    indices:
      - name: String
        attributes:
          - name: String
            type: String
            hash: Boolean Optional
            range: Boolean Optional

Bucket Definitions

buckets:
  - name: String (e.g., my-bucket)
    public Boolean Optional (e.g., true), means Public read policy

Queue Definitions

queues:
  - name: String (e.g., my-queue)

Stream Definitions

streams:
  - name: String (e.g., my-stream)

Lambda Definition

  - name: String (e.g., my-lambda)
    uri: String (i.e., local path to the source)
    tables:
      - String (e.g., Items)
    polls:
      - String (e.g., my-stream) - incoming stream's name
    buckets:
      - String (e.g., my-bucket)
    send:
      - String (e.g., my-queue) - outgoing queue's name
    services:
      - comprehend

API Gateway Definition

Lambda Function Integration

  path: # (e.g., /my-lambda)
    function: String # (e.g., my-lambda)
    authorizer: String # (e.g., my-authorizer)
    greedy: Boolean # (e.g., false)

Direct DynamoDB Integration

  path: # (e.g., /my-lambda)
    integration: dynamo
    method: String # (e.g., get)
    parameters: [String] # (e.g., [channel])
    role: GatewayDynamoRole
    action: String # (e.g., GetItem)
    requestTemplate: VTL Template 
    responseTemplateFile: VTL File Path

Direct SQS Integration

  path: # (e.g., /my-lambda)
    integration: sqs
    method: String # (e.g., post)
    role: GatewaySQSRole
    queue: String # (e.g., my-queue)
    requestTemplate: String # VTL Template
    responseTemplateFile: String # VTL File Path
    authorizer: String # (e.g., my-authorizer)

Import

import:
  - <directory>

The import directive searches recursively for easysam.yaml files (local definitions) in the specified directory and merges them into the current template.

Local Lambda Definition

lambda:
  name: <name>
  resources:
    tables:
      - <table>
    buckets:
      - <bucket>
    send:
      - <queue>
    polls:
      - <stream>
  integration:
    path: <path>
    open: <boolean>
    greedy: <boolean>
    authorizer: <authorizer-lambda-name>

Locally-defined lambda URI is set to the path of the easysam.yaml file.

Local Import

import:
  - <file>

Prismarine Support

prismarine:
  default-base: <base-path>
  tables:
    - package: <package-to-import>
      base: <optional-base-path>

Development

Setting up the development environment

  1. Clone the repository:
git clone https://github.com/adsight-app/easysam.git
cd easysam
  1. Install development dependencies and activate the virtual environment:
uv sync
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

Contributing

We welcome contributions! Please see our Contributing Guide for details on how to submit pull requests, report issues, and suggest improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please: 2. Search existing issues 3. Create a new issue if needed

Changelog

See CHANGELOG.md for a list of changes between versions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easysam-1.0.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easysam-1.0.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file easysam-1.0.0.tar.gz.

File metadata

  • Download URL: easysam-1.0.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for easysam-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d60fe1dd0ff94391f70bc370cc0e7dab9aacfa7afc5239a21264aa210956a259
MD5 d9525392bda30c259c8e79178f66d3b4
BLAKE2b-256 2cca49c574ac4d321f5b92020cc4a7f2ca9c461980569d063f866b91c32a8c2d

See more details on using hashes here.

File details

Details for the file easysam-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: easysam-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for easysam-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c1b54349b27400a26205869c29fa22871877fe15d70dbf46616d5632679959b
MD5 891be53cecbcaa73315da4882385a2fb
BLAKE2b-256 6e3eadff7d684d1a00ef2c6221b27c5a9e1c1b38e92472eec3254d9461f89fcc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page