Skip to main content

A YAML driven pipeline of AWS SAM stacks inspired by GitHub Actions.

Project description

samstacks

Declarative infrastructure orchestration for AWS SAM deployments.

PyPI version Build Status Documentation

Deploy multi-stack AWS SAM applications using YAML pipelines with GitHub Actions-style syntax and automatic dependency resolution.

[!WARNING] Alpha Software Notice: samstacks is currently in alpha development. While functional and actively used, the API and configuration format may change between versions. We welcome feedback, bug reports, and contributions as we work toward a stable release.

Why samstacks?

Managing multiple related AWS SAM stacks can be complex when you need to:

  • Deploy stacks in the correct order based on dependencies
  • Pass outputs from one stack as parameters to another
  • Manage environment-specific configurations
  • Coordinate deployments across teams

samstacks solves this by letting you define your entire multi-stack deployment as a single YAML pipeline.

Quick Start

1. Install and run immediately:

uvx samstacks deploy pipeline.yml

No installation required with uvx!

2. Create a pipeline manifest:

# pipeline.yml
pipeline_name: E-commerce Platform
pipeline_description: Backend API with user authentication

stacks:
  - id: auth-service
    dir: ./services/auth
    
  - id: product-api
    dir: ./services/products
    params:
      AuthServiceUrl: ${{ stacks.auth-service.outputs.ServiceUrl }}
      DatabaseUrl: ${{ env.DATABASE_URL }}

3. Deploy your infrastructure:

uvx samstacks deploy pipeline.yml

samstacks automatically:

  • ✅ Analyzes dependencies between stacks
  • ✅ Deploys auth-service first, then product-api
  • ✅ Passes the auth service URL to the product API
  • ✅ Provides detailed deployment reporting

Key Features

  • Declarative pipeline configuration - Define deployment sequences using YAML manifests
  • GitHub Actions compatibility - Leverage familiar ${{ env.VAR }} syntax and expressions
  • Intelligent dependency resolution - Automatic stack ordering based on output dependencies
  • Multi-environment support - Environment-specific parameters and conditional deployment
  • Comprehensive validation - Catch configuration errors before deployment
  • Native AWS SAM integration - Works with existing SAM templates and configurations

Installation Options

Recommended - Run without installing:

uvx samstacks --help
uvx samstacks deploy pipeline.yml

Traditional installation:

pip install samstacks
samstacks --help

Common Use Cases

Cross-Stack Dependencies

stacks:
  - id: vpc-stack
    dir: ./infrastructure/vpc
    
  - id: database-stack  
    dir: ./infrastructure/database
    params:
      VpcId: ${{ stacks.vpc-stack.outputs.VpcId }}
      SubnetIds: ${{ stacks.vpc-stack.outputs.PrivateSubnetIds }}
      
  - id: api-stack
    dir: ./application/api
    params:
      DatabaseUrl: ${{ stacks.database-stack.outputs.ConnectionString }}

Environment-Specific Deployment

pipeline_settings:
  stack_name_prefix: ${{ env.ENVIRONMENT }}-myapp
  inputs:
    environment:
      type: string
      default: dev

stacks:
  - id: app-stack
    dir: ./app
    if: ${{ inputs.environment != 'local' }}
    params:
      Environment: ${{ inputs.environment }}
      InstanceType: ${{ inputs.environment == 'prod' && 't3.large' || 't3.micro' }}

CLI Commands

Deploy Pipeline

samstacks deploy pipeline.yml

Validate Configuration

samstacks validate pipeline.yml

Delete All Stacks

samstacks delete pipeline.yml

Bootstrap Existing Project

samstacks bootstrap ./my-sam-project

Prerequisites

  • Python 3.8+ - Check with python --version
  • AWS CLI - Configured with appropriate permissions (aws sts get-caller-identity)
  • SAM CLI - For template validation and deployment (sam --version)

Real-World Example

Check out our complete example showcasing:

  • S3 bucket notifications to SQS
  • Lambda processing with dependencies
  • Cross-stack parameter passing
  • Conditional deployment logic
  • Post-deployment automation
git clone https://github.com/dev7a/samstacks.git
cd samstacks
uvx samstacks deploy examples/pipeline.yml

Documentation

📖 Complete Documentation

Our comprehensive documentation includes:

Contributing

Contributions are welcome! Please see our Contributing Guidelines for details.

License

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

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

samstacks-0.6.2.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

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

samstacks-0.6.2-py3-none-any.whl (68.4 kB view details)

Uploaded Python 3

File details

Details for the file samstacks-0.6.2.tar.gz.

File metadata

  • Download URL: samstacks-0.6.2.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for samstacks-0.6.2.tar.gz
Algorithm Hash digest
SHA256 b4465867084ce7b9490a6a187ae1f54e4466f334b4cbb088907741af07f2f96b
MD5 2e5f09107b021cdf3ba74dc2f7b0b0cf
BLAKE2b-256 db7e078fa3b63efb2cf46c4058f792d528f4224261de977e61b402ebf590f084

See more details on using hashes here.

File details

Details for the file samstacks-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: samstacks-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 68.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for samstacks-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bafd7998e4b684ad3fd3887bb20f23d85f47ea88c9efe9fd85fae027251cae23
MD5 4011029b015858c29600fd16bf8b4e06
BLAKE2b-256 3806c4066db136a9400bf242e32e845d95bd001625694b1ae0cba8d01835c4dc

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