Skip to main content

Infrastructure management tool

Project description

ls-infra

ls-infra is a framework for collecting cloud infrastructure information and transforming it into useful formats. Its extensible design allows users to easily add support for new cloud providers and output formats.

Core Concepts

ls-infra operates in three distinct stages:

  1. Collection Each collector must implement two methods to standardize how data is gathered:

fetch_raw_data: Retrieves raw data from the provider serialize: Transforms the raw data into the standardized format required by the formatter

  1. Pipeline Processing Services that process the standardized data:

Run sequentially in the order defined Can target specific provider data or all data using the target property Transform, filter, or enrich the data

  1. Formatting Takes all processed data and generates the final output. The formatter effectively dictates the required data format that collectors must serialize to. Flow Definition A flow is defined in YAML and describes the complete data processing pipeline: yamlCopyversion: "1.0" metadata: name: example_flow description: "Flow description"

collect: aws: service: aws_instance_collector enabled: true config: regions: ["us-east-1"]

alicloud: service: alicloud_instance_collector enabled: true config: regions: ["cn-beijing"]

pipelines:

  • service: filter_terminated target: all config: states: ["terminated"]

  • service: filter_vpc target: aws config: vpc_ids: ["vpc-123"]

format: service: generate_inventory_ansible config: group_by: ["Environment"] Flow Execution

Collection Phase (Parallel):

Collectors run in parallel Each collector:

Fetches raw data Transforms to standard format

Results are aggregated

Pipeline Phase (Sequential):

Services run in defined order Each service processes based on target:

target: all - processes all data target: provider - processes specific provider data

Format Phase:

Takes all processed data Generates final output

Key Design Points

Collection Standardization:

Collectors handle both fetching and transformation Raw provider data is immediately standardized Format is dictated by formatter needs

Pipeline Flexibility:

Services can target all or specific data Sequential processing ensures data consistency Common operations can be applied to all data

Extensibility:

New collectors can be added for different providers Pipeline services can be created for custom needs Formatters can be developed for different outputs

Development Guidelines Collectors Must implement:

fetch_raw_data: Provider-specific retrieval serialize: Standardization to formatter requirements

Pipeline Services Should:

Accept standardized data format Clearly define their target scope Maintain data format compatibility

Formatters Should:

Define their expected data format Provide clear configuration options Handle partial or failed data gracefully

CLI Usage bashCopy# Run a flow ls-infra run -f flow.yml

Validate flow

ls-infra validate -f flow.yml

List available services

ls-infra list-services

Initialize new flow

ls-infra init Environment Variables The framework supports environment variable substitution:

${VAR_NAME}: Simple substitution ${VAR_NAME:-default}: With default value

Security Considerations

Credential Management:

Use environment variables for sensitive data Support cloud provider credential chains Never log sensitive information

Input Validation:

Validate all configuration Sanitize input data Verify service permissions

Error Handling

Collection Errors:

Failed collectors don't halt entire process Proper error reporting Retry mechanisms for transient failures

Pipeline Errors:

Configurable failure behavior (fail/warn) Clear error messages Data validation between services

Formatter Errors:

Validate input data Clear error reporting Partial output on failures when possible

Future Plans

  • Implement plugin system architecture
  • Move default plugins to separate repository for better maintainability
  • Allow third-party plugin development and integration

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

ls_infra-0.1.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

ls_infra-0.1.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file ls_infra-0.1.2.tar.gz.

File metadata

  • Download URL: ls_infra-0.1.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ls_infra-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ef7d08adb45286f3ee97511f63bc47c0683b3a73cfd8ce1e447cb64f3e98f48a
MD5 f1733826a08c0fdf1c5c28af366cf4a8
BLAKE2b-256 ea4eecdf73955ba6254f0fdc5b0833b1adc162699a20113cf9b4013508a05b99

See more details on using hashes here.

File details

Details for the file ls_infra-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ls_infra-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ls_infra-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c83768a77e0af558fbf9ea6c1f116dd41d9ab001e22ad49cbdaf3fad80bdfaac
MD5 4704ab7e10e12af93a314dfb49465dc3
BLAKE2b-256 2e5f1fdca6c12652ac2889c17d37bd45bdd3cc08a1d2b18033e42bad35f6f61c

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