Skip to content

gradientedge/cdk-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,452 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gradient Edge CDK Utils

version version-aws version-azure version-cloudflare version-common

License Maintained Dependencies Twitter

AWS CLI Node CDK Pulumi Pulumi Azure Pulumi Cloudflare

Builds Coverage Code Size

Downloads Commits Last Commits Issues Pull Requests

Introduction

A comprehensive toolkit for provisioning cloud infrastructure using AWS CDK and Pulumi. This monorepo provides high-level constructs, service managers, and common utilities that simplify infrastructure-as-code across AWS, Azure, and Cloudflare.

For more details, see the full API documentation.

Packages

Package Description Version
@gradientedge/cdk-utils-aws AWS CDK constructs and service managers version-aws
@gradientedge/cdk-utils-azure Azure Pulumi (Azure Native) constructs and service managers version-azure
@gradientedge/cdk-utils-cloudflare Cloudflare Pulumi constructs and service managers version-cloudflare
@gradientedge/cdk-utils-common Shared utilities, types, and stage helpers version-common
@gradientedge/cdk-utils Umbrella package that re-exports all of the above version

Prerequisites

Installation

Install the umbrella package:

pnpm add @gradientedge/cdk-utils

Or install individual packages as needed:

pnpm add @gradientedge/cdk-utils-aws
pnpm add @gradientedge/cdk-utils-azure
pnpm add @gradientedge/cdk-utils-cloudflare
pnpm add @gradientedge/cdk-utils-common

Quick Start

AWS

import { CommonConstruct, CommonStackProps } from '@gradientedge/cdk-utils-aws'
import { Construct } from 'constructs'

class MyStack extends CommonConstruct {
  constructor(parent: Construct, id: string, props: CommonStackProps) {
    super(parent, id, props)
    this.initResources()
  }

  protected initResources() {
    this.lambdaManager.createLambdaFunction('MyFunction', this, functionProps)
    this.s3Manager.createBucket('MyBucket', this, bucketProps)
  }
}

Azure

import { CommonAzureConstruct } from '@gradientedge/cdk-utils-azure'
import * as pulumi from '@pulumi/pulumi'

class MyAzureStack extends CommonAzureConstruct {
  constructor(name: string, args: any, opts?: pulumi.ComponentResourceOptions) {
    super(name, args, opts)
    this.initResources()
  }
}

Cloudflare

import { CommonCloudflareConstruct } from '@gradientedge/cdk-utils-cloudflare'
import * as pulumi from '@pulumi/pulumi'

class MyCloudflareStack extends CommonCloudflareConstruct {
  constructor(name: string, args: any, opts?: pulumi.ComponentResourceOptions) {
    super(name, args, opts)
    this.initResources()
  }
}

Development

Setup

pnpm install
pnpm build

Testing

Run the full test suite:

pnpm test

Watch mode for a specific test:

pnpm test:watch static-asset-deployment-distribution-ref.test.ts

Validation

Run prettier, linting, and tests:

pnpm validate

Generate API Documentation

pnpm run docs

Test Utilities

There are common utilities that help with testing constructs in the test tools directory. A debug utility is also available for printing template contents during development.

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License — see the LICENSE file for details.