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

Uploaded Source

File details

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

File metadata

  • Download URL: org-ds-cdk-0.1.11.tar.gz
  • Upload date:
  • Size: 2.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.11.tar.gz
Algorithm Hash digest
SHA256 d6755d36ed7af9a1fdec5f3286f13a12f1838143fcc13ede274b92a7e1ec17ee
MD5 c5e0bed8e7887e55b464b35a2fc7fa4c
BLAKE2b-256 b189082f33fadf189fe23e0d0b5ac3f1b7010517f9dd75e8e6f0120a3f8202bb

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