Skip to content

Commit d083f3a

Browse files
authored
fix: enhance boilerplate infra & update docs (#552)
- tweak getting started docs - update infra sample code to apply cognito authrole permissions to call deployed sample API
1 parent 7804491 commit d083f3a

File tree

116 files changed

+1478
-2306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+1478
-2306
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class MyPackageProject extends PDKProject {
5454
authorAddress: "<your email>",
5555
defaultReleaseBranch: "mainline",
5656
name: "your-package",
57-
repositoryUrl: "https://github.com/aws/aws-prototyping-sdk",
57+
repositoryUrl: "https://github.com/aws/aws-pdk",
5858
devDeps: ["projen"],
5959
deps: [
6060
"projen",
@@ -215,11 +215,11 @@ From the root directory run: `npx projen upgrade-deps`. This will bump all depen
215215
If you run into an issue that resembles:
216216

217217
```bash
218-
Type 'import(".../aws-pdk/node_modules/aws-prototyping-sdk/node_modules/projen/lib/ignore-file").IgnoreFile' is not assignable to type 'import(".../aws-pdk/node_modules/projen/lib/ignore-file").IgnoreFile'.
218+
Type 'import(".../@aws/pdk/node_modules/aws-prototyping-sdk/node_modules/projen/lib/ignore-file").IgnoreFile' is not assignable to type 'import(".../@aws/pdk/node_modules/projen/lib/ignore-file").IgnoreFile'.
219219
Types have separate declarations of a private property '_patterns'.
220220
```
221221

222-
This means there are two conflicting versions of a package in the monorepo. To resolve this, from the root directory run: `npx projen upgrade-deps`. This will bump all dependencies to be the same/latest versions and update the `yarn.lock` file accordingly.
222+
This means there are two conflicting versions of a package in the monorepo. To resolve this, from the root directory run: `pdk upgrade-deps`. This will bump all dependencies to be the same/latest versions and update the lock file accordingly.
223223

224224
### Build hangs due to NPX waiting for user input
225225

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
aws-prototyping-sdk
1+
aws-pdk
22
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

README.md

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,6 @@
1-
# aws-prototyping-sdk
1+
# aws-pdk
22

3-
## Introduction
4-
5-
The AWS Prototyping SDK (PDK) aims to accelerate the development of prototypes on AWS. To achieve this, it provides building blocks for common patterns together with development tools to manage and build your projects. The constructs are based on [AWS CDK](https://github.com/aws/aws-cdk) and implement an expanding number of common application/infrastructure patterns, such as the ability to generate complete client and infrastructure code for a REST API from an OpenAPI specification. The project and build tools the PDK provide allows you manage the configuration of multiple related projects in a language-agnostic way, and to efficiently execute parallel incremental builds.
6-
7-
This combination of project management, build execution, and CDK constructs reduce the effort involved in prototyping new ideas on AWS, and allow developers to seamlessly grow these ideas beyond the prototype phase without requiring a complete re-implementation of the original solution. In addition to the foundation of project configuration and build dependency management provided by the monorepo project, PDK also provides a number of other projen projects (some of which implement common infrastructure patterns using CDK) and stand-alone CDK constructs, which are described below. Note: PDK is currently pre-release, targeting version 1.0 for mid-2023.
8-
9-
## Core Modules
10-
11-
### [monorepo](./packages/monorepo/README.md)
12-
13-
Modern applications are often implemented across multiple packages or libraries, each potentially implemented in a different language. To help manage the complexity that arises from this, PDK provides a [Projen](https://github.com/projen/projen) project called 'monorepo' to support dependency management and builds across packages. Together with the project-as-code provided by Projen, this project utilises [Nx Build](https://nx.dev/) to give developers the ability to manage a collection of different projects within a single repository. Nx Build allows for explicit and implicit dependency management between polyglot projects, and provides shared caching and parallel task execution for super fast builds across multiple languages with ease. By combining Projen and NX Build, 'monorepo' reduces the effort involved in maintaining and building related projects implemented in a mix of languages.
14-
15-
### [static-website](./packages/static-website/README.md)
16-
17-
This module provides a high-level CDK construct that is able to deploy your pre-packaged static website content into an S3 Bucket, fronted by Cloudfront. This module uses an Origin Access Identity to ensure your Bucket can only be accessed via Cloudfront and is configured to only allow HTTPS requests by default.
18-
19-
### [cloudscape-react-ts-website](./packages/cloudscape-react-ts-website/README.md)
20-
21-
This module provides a projen project that has a default directory structure and resources for an empty React website that utilises the Cloudscape design system. This can be used in tandem with the 'static-website' and 'identity' modules to deploy infrastructure to host and provide identity management to host and secure the website content.
22-
23-
### [type-safe-api](./packages/type-safe-api/README.md)
24-
25-
This module provides a projen project that allows you to define an API using either Smithy or OpenAPI v3, and a construct which manages deploying this API in API Gateway, given an integration (eg a lambda) for every operation. It generates type-safe CDK constructs, client, and server code to help you rapidly implement and integrate with your API.
26-
27-
### [pipeline](./packages/pipeline/README.md)
28-
29-
This module provides a projen project that uses a construct based on CDK's CodePipeline construct, named PDKPipeline, to deploy a CI/CD pipeline. It additionally creates a CodeCommit repository and by default is configured to build the project assuming monorepo is being used (although this can be changed). A Sonarqube Scanner can also be configured to trigger a scan whenever the synth build job completes successfully. This Scanner is non-blocking and as such is not instrumented as part of the pipeline.
30-
31-
### [pdk-nag](./packages/pdk-nag/README.md)
32-
33-
This module provides a helper utility that automatically configures [CDKNag]('https://github.com/cdklabs/cdk-nag') within your application, which validates that the state of constructs within a given scope comply with a given set of rules. Additionally, cdk-nag provides a rule suppression and compliance reporting system. cdk-nag validates constructs by extending [AWS CDK Aspects]('https://docs.aws.amazon.com/cdk/v2/guide/aspects.html').
34-
35-
### [cdk-graph](./packages/cdk-graph/README.md)
36-
37-
This module provides a core framework for supporting additional CDK based automation and tooling, such as diagramming, cost modeling, and security and compliance. Currently, it delivers the following functionality:
38-
39-
1. Synthesizes a serialized graph (nodes and edges) from CDK source code.
40-
1. Provides runtime interface for interacting with the graph (in-memory database-like graph store).
41-
1. Provides plugin framework for additional tooling to utilize and extend the graph.
42-
43-
### [identity](./packages/identity/README.md)
44-
45-
This module provides a CDK derived construct that can be added to existing CDK project to deploy a configurable Identity Provider with a default Cognito User Pool. It does not depend on projen and can be utilised as an import in an existing CDK application.
46-
47-
## Prerequisites
48-
49-
Ensure you have the following packages installed globally:
50-
51-
- [pnpm](https://pnpm.io/installation)
52-
- [node > 14](https://nodejs.org/en/download/package-manager/) (or use [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to install)
53-
- [Python >= 3.7](https://www.python.org/downloads/)
54-
- [Java >= 8](https://aws.amazon.com/fr/corretto/) and [Maven >= 3.6](https://maven.apache.org/download.cgi)
55-
56-
```bash
57-
# from root directory of this package
58-
pnpm i
59-
```
60-
61-
## Quickstart
62-
63-
The [README for the 'monorepo'](./packages/monorepo/README.md) projen project provides an example of how to get started with PDK.
64-
65-
## Usage of projen/nx
66-
67-
This package is built using [projen](https://github.com/projen/projen) and [nx](https://nx.dev/getting-started/intro) as such all tasks should be invoked
68-
via either:
69-
70-
- `pnpm nx run-many --target=<task> --all` - executes the `<task>` on every package, in dependency order.
71-
- `pnpm nx run <package_name>:<task>` - executes the `<task>` on the specified `<package_name>`.
72-
73-
To build the full project, run `pnpm nx run-many --target=build --all`
74-
75-
Any change to `projects/*` or `.projenrc.ts` requires a synth to be executed. To do this, run: `pnpm projen` from the root directory.
76-
77-
## Nx workspace script alias
78-
79-
In addition to the above `pnpm nx <command>` format to execute commands, the workspace package contains useful alias for common tasks.
80-
81-
Executing `pnpm <task>` for common tasks will execute `pnpm nx run-many --target=<task> --output-style=stream --nx-bail`, such as `pnpm build` will execute `pnpx nx run-many --target=build --output-style=stream --nx-bail` across all packages.
82-
83-
All nx run-many alias scripts access additional arguments, such as to only run on specific projects you can use `pnpm build --projects=proj1,proj2`.
84-
85-
> See [Nx Run-Many options](https://nx.dev/packages/nx/documents/run-many#options) for details.
86-
87-
## Documentation
88-
89-
For documentation including examples and a full API reference, visit: [https://aws.github.io/aws-prototyping-sdk/](https://aws.github.io/aws-prototyping-sdk/)
90-
91-
## Contributing
92-
93-
See [CONTRIBUTING](CONTRIBUTING.md) for more information.
94-
95-
## Security
96-
97-
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
3+
https://aws.github.io/aws-pdk
984

995
## License
1006

docs/content/api/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# API Reference
22

3-
The AWS Prototyping SDK (PDK) is organized into several packages. Each package can contain a combination of either (or both) CDK and Projen constructs.
3+
The AWS PDK is organized into submodules. Each submodules can contain a combination of either (or both) CDK and Projen constructs.
44

5-
Packages which are experimental will have an experimental banner to indicate that breaking changes are not subject to major version bumps.
5+
Submodules which are experimental will have an experimental banner to indicate that breaking changes are not subject to major version bumps.
66

7-
Language specific API docs can be navigated to by selecting your desired language and then selecting the package you wish to view.
7+
Language specific API docs can be navigated to by selecting your desired language and then selecting the submodule you wish to view.
Loading
Loading
-349 Bytes
Loading
1.76 KB
Loading
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Developer Guides
22

3-
Developer Guides are poignant guides for how to interact with certain features provided by the associated constructs. Developer guides are intended to be used as a 'cheat sheet' when configuring your constructs.
4-
5-
The Developer Guides are broken down by package on the left hand navigation bar, with the package item on the left containing a broad getting started/overview of the package, with each specific developer guide linked out from here. Snippets are provided to you in each of the supported languages at your convenience.
3+
Provides a conceptual overview and practical examples to help you understand the features provided by the AWS PDK and how to use them in detail.

docs/content/faqs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ myPackage.compileTask.reset("tsc --build --verbose");
1313
#### Links
1414

1515
- [Cross stack values do not work with Source.data/jsonData [CDK github]](https://github.com/aws/aws-cdk/issues/19257)
16-
- [Nested stack runtime-config.json properties [PDK github]](https://github.com/aws/aws-prototyping-sdk/issues/84)
16+
- [Nested stack runtime-config.json properties [PDK github]](https://github.com/aws/aws-pdk/issues/84)
1717

1818
#### TLDR;
1919

@@ -79,7 +79,7 @@ myPackage.tsconfig?.addInclude("src/**/*.js");
7979
// myPackage.tsconfig?.addInclude("src/**/@lambda/**/*.js");
8080
```
8181

82-
#### Option #2 - with `rsync` ([example](https://github.com/aws/aws-prototyping-sdk/blob/392fb8c483a99123d4e8a8b6b95b5aa7ecb014b8/private/projects/monorepo-project.ts#L39))
82+
#### Option #2 - with `rsync` ([example](https://github.com/aws/aws-pdk/blob/392fb8c483a99123d4e8a8b6b95b5aa7ecb014b8/private/projects/monorepo-project.ts#L39))
8383

8484
```ts
8585
this.compileTask.exec(
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
nav:
33
- index.md
4-
- "Your first AWS PDK project": your_first_aws_pdk_project.md
5-
- "TODO App Workshop": "todo_app_workshop.md"
4+
- "Migration guide": "migration_guide.md"
5+
- "Learning Series":
6+
- "1. Your first AWS PDK project": your_first_aws_pdk_project.md
7+
- "2. Shopping List application": "shopping_list_app.md"

docs/content/getting_started/index.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,49 @@ The AWS PDK lets you define your project structure as code in one of its support
101101

102102
The AWS PDK has first-class support for Typescript, Python, & Java.
103103

104-
To facilitate supporting so many languages, the AWS CDK is developed in one language (TypeScript). Language bindings are generated for the other languages through the use of a tool called [JSII](https://aws.github.io/jsii/).
104+
To facilitate supporting multiple languages, the AWS PDK is developed in one language (TypeScript). Language bindings are generated for the other languages through the use of a tool called [JSII](https://aws.github.io/jsii/).
105+
106+
The distributables for each language can be used directly as follows:
107+
108+
=== "TYPESCRIPT"
109+
=== "NPM"
110+
```
111+
npm i @aws/pdk
112+
```
113+
114+
=== "PNPM"
115+
```
116+
pnpm i @aws/pdk
117+
```
118+
119+
=== "YARN"
120+
```
121+
yarn add @aws/pdk
122+
```
123+
124+
=== "PYTHON"
125+
=== "PIP"
126+
```
127+
pip install aws-pdk
128+
```
129+
130+
=== "POETRY"
131+
```
132+
poetry add aws-pdk
133+
```
134+
135+
=== "JAVA"
136+
=== "MAVEN"
137+
```bash
138+
<dependency>
139+
<groupId>software.aws</groupId>
140+
<artifactId>pdk</artifactId>
141+
<version>LATEST</version>
142+
</dependency>
143+
```
144+
145+
!!!tip
146+
Whilst the AWS PDK can be used directly via these package managers, we recommend bootstrapping via the `pdk new` command which negates the need to interact directly with these package managers. The package managers will still need to be installed however, refer to [prerequisites](index.md#prerequisites) for more information.
105147

106148
## Prerequisites
107149

@@ -130,7 +172,7 @@ Other prerequisites depend on the language in which you develop AWS PDK projects
130172

131173
Install the AWS PDK Toolkit globally using the following Node Package Manager command:
132174

133-
`npm install -g aws-pdk`
175+
`npm install -g @aws/pdk`
134176

135177
Run the following command to verify correct installation and print the version number of the AWS PDK.
136178

0 commit comments

Comments
 (0)