Skip to main content

DS Organization CDK Constructs

Project description

Building and Publishing CDK Constructs to PyPi

Follow these steps to build your CDK constructs and publish them to PyPi:

  1. Ensure you have the necessary tools installed

    You'll need Python, pip, setuptools, wheel, and twine. You can install these with pip:

    pip install --upgrade setuptools wheel twine
    
  2. Build your package

    Navigate to the directory containing your setup.py file and run:

    python setup.py sdist bdist_wheel
    

    This will create a source archive (.tar.gz) and a wheel file (.whl) in a newly created dist directory.

  3. Check your package with twine

    Before uploading, it's a good idea to check your package with twine:

    twine check dist/*
    

    This will check for common errors. If everything is okay, you can proceed to the next step.

  4. Upload your package to PyPi

    You can upload your package using twine. Replace dist/* with the path to the files you want to upload:

    twine upload dist/*
    

    You'll be prompted for your PyPi username and password. If you have two-factor authentication enabled on PyPi, you'll need to generate an API token and use that instead of your password.

  5. Verify your package

    Go to your PyPi account and verify that the package was uploaded successfully.

API Gateway Construct

This package provides a construct for AWS Cloud Development Kit (CDK) to create an API Gateway with dynamic routes and methods based on a configuration.

Features

  • Creates an API Gateway with a custom name and description.
  • Dynamically creates resources and methods based on a provided configuration.
  • Supports Lambda integrations.

Installation

To install this package, run the following command in your terminal:

pip install dscdk.apigateway

Usage

from aws_cdk import App
from apigateway_construct import ApiGatewayStack

app = App()

lambda_stack = ...  # Your Lambda stack

config = {
    'routes': [
        {
            'path': '/myresource',
            'methods': ['GET'],
            'integration': 'lambda',
            'lambdaFunctionName': 'MyFunction',
        },
        # Add more routes as needed
    ],
}

ApiGatewayStack(app, "ApiGatewayStack", lambda_stack=lambda_stack, config=config)

app.synth()

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

org-ds-cdk-0.1.12.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file org-ds-cdk-0.1.12.tar.gz.

File metadata

  • Download URL: org-ds-cdk-0.1.12.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.0rc1

File hashes

Hashes for org-ds-cdk-0.1.12.tar.gz
Algorithm Hash digest
SHA256 36e7ae8e4adcb0d0e4f7e3b234b6fe916f77992b5f107749f7896ce0f5bb6f92
MD5 a8a38adaa76051c923613288ca69592a
BLAKE2b-256 651301d4dc666c0ddc3ed355790789ea326ef7202d2d81161a1d2c11c87f9c79

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