Skip to main content

A library to redirect AWS SDK calls to LocalStack.

Project description

LocalCloudForge

Overview

LocalCloudForge is a library designed to simplify the process of working with AWS services in your local development environment. By leveraging LocalStack, this library allows you to effortlessly run your AWS service interactions locally, making it easier to test and develop your applications without incurring unnecessary costs. With just a simple decorator, you can enhance your development workflow, ensuring you focus on building rather than worrying about cloud expenses.

Features

  • Effortless Integration: Simply decorate any function that instantiates an AWS service with @forge_local, and it will automatically execute using LocalStack.
  • Support for Multiple AWS Services: Integrate with various AWS services like S3, SNS, SQS, Lambda, and more without additional configuration. You can check for avaiable services here

Getting Started

Requirements

To get started, ensure you have the following installed:

pip install boto3 localstack-client

Running LocalStack

Start LocalStack using Docker with the following command:

docker run -p 4566:4566 -p 4571:4571 localstack/localstack

Configuring AWS CLI for LocalStack

To interact with your LocalStack instance using the AWS CLI, you'll need to configure your AWS CLI settings. Add the following configurations to your AWS config and credentials files:

Update your AWS Config:

Create or edit ~/.aws/config:

[profile localstack]
region = us-east-1
output = json
endpoint_url = http://localhost:4566

Update your AWS Credentials:

Create or edit ~/.aws/credentials:

[localstack]
aws_access_key_id = test
aws_secret_access_key = test

Using the AWS CLI with LocalStack

Once configured, you can execute AWS CLI commands using the LocalStack profile. Simply add the --profile localstack flag to your AWS CLI commands:

aws s3 ls --profile localstack

Example Usage

Here's a quick example of how to use the @forge_local decorator:

from your_library import forge_local

@forge_local
def create_bucket(bucket_name):
    s3_client = boto3.client('s3')
    s3_client.create_bucket(Bucket=bucket_name)
    print(f"Bucket '{bucket_name}' created.")

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

localcloudforge-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

localcloudforge-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file localcloudforge-0.1.0.tar.gz.

File metadata

  • Download URL: localcloudforge-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for localcloudforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e68015555c30f2a3320e51ae0f5edd0456723aa3eb29a85da921c6fffbd25d2a
MD5 0809fa000c400d8e38ef6e16f3de2bdc
BLAKE2b-256 ac6db28370bfc0bf56a4b17ed4093a6999889d3c14cca6c3e753dbc6a09fad71

See more details on using hashes here.

File details

Details for the file localcloudforge-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for localcloudforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0687872f3fbf7ef31a9e18050988130899181291b9bfe4e0d0e76026bdbc8ffd
MD5 3223281b8f62408bb238ef79223d3b4c
BLAKE2b-256 9f93700c73aec63b9267eaf21d30176f4241534b3101ca5a97d64a457302beb0

See more details on using hashes here.

Supported by

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