Skip to content

Query cloud API's and store the results in a database for later retrieval and historical analysis.

Notifications You must be signed in to change notification settings

FredLackey/paas-query-db

Repository files navigation

PaaS Provider Query API

A streamlined API service for executing and tracking cloud provider commands across AWS GovCloud, AWS Commercial, Azure, and Google Cloud Platform.

Overview

This service provides a unified interface for executing cloud provider commands while handling:

  • Command execution tracking
  • Rate limiting
  • Account information caching
  • Execution history
  • Cross-provider compatibility

Quick Start

  1. Install dependencies with: npm install

  2. Configure environment:

    • Copy .env.example to .env.local
    • Update with your settings
  3. Start the service:

    • Development: npm run dev
    • Production: npm start

API Endpoints & Workflows

1. Execute Cloud Commands

Endpoint: POST /execute

Execute cloud provider commands and store their results. Send a POST request with:

  • accessKey
  • secretKey
  • providerName (e.g., "AWS GovCloud")
  • region (e.g., "us-gov-west-1")
  • command (e.g., "ec2 describeInstances")

Features:

  • Prevents duplicate commands
  • Stores execution results
  • Supports AWS, Azure, and GCP
  • Returns results and timing

2. Check Last Execution

Endpoint: GET /lastExecution

Query parameters:

  • accessKey
  • command
  • region
  • providerName

Returns:

  • Last successful execution details
  • Execution time and results
  • Command output

3. View Execution History

Endpoint: GET /executionHistory

Query parameters:

  • accessKey
  • command
  • region
  • providerName
  • startDate (optional, ISO format)
  • endDate (optional, ISO format)
  • limit (optional, default 100)

Returns execution history within specified date range.

4. Retrieve Specific Executions

Endpoint: POST /executionsByDates

Request body:

  • accessKey
  • command
  • region
  • providerName
  • dates (array of ISO format dates)

Retrieves full execution details for specific dates.

Supported Commands

AWS Services

  • API Gateway: REST and WebSocket API management
  • CloudFormation: Infrastructure as code
  • CloudFront: Content delivery and distribution
  • CloudTrail: Account activity and API usage tracking
  • CloudWatch: Metrics, monitoring, and logging
  • Config: Resource inventory and configuration history
  • Cost Explorer: Cost and usage reporting
  • DynamoDB: NoSQL database operations
  • EC2: Instance management and queries
  • ECS: Container orchestration service
  • EFS: Elastic File System operations
  • EKS: Managed Kubernetes service
  • Elastic Load Balancing: Load balancer management
  • ElastiCache: In-memory caching service
  • FSx: Managed file systems
  • Glacier: Long-term data archival
  • GuardDuty: Threat detection monitoring
  • IAM: User and role management
  • Lambda: Function operations
  • Organizations: Account organization management
  • RDS: Relational database operations
  • S3: Bucket and object operations
  • Security Hub: Security findings management
  • Service Quotas: Service limits and quotas
  • STS: Security token and identity operations

Azure Services

  • Compute Management: Virtual machine and scale set operations
  • Monitor: Metrics, alerts, and diagnostic settings
  • Network: Virtual networks, load balancers, and connectivity
  • Key Vault: Secure secret storage and management
  • Storage: Blob storage and data management

Google Cloud Platform

  • Compute Engine: Virtual machine and infrastructure management
  • Cloud Storage: Object storage and data management
  • BigQuery: Data warehouse and analytics
  • Cloud Monitoring: Metrics, monitoring, and alerting
  • Cloud Functions: Serverless compute platform

Error Handling

Common error scenarios:

  • Invalid credentials
  • Missing required parameters
  • Rate limiting
  • Service unavailability
  • Command execution failures

Each error response includes:

  • Error code
  • Detailed message
  • Suggested resolution

Benefits

  • Unified Interface: One API for all cloud providers
  • Smart Caching: Reduces API calls to cloud providers
  • Execution Tracking: Prevents duplicate commands
  • History: Maintains detailed execution records
  • Rate Limiting: Protects your cloud provider quotas

Questions?

I'd love to help! Feel free to reach out:

Fred Lackey
Email: Fred.Lackey@gmail.com
Blog: FredLackey.com


Built with ❤️ for the cloud community

About

Query cloud API's and store the results in a database for later retrieval and historical analysis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published