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.8.tar.gz (1.9 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: org-ds-cdk-0.1.8.tar.gz
  • Upload date:
  • Size: 1.9 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.8.tar.gz
Algorithm Hash digest
SHA256 1ae05f6c96ac31a00156bffe0dbba59961d2038eb94272ec1f6c4e9177c9509b
MD5 28bfb330179bab659f3f3b114068d86b
BLAKE2b-256 2b43b8f78a3762d50888d594a26b1540958c941d1a620fd0f566e5582ba3431b

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