MCPcopy Index your code
hub / github.com/aws/aws-pdk

github.com/aws/aws-pdk @v0.26.15

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.26.15 ↗ · + Follow
1,899 symbols 3,927 edges 386 files 474 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Getting started

What is the AWS PDK?

The AWS Project Development Kit (AWS PDK) provides building blocks for common patterns together with development tools to manage and build your projects.

The AWS PDK lets you define your projects programatically via the expressive power of type safe constructs available in one of 3 languages (typescript, python or java). This approach yields many benefits, including:

  • Ability to set up new projects within seconds, with all boilerplate already pre-configured.
  • Receive updates to previously bootstrapped projects when new versions become available i.e: updated dependenies or lint configurations.
  • Build polyglot monorepos, with build caching, cross-language build dependencies, dependency visualization and much more.
  • Leverage codified patterns which vend project and infrastructure (CDK) code.

The AWS PDK is built on top of Projen and as such all constructs that you compose together need to be defined via a projenrc file.

Why use the AWS PDK?

It's much easier to show than explain! Here is some PDK code (within projenrc file) that creates a Polyglot monorepo, with a React Website pre-configured with Cognito Auth and pre-integrated with a Smithy Type Safe Api.

import { CloudscapeReactTsWebsiteProject } from "@aws/pdk/cloudscape-react-ts-website";
import { InfrastructureTsProject } from "@aws/pdk/infrastructure";
import { MonorepoTsProject } from "@aws/pdk/monorepo";
import {
    DocumentationFormat,
    Language,
    Library,
    ModelLanguage,
    TypeSafeApiProject,
} from "@aws/pdk/type-safe-api";
import { javascript } from "projen";

const monorepo = new MonorepoTsProject({
    name: "my-project",
    packageManager: javascript.NodePackageManager.PNPM,
    projenrcTs: true,
});

const api = new TypeSafeApiProject({
    parent: monorepo,
    outdir: "packages/api",
    name: "myapi",
    infrastructure: {
        language: Language.TYPESCRIPT,
    },
    model: {
        language: ModelLanguage.SMITHY,
        options: {
        smithy: {
            serviceName: {
            namespace: "com.aws",
            serviceName: "MyApi",
            },
        },
        },
    },
    runtime: {
        languages: [Language.TYPESCRIPT],
    },
    documentation: {
        formats: [DocumentationFormat.HTML_REDOC],
    },
    library: {
        libraries: [Library.TYPESCRIPT_REACT_QUERY_HOOKS],
    },
    handlers: {
        languages: [Language.TYPESCRIPT],
    },
});

const website = new CloudscapeReactTsWebsiteProject({
    parent: monorepo,
    outdir: "packages/website",
    name: "website",
    typeSafeApi: api,
});

new InfrastructureTsProject({
    parent: monorepo,
    outdir: "packages/infra",
    name: "infra",
    cloudscapeReactTsWebsite: website,
    typeSafeApi: api,
});

monorepo.synth();

This code (also available in Python and Java), produces all the source code, packages and infrastructure needed to deploy a fully-operable application in the AWS cloud. All that's left to do is build and deploy it!

From this ~70 lines of code above, the AWS PDK produces the following packages on your behalf:

  • monorepo: Root level project that manages interdependencies between projects within the Monorepo, provides build caching and dependency visualziation.
  • api/model: A project that allows you to define your API using Smithy (or OpenAPI) IDL.
  • api/generated/documentation: A project that automatically creates API documentation in a variety of formats.
  • api/generated/infrastructure: A project that automatically creates API infrastructure constructs in a type-safe manner.
  • api/generated/libraries: A project that automatically generates a react hooks library that can be used to call your API from a React based website.
  • api/generated/runtime: A project that contains server bindings for handlers to ensure type safety.
  • api/handlers: A project that automatically creates handler stubs, preconfigured with type-safety and a variety of value added features based on your defined API's.
  • website: A project which creates a React based website built using Cloudscape that comes pre-integrated with Cognito Auth and your created API. This provides you with the ability to call your API securely.
  • infra: A project which sets up all CDK related infrastructure needed to deploy your application. It also comes pre-configured to generate a diagram based on your CDK code everytime you build.

Bootstrapped Source

Generated Website

Generated Diagram

As you can see, the AWS PDK provides you with valuable time savings so you can focus on working on what matters most to your project.

Developing with the AWS PDK

Please refer to the full documentation website.

https://aws.github.io/aws-pdk

Contributing to the AWS PDK

https://aws.github.io/aws-pdk/contributing/index.html

License

This project is licensed under the Apache-2.0 License.

Extension points exported contracts — how you extend this code

INxProjectCore (Interface)
(no doc) [8 implementers]
packages/monorepo/src/components/nx-configurator.ts
ICdkGraphPlugin (Interface)
(no doc) [2 implementers]
packages/cdk-graph/src/cdk-graph.ts
OnEventRequest (Interface)
* Cloudformation event type for custom resource
packages/type-safe-api/src/construct/prepare-spec-event-handler/index.ts
CfnTypeAssets (Interface)
Definitaion of asset mappings to CloudFormation type
packages/aws-arch/src/internal/mapping/helpers.ts
MarshalledLabel (Interface)
* Parsed label structure used for marshalling label rendering
packages/cdk-graph-plugin-diagram/src/internal/graphviz/entities/nodes.ts
PDKInternalProject (Interface)
(no doc) [1 implementers]
projenrc/projects/internal/internal-project.ts
BuildOptionsProps (Interface)
(no doc)
packages/infrastructure/test/projects/utils/snapshot-infra-project.ts
ReactTypeScriptProjectOptions (Interface)
(no doc)
packages/cloudscape-react-ts-website/src/react-ts-project-options.ts

Core symbols most depended-on inside this repo

filter
called by 141
packages/cdk-graph/src/core/graph.ts
exec
called by 86
packages/monorepo/src/utils/node.ts
add
called by 66
packages/cdk-graph/src/core/counter.ts
synth
called by 55
packages/pdk-nag/src/pdk-nag.ts
withTempSpec
called by 46
packages/type-safe-api/test/construct/utils.ts
ensure
called by 46
packages/type-safe-api/src/project/codegen/components/generate-task.ts
withTmpDirSnapshot
called by 44
packages/type-safe-api/test/project/snapshot-utils.ts
synthProject
called by 41
packages/type-safe-api/test/project/snapshot-utils.ts

Shape

Method 691
Class 415
Interface 387
Function 368
Enum 38

Languages

TypeScript99%
Java1%
Python1%

Modules by API surface

packages/cdk-graph/src/core/graph.ts266 symbols
packages/aws-arch/src/arch.ts57 symbols
packages/type-safe-api/src/project/types.ts45 symbols
packages/type-safe-api/src/project/codegen/generate.ts38 symbols
packages/type-safe-api/scripts/type-safe-api/generators/generate-next.ts35 symbols
packages/monorepo/src/components/nx-configurator.ts32 symbols
packages/monorepo/src/projects/typescript/monorepo-ts.ts28 symbols
packages/type-safe-api/src/construct/authorizers/authorizers.ts25 symbols
packages/pdk-nag/src/pdk-nag.ts23 symbols
packages/cdk-graph/src/cdk-graph.ts23 symbols
packages/type-safe-api/src/construct/prepare-spec-event-handler/prepare-spec.ts22 symbols
packages/type-safe-api/src/construct/integrations/integration-response-set.ts22 symbols

For agents

$ claude mcp add aws-pdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page