Skip to main content

awscdk Submodule

Constructs

AutoDiscover

Discovers and creates integration tests and lambdas from code in the project's source and test trees.

Initializers

import { awscdk } from 'projen'

new awscdk.AutoDiscover(project: Project, options: AutoDiscoverOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
AutoDiscoverOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.AutoDiscover.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.AutoDiscover.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

AwsCdkConstructLibrary

AWS CDK construct library project.

A multi-language (jsii) construct library which vends constructs designed to use within the AWS CDK with a friendly workflow and automatic publishing to the construct catalog.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkConstructLibrary(options: AwsCdkConstructLibraryOptions)
NameTypeDescription
options
AwsCdkConstructLibraryOptions
No description.

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
addExcludeFromCleanup
Exclude the matching files from pre-synth cleanup.
addGitIgnore
Adds a .gitignore pattern.
addPackageIgnore
Adds patterns to be ignored by npm.
addTask
Adds a new task to this project.
addTip
Prints a "tip" message during synthesis.
annotateGenerated
Marks the provided file(s) as being generated.
postSynthesize
Called after all components are synthesized.
preSynthesize
Called before all components are synthesized.
removeTask
Removes a task from a project.
runTaskCommand
Returns the shell command to execute in order to run a task.
synth
Synthesize all project files into outdir.
tryFindFile
Finds a file at the specified relative path within this project and all its subprojects.
tryFindJsonFile
Finds a json file by name.
tryFindObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
tryRemoveFile
Finds a file at the specified relative path within this project and removes it.
addBins
No description.
addBundledDeps
Defines bundled dependencies.
addCompileCommand
DEPRECATED.
addDeps
Defines normal dependencies.
addDevDeps
Defines development/test dependencies.
addFields
Directly set fields in package.json.
addKeywords
Adds keywords to package.json (deduplicated).
addPeerDeps
Defines peer dependencies.
addScripts
Replaces the contents of multiple npm package.json scripts.
addTestCommand
DEPRECATED.
hasScript
Indicates if a script by the name name is defined.
removeScript
Removes the npm script (always successful).
renderWorkflowSetup
Returns the set of workflow steps which should be executed to bootstrap a workflow.
setScript
Replaces the contents of an npm package.json script.
addCdkDependencies
Adds dependencies to AWS CDK modules.
addCdkTestDependencies
Adds AWS CDK modules as dev dependencies.

toString
public toString(): string

Returns a string representation of this construct.

addExcludeFromCleanup
public addExcludeFromCleanup(globs: string): void

Exclude the matching files from pre-synth cleanup.

Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.

globsRequired
  • Type: string

The glob patterns to match.


addGitIgnore
public addGitIgnore(pattern: string): void

Adds a .gitignore pattern.

patternRequired
  • Type: string

The glob pattern to ignore.


addPackageIgnore
public addPackageIgnore(pattern: string): void

Adds patterns to be ignored by npm.

patternRequired
  • Type: string

The pattern to ignore.


addTask
public addTask(name: string, props?: TaskOptions): Task

Adds a new task to this project.

This will fail if the project already has a task with this name.

nameRequired
  • Type: string

The task name to add.


propsOptional
  • Type: projen.TaskOptions

Task properties.


addTip
public addTip(message: string): void

Prints a "tip" message during synthesis.

messageRequired
  • Type: string

The message.


annotateGenerated
public annotateGenerated(glob: string): void

Marks the provided file(s) as being generated.

This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.

https://github.com/github/linguist/blob/master/docs/overrides.md

globRequired
  • Type: string

the glob pattern to match (could be a file path).


postSynthesize
public postSynthesize(): void

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before all components are synthesized.

removeTask
public removeTask(name: string): Task

Removes a task from a project.

nameRequired
  • Type: string

The name of the task to remove.


runTaskCommand
public runTaskCommand(task: Task): string

Returns the shell command to execute in order to run a task.

This will typically be npx projen TASK.

taskRequired
  • Type: projen.Task

The task for which the command is required.


synth
public synth(): void

Synthesize all project files into outdir.

  1. Call "this.preSynthesize()"
  2. Delete all generated files
  3. Synthesize all subprojects
  4. Synthesize all components of this project
  5. Call "postSynthesize()" for all components of this project
  6. Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and all its subprojects.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile

Finds a json file by name.

filePathRequired
  • Type: string

The file path.


tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile

Finds an object file (like JsonFile, YamlFile, etc.) by name.

filePathRequired
  • Type: string

The file path.


tryRemoveFile
public tryRemoveFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and removes it.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


addBins
public addBins(bins: {[ key: string ]: string}): void
binsRequired
  • Type: {[ key: string ]: string}

addBundledDeps
public addBundledDeps(deps: string): void

Defines bundled dependencies.

Bundled dependencies will be added as normal dependencies as well as to the bundledDependencies section of your package.json.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addCompileCommand
public addCompileCommand(commands: string): void

DEPRECATED.

commandsRequired
  • Type: string

addDeps
public addDeps(deps: string): void

Defines normal dependencies.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addDevDeps
public addDevDeps(deps: string): void

Defines development/test dependencies.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addFields
public addFields(fields: {[ key: string ]: any}): void

Directly set fields in package.json.

fieldsRequired
  • Type: {[ key: string ]: any}

The fields to set.


addKeywords
public addKeywords(keywords: string): void

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: string

The keywords to add.


addPeerDeps
public addPeerDeps(deps: string): void

Defines peer dependencies.

When adding peer dependencies, a devDependency will also be added on the pinned version of the declared peer. This will ensure that you are testing your code against the minimum version required from your consumers.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addScripts
public addScripts(scripts: {[ key: string ]: string}): void

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: {[ key: string ]: string}

The scripts to set.


addTestCommand
public addTestCommand(commands: string): void

DEPRECATED.

commandsRequired
  • Type: string

hasScript
public hasScript(name: string): boolean

Indicates if a script by the name name is defined.

nameRequired
  • Type: string

The name of the script.


removeScript
public removeScript(name: string): void

Removes the npm script (always successful).

nameRequired
  • Type: string

The name of the script.


renderWorkflowSetup
public renderWorkflowSetup(options?: RenderWorkflowSetupOptions): JobStep[]

Returns the set of workflow steps which should be executed to bootstrap a workflow.

optionsOptional
  • Type: projen.javascript.RenderWorkflowSetupOptions

Options.


setScript
public setScript(name: string, command: string): void

Replaces the contents of an npm package.json script.

nameRequired
  • Type: string

The script name.


commandRequired
  • Type: string

The command to execute.


addCdkDependencies
public addCdkDependencies(deps: string): void

Adds dependencies to AWS CDK modules.

Since this is a library project, dependencies will be added as peer dependencies.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


addCdkTestDependencies
public addCdkTestDependencies(deps: string): void

Adds AWS CDK modules as dev dependencies.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isProject
Test whether the given construct is a project.
of
Find the closest ancestor project for given construct.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkConstructLibrary.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isProject
import { awscdk } from 'projen'

awscdk.AwsCdkConstructLibrary.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { awscdk } from 'projen'

awscdk.AwsCdkConstructLibrary.of(construct: IConstruct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
buildTask
projen.TaskNo description.
commitGenerated
booleanWhether to commit the managed files by default.
compileTask
projen.TaskNo description.
components
projen.Component[]Returns all the components within this project.
deps
projen.DependenciesProject dependencies.
ejected
booleanWhether or not the project is being ejected.
files
projen.FileBase[]All files in this project.
gitattributes
projen.GitAttributesFileThe .gitattributes file for this repository.
gitignore
projen.IgnoreFile.gitignore.
logger
projen.LoggerLogging utilities.
name
stringProject name.
outdir
stringAbsolute output directory of this project.
packageTask
projen.TaskNo description.
postCompileTask
projen.TaskNo description.
preCompileTask
projen.TaskNo description.
projectBuild
projen.ProjectBuildManages the build process of the project.
projenCommand
stringThe command to use in order to run the projen CLI.
root
projen.ProjectThe root project.
subprojects
projen.Project[]Returns all the subprojects within this project.
tasks
projen.TasksProject tasks.
testTask
projen.TaskNo description.
defaultTask
projen.TaskThis is the "default" task, the one that executes "projen".
initProject
projen.InitProjectThe options used when this project is bootstrapped via projen new.
parent
projen.ProjectA parent project.
projectType
projen.ProjectTypeNo description.
autoApprove
projen.github.AutoApproveAuto approve set up for this project.
devContainer
projen.vscode.DevContainerAccess for .devcontainer.json (used for GitHub Codespaces).
github
projen.github.GitHubAccess all github components.
gitpod
projen.GitpodAccess for Gitpod.
vscode
projen.vscode.VsCodeAccess all VSCode components.
allowLibraryDependencies
booleanNo description.
artifactsDirectory
stringThe build output directory.
artifactsJavascriptDirectory
stringThe location of the npm tarball after build (${artifactsDirectory}/js).
bundler
projen.javascript.BundlerNo description.
entrypoint
stringNo description.
manifest
anyNo description.
npmrc
projen.javascript.NpmConfigThe .npmrc file.
package
projen.javascript.NodePackageAPI for managing the node package.
packageManager
projen.javascript.NodePackageManagerThe package manager to use.
runScriptCommand
stringThe command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
autoMerge
projen.github.AutoMergeComponent that sets up mergify for merging approved pull requests.
buildWorkflow
projen.build.BuildWorkflowThe PR build GitHub workflow.
buildWorkflowJobId
stringThe job ID of the build workflow.
jest
projen.javascript.JestThe Jest configuration (if enabled).
maxNodeVersion
stringMaximum node version required by this package.
minNodeVersion
stringMinimum node.js version required by this package.
npmignore
projen.IgnoreFileThe .npmignore file.
prettier
projen.javascript.PrettierNo description.
publisher
projen.release.PublisherPackage publisher.
release
projen.release.ReleaseRelease management.
upgradeWorkflow
projen.javascript.UpgradeDependenciesThe upgrade workflow.
docsDirectory
stringNo description.
libdir
stringThe directory in which compiled .js files reside.
srcdir
stringThe directory in which the .ts sources reside.
testdir
stringThe directory in which tests reside.
tsconfigDev
projen.javascript.TypescriptConfigA typescript configuration file which covers all files (sources, tests, projen).
watchTask
projen.TaskThe "watch" task.
docgen
booleanNo description.
eslint
projen.javascript.EslintNo description.
tsconfig
projen.javascript.TypescriptConfigNo description.
tsconfigEslint
projen.javascript.TypescriptConfigNo description.
cdkDeps
AwsCdkDeps
No description.
cdkVersion
stringThe target CDK version for this library.
version
stringNo description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


buildTaskRequired
public readonly buildTask: Task;
  • Type: projen.Task

commitGeneratedRequired
public readonly commitGenerated: boolean;
  • Type: boolean

Whether to commit the managed files by default.


compileTaskRequired
public readonly compileTask: Task;
  • Type: projen.Task

componentsRequired
public readonly components: Component[];
  • Type: projen.Component[]

Returns all the components within this project.


depsRequired
public readonly deps: Dependencies;
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
public readonly ejected: boolean;
  • Type: boolean

Whether or not the project is being ejected.


filesRequired
public readonly files: FileBase[];
  • Type: projen.FileBase[]

All files in this project.


gitattributesRequired
public readonly gitattributes: GitAttributesFile;
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public readonly gitignore: IgnoreFile;
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
public readonly logger: Logger;
  • Type: projen.Logger

Logging utilities.


nameRequired
public readonly name: string;
  • Type: string

Project name.


outdirRequired
public readonly outdir: string;
  • Type: string

Absolute output directory of this project.


packageTaskRequired
public readonly packageTask: Task;
  • Type: projen.Task

postCompileTaskRequired
public readonly postCompileTask: Task;
  • Type: projen.Task

preCompileTaskRequired
public readonly preCompileTask: Task;
  • Type: projen.Task

projectBuildRequired
public readonly projectBuild: ProjectBuild;
  • Type: projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public readonly projenCommand: string;
  • Type: string

The command to use in order to run the projen CLI.


rootRequired
public readonly root: Project;
  • Type: projen.Project

The root project.


subprojectsRequired
public readonly subprojects: Project[];
  • Type: projen.Project[]

Returns all the subprojects within this project.


tasksRequired
public readonly tasks: Tasks;
  • Type: projen.Tasks

Project tasks.


testTaskRequired
public readonly testTask: Task;
  • Type: projen.Task

defaultTaskOptional
public readonly defaultTask: Task;
  • Type: projen.Task

This is the "default" task, the one that executes "projen".

Undefined if the project is being ejected.


initProjectOptional
public readonly initProject: InitProject;
  • Type: projen.InitProject

The options used when this project is bootstrapped via projen new.

It includes the original set of options passed to the CLI and also the JSII FQN of the project type.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
public readonly projectType: ProjectType;
  • Type: projen.ProjectType

autoApproveOptional
public readonly autoApprove: AutoApprove;
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
public readonly devContainer: DevContainer;
  • Type: projen.vscode.DevContainer

Access for .devcontainer.json (used for GitHub Codespaces).

This will be undefined if devContainer boolean is false


githubOptional
public readonly github: GitHub;
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
public readonly gitpod: Gitpod;
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
public readonly vscode: VsCode;
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


allowLibraryDependenciesRequired
  • Deprecated: use package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
  • Type: boolean

artifactsDirectoryRequired
public readonly artifactsDirectory: string;
  • Type: string

The build output directory.

An npm tarball will be created under the js subdirectory. For example, if this is set to dist (the default), the npm tarball will be placed under dist/js/boom-boom-1.2.3.tg.


artifactsJavascriptDirectoryRequired
public readonly artifactsJavascriptDirectory: string;
  • Type: string

The location of the npm tarball after build (${artifactsDirectory}/js).


bundlerRequired
public readonly bundler: Bundler;
  • Type: projen.javascript.Bundler

entrypointRequired
  • Deprecated: use package.entrypoint
public readonly entrypoint: string;
  • Type: string

manifestRequired
  • Deprecated: use package.addField(x, y)
public readonly manifest: any;
  • Type: any

npmrcRequired
public readonly npmrc: NpmConfig;
  • Type: projen.javascript.NpmConfig

The .npmrc file.


packageRequired
public readonly package: NodePackage;
  • Type: projen.javascript.NodePackage

API for managing the node package.


packageManagerRequired
  • Deprecated: use package.packageManager
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager

The package manager to use.


runScriptCommandRequired
public readonly runScriptCommand: string;
  • Type: string

The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).


autoMergeOptional
public readonly autoMerge: AutoMerge;
  • Type: projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


buildWorkflowOptional
public readonly buildWorkflow: BuildWorkflow;
  • Type: projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


buildWorkflowJobIdOptional
public readonly buildWorkflowJobId: string;
  • Type: string

The job ID of the build workflow.


jestOptional
public readonly jest: Jest;
  • Type: projen.javascript.Jest

The Jest configuration (if enabled).


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string

Maximum node version required by this package.


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string

Minimum node.js version required by this package.


npmignoreOptional
public readonly npmignore: IgnoreFile;
  • Type: projen.IgnoreFile

The .npmignore file.


prettierOptional
public readonly prettier: Prettier;
  • Type: projen.javascript.Prettier

publisherOptional
  • Deprecated: use release.publisher.
public readonly publisher: Publisher;
  • Type: projen.release.Publisher

Package publisher.

This will be undefined if the project does not have a release workflow.


releaseOptional
public readonly release: Release;
  • Type: projen.release.Release

Release management.


upgradeWorkflowOptional
public readonly upgradeWorkflow: UpgradeDependencies;
  • Type: projen.javascript.UpgradeDependencies

The upgrade workflow.


docsDirectoryRequired
public readonly docsDirectory: string;
  • Type: string

libdirRequired
public readonly libdir: string;
  • Type: string

The directory in which compiled .js files reside.


srcdirRequired
public readonly srcdir: string;
  • Type: string

The directory in which the .ts sources reside.


testdirRequired
public readonly testdir: string;
  • Type: string

The directory in which tests reside.


tsconfigDevRequired
public readonly tsconfigDev: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

A typescript configuration file which covers all files (sources, tests, projen).


watchTaskRequired
public readonly watchTask: Task;
  • Type: projen.Task

The "watch" task.


docgenOptional
public readonly docgen: boolean;
  • Type: boolean

eslintOptional
public readonly eslint: Eslint;
  • Type: projen.javascript.Eslint

tsconfigOptional
public readonly tsconfig: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

tsconfigEslintOptional
public readonly tsconfigEslint: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The target CDK version for this library.


versionRequired
  • Deprecated: use cdkVersion
public readonly version: string;
  • Type: string

Constants

NameTypeDescription
DEFAULT_TASK
stringThe name of the default task (the task executed when projen is run without arguments).
DEFAULT_TS_JEST_TRANFORM_PATTERN
stringNo description.

DEFAULT_TASKRequired
public readonly DEFAULT_TASK: string;
  • Type: string

The name of the default task (the task executed when projen is run without arguments).

Normally this task should synthesize the project files.


DEFAULT_TS_JEST_TRANFORM_PATTERNRequired
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
  • Type: string

AwsCdkDeps

Manages dependencies on the AWS CDK.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkDeps(project: Project, options: AwsCdkDepsOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
AwsCdkDepsOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.
addV1Dependencies
Adds dependencies to AWS CDK modules.
addV1DevDependencies
Adds AWS CDK modules as dev dependencies.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

addV1Dependencies
public addV1Dependencies(deps: string): void

Adds dependencies to AWS CDK modules.

The type of dependency is determined by the dependencyType option.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


addV1DevDependencies
public addV1DevDependencies(deps: string): void

Adds AWS CDK modules as dev dependencies.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkDeps.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.AwsCdkDeps.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
cdkDependenciesAsDeps
booleanWhether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
numberThe major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
stringThe minimum version of the AWS CDK (e.g. 2.0.0).
cdkVersion
stringThe dependency requirement for AWS CDK (e.g. ^2.0.0).

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

cdkDependenciesAsDepsRequired
  • Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean

Whether CDK dependencies are added as normal dependencies (and peer dependencies).


cdkMajorVersionRequired
public readonly cdkMajorVersion: number;
  • Type: number

The major version of the AWS CDK (e.g. 1, 2, ...).


cdkMinimumVersionRequired
public readonly cdkMinimumVersion: string;
  • Type: string

The minimum version of the AWS CDK (e.g. 2.0.0).


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The dependency requirement for AWS CDK (e.g. ^2.0.0).


AwsCdkDepsJava

Manages dependencies on the AWS CDK for Java projects.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkDepsJava(project: Project, options: AwsCdkDepsOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
AwsCdkDepsOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.
addV1Dependencies
Adds dependencies to AWS CDK modules.
addV1DevDependencies
Adds AWS CDK modules as dev dependencies.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

addV1Dependencies
public addV1Dependencies(deps: string): void

Adds dependencies to AWS CDK modules.

The type of dependency is determined by the dependencyType option.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


addV1DevDependencies
public addV1DevDependencies(deps: string): void

Adds AWS CDK modules as dev dependencies.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkDepsJava.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.AwsCdkDepsJava.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
cdkDependenciesAsDeps
booleanWhether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
numberThe major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
stringThe minimum version of the AWS CDK (e.g. 2.0.0).
cdkVersion
stringThe dependency requirement for AWS CDK (e.g. ^2.0.0).

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

cdkDependenciesAsDepsRequired
  • Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean

Whether CDK dependencies are added as normal dependencies (and peer dependencies).


cdkMajorVersionRequired
public readonly cdkMajorVersion: number;
  • Type: number

The major version of the AWS CDK (e.g. 1, 2, ...).


cdkMinimumVersionRequired
public readonly cdkMinimumVersion: string;
  • Type: string

The minimum version of the AWS CDK (e.g. 2.0.0).


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The dependency requirement for AWS CDK (e.g. ^2.0.0).


AwsCdkDepsJs

Manages dependencies on the AWS CDK for Node.js projects.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkDepsJs(project: Project, options: AwsCdkDepsOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
AwsCdkDepsOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.
addV1Dependencies
Adds dependencies to AWS CDK modules.
addV1DevDependencies
Adds AWS CDK modules as dev dependencies.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

addV1Dependencies
public addV1Dependencies(deps: string): void

Adds dependencies to AWS CDK modules.

The type of dependency is determined by the dependencyType option.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


addV1DevDependencies
public addV1DevDependencies(deps: string): void

Adds AWS CDK modules as dev dependencies.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkDepsJs.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.AwsCdkDepsJs.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
cdkDependenciesAsDeps
booleanWhether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
numberThe major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
stringThe minimum version of the AWS CDK (e.g. 2.0.0).
cdkVersion
stringThe dependency requirement for AWS CDK (e.g. ^2.0.0).

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

cdkDependenciesAsDepsRequired
  • Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean

Whether CDK dependencies are added as normal dependencies (and peer dependencies).


cdkMajorVersionRequired
public readonly cdkMajorVersion: number;
  • Type: number

The major version of the AWS CDK (e.g. 1, 2, ...).


cdkMinimumVersionRequired
public readonly cdkMinimumVersion: string;
  • Type: string

The minimum version of the AWS CDK (e.g. 2.0.0).


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The dependency requirement for AWS CDK (e.g. ^2.0.0).


AwsCdkDepsPy

Manages dependencies on the AWS CDK for Python projects.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkDepsPy(project: Project, options: AwsCdkDepsOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
AwsCdkDepsOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.
addV1Dependencies
Adds dependencies to AWS CDK modules.
addV1DevDependencies
Adds AWS CDK modules as dev dependencies.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

addV1Dependencies
public addV1Dependencies(deps: string): void

Adds dependencies to AWS CDK modules.

The type of dependency is determined by the dependencyType option.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


addV1DevDependencies
public addV1DevDependencies(deps: string): void

Adds AWS CDK modules as dev dependencies.

This method is not supported in CDK v2. Use project.addPeerDeps() or project.addDeps() as appropriate.

depsRequired
  • Type: string

fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkDepsPy.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.AwsCdkDepsPy.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
cdkDependenciesAsDeps
booleanWhether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
numberThe major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
stringThe minimum version of the AWS CDK (e.g. 2.0.0).
cdkVersion
stringThe dependency requirement for AWS CDK (e.g. ^2.0.0).

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

cdkDependenciesAsDepsRequired
  • Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean

Whether CDK dependencies are added as normal dependencies (and peer dependencies).


cdkMajorVersionRequired
public readonly cdkMajorVersion: number;
  • Type: number

The major version of the AWS CDK (e.g. 1, 2, ...).


cdkMinimumVersionRequired
public readonly cdkMinimumVersion: string;
  • Type: string

The minimum version of the AWS CDK (e.g. 2.0.0).


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The dependency requirement for AWS CDK (e.g. ^2.0.0).


AwsCdkJavaApp

AWS CDK app in Java.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkJavaApp(options: AwsCdkJavaAppOptions)
NameTypeDescription
options
AwsCdkJavaAppOptions
No description.

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
addExcludeFromCleanup
Exclude the matching files from pre-synth cleanup.
addGitIgnore
Adds a .gitignore pattern.
addPackageIgnore
Exclude these files from the bundled package.
addTask
Adds a new task to this project.
addTip
Prints a "tip" message during synthesis.
annotateGenerated
Marks the provided file(s) as being generated.
postSynthesize
Called after all components are synthesized.
preSynthesize
Called before all components are synthesized.
removeTask
Removes a task from a project.
runTaskCommand
Returns the shell command to execute in order to run a task.
synth
Synthesize all project files into outdir.
tryFindFile
Finds a file at the specified relative path within this project and all its subprojects.
tryFindJsonFile
Finds a json file by name.
tryFindObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
tryRemoveFile
Finds a file at the specified relative path within this project and removes it.
addDependency
Adds a runtime dependency.
addPlugin
Adds a build plugin to the pom.
addTestDependency
Adds a test dependency.
addCdkDependency
Adds an AWS CDK module dependencies.

toString
public toString(): string

Returns a string representation of this construct.

addExcludeFromCleanup
public addExcludeFromCleanup(globs: string): void

Exclude the matching files from pre-synth cleanup.

Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.

globsRequired
  • Type: string

The glob patterns to match.


addGitIgnore
public addGitIgnore(pattern: string): void

Adds a .gitignore pattern.

patternRequired
  • Type: string

The glob pattern to ignore.


addPackageIgnore
public addPackageIgnore(_pattern: string): void

Exclude these files from the bundled package.

Implemented by project types based on the packaging mechanism. For example, NodeProject delegates this to .npmignore.

_patternRequired
  • Type: string

The glob pattern to exclude.


addTask
public addTask(name: string, props?: TaskOptions): Task

Adds a new task to this project.

This will fail if the project already has a task with this name.

nameRequired
  • Type: string

The task name to add.


propsOptional
  • Type: projen.TaskOptions

Task properties.


addTip
public addTip(message: string): void

Prints a "tip" message during synthesis.

messageRequired
  • Type: string

The message.


annotateGenerated
public annotateGenerated(glob: string): void

Marks the provided file(s) as being generated.

This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.

https://github.com/github/linguist/blob/master/docs/overrides.md

globRequired
  • Type: string

the glob pattern to match (could be a file path).


postSynthesize
public postSynthesize(): void

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before all components are synthesized.

removeTask
public removeTask(name: string): Task

Removes a task from a project.

nameRequired
  • Type: string

The name of the task to remove.


runTaskCommand
public runTaskCommand(task: Task): string

Returns the shell command to execute in order to run a task.

By default, this is npx projen@<version> <task>

taskRequired
  • Type: projen.Task

The task for which the command is required.


synth
public synth(): void

Synthesize all project files into outdir.

  1. Call "this.preSynthesize()"
  2. Delete all generated files
  3. Synthesize all subprojects
  4. Synthesize all components of this project
  5. Call "postSynthesize()" for all components of this project
  6. Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and all its subprojects.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile

Finds a json file by name.

filePathRequired
  • Type: string

The file path.


tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile

Finds an object file (like JsonFile, YamlFile, etc.) by name.

filePathRequired
  • Type: string

The file path.


tryRemoveFile
public tryRemoveFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and removes it.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


addDependency
public addDependency(spec: string): void

Adds a runtime dependency.

specRequired
  • Type: string

Format <groupId>/<artifactId>@<semver>.


addPlugin
public addPlugin(spec: string, options?: PluginOptions): Dependency

Adds a build plugin to the pom.

The plug in is also added as a BUILD dep to the project.

specRequired
  • Type: string

dependency spec (group/artifact@version).


optionsOptional
  • Type: projen.java.PluginOptions

plugin options.


addTestDependency
public addTestDependency(spec: string): void

Adds a test dependency.

specRequired
  • Type: string

Format <groupId>/<artifactId>@<semver>.


addCdkDependency
public addCdkDependency(modules: string): void

Adds an AWS CDK module dependencies.

modulesRequired
  • Type: string

The list of modules to depend on (e.g. "software.amazon.awscdk/aws-lambda", "software.amazon.awscdk/aws-iam", etc).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isProject
Test whether the given construct is a project.
of
Find the closest ancestor project for given construct.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkJavaApp.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isProject
import { awscdk } from 'projen'

awscdk.AwsCdkJavaApp.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { awscdk } from 'projen'

awscdk.AwsCdkJavaApp.of(construct: IConstruct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
buildTask
projen.TaskNo description.
commitGenerated
booleanWhether to commit the managed files by default.
compileTask
projen.TaskNo description.
components
projen.Component[]Returns all the components within this project.
deps
projen.DependenciesProject dependencies.
ejected
booleanWhether or not the project is being ejected.
files
projen.FileBase[]All files in this project.
gitattributes
projen.GitAttributesFileThe .gitattributes file for this repository.
gitignore
projen.IgnoreFile.gitignore.
logger
projen.LoggerLogging utilities.
name
stringProject name.
outdir
stringAbsolute output directory of this project.
packageTask
projen.TaskNo description.
postCompileTask
projen.TaskNo description.
preCompileTask
projen.TaskNo description.
projectBuild
projen.ProjectBuildManages the build process of the project.
projenCommand
stringThe command to use in order to run the projen CLI.
root
projen.ProjectThe root project.
subprojects
projen.Project[]Returns all the subprojects within this project.
tasks
projen.TasksProject tasks.
testTask
projen.TaskNo description.
defaultTask
projen.TaskThis is the "default" task, the one that executes "projen".
initProject
projen.InitProjectThe options used when this project is bootstrapped via projen new.
parent
projen.ProjectA parent project.
projectType
projen.ProjectTypeNo description.
autoApprove
projen.github.AutoApproveAuto approve set up for this project.
devContainer
projen.vscode.DevContainerAccess for .devcontainer.json (used for GitHub Codespaces).
github
projen.github.GitHubAccess all github components.
gitpod
projen.GitpodAccess for Gitpod.
vscode
projen.vscode.VsCodeAccess all VSCode components.
compile
projen.java.MavenCompileCompile component.
distdir
stringMaven artifact output directory.
packaging
projen.java.MavenPackagingPackaging component.
pom
projen.java.PomAPI for managing pom.xml.
junit
projen.java.JunitJUnit component.
projenrc
projen.java.ProjenrcProjenrc component.
cdkConfig
CdkConfig
The cdk.json file.
cdkDeps
AwsCdkDeps
CDK dependency management helper class.
cdkTasks
CdkTasks
CDK tasks.
mainClass
stringThe full name of the main class of the java app (package.Class).
mainClassName
stringThe name of the Java class with the static main() method.
mainPackage
stringThe name of the Java package that includes the main class.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


buildTaskRequired
public readonly buildTask: Task;
  • Type: projen.Task

commitGeneratedRequired
public readonly commitGenerated: boolean;
  • Type: boolean

Whether to commit the managed files by default.


compileTaskRequired
public readonly compileTask: Task;
  • Type: projen.Task

componentsRequired
public readonly components: Component[];
  • Type: projen.Component[]

Returns all the components within this project.


depsRequired
public readonly deps: Dependencies;
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
public readonly ejected: boolean;
  • Type: boolean

Whether or not the project is being ejected.


filesRequired
public readonly files: FileBase[];
  • Type: projen.FileBase[]

All files in this project.


gitattributesRequired
public readonly gitattributes: GitAttributesFile;
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public readonly gitignore: IgnoreFile;
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
public readonly logger: Logger;
  • Type: projen.Logger

Logging utilities.


nameRequired
public readonly name: string;
  • Type: string

Project name.


outdirRequired
public readonly outdir: string;
  • Type: string

Absolute output directory of this project.


packageTaskRequired
public readonly packageTask: Task;
  • Type: projen.Task

postCompileTaskRequired
public readonly postCompileTask: Task;
  • Type: projen.Task

preCompileTaskRequired
public readonly preCompileTask: Task;
  • Type: projen.Task

projectBuildRequired
public readonly projectBuild: ProjectBuild;
  • Type: projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public readonly projenCommand: string;
  • Type: string

The command to use in order to run the projen CLI.


rootRequired
public readonly root: Project;
  • Type: projen.Project

The root project.


subprojectsRequired
public readonly subprojects: Project[];
  • Type: projen.Project[]

Returns all the subprojects within this project.


tasksRequired
public readonly tasks: Tasks;
  • Type: projen.Tasks

Project tasks.


testTaskRequired
public readonly testTask: Task;
  • Type: projen.Task

defaultTaskOptional
public readonly defaultTask: Task;
  • Type: projen.Task

This is the "default" task, the one that executes "projen".

Undefined if the project is being ejected.


initProjectOptional
public readonly initProject: InitProject;
  • Type: projen.InitProject

The options used when this project is bootstrapped via projen new.

It includes the original set of options passed to the CLI and also the JSII FQN of the project type.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
public readonly projectType: ProjectType;
  • Type: projen.ProjectType

autoApproveOptional
public readonly autoApprove: AutoApprove;
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
public readonly devContainer: DevContainer;
  • Type: projen.vscode.DevContainer

Access for .devcontainer.json (used for GitHub Codespaces).

This will be undefined if devContainer boolean is false


githubOptional
public readonly github: GitHub;
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
public readonly gitpod: Gitpod;
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
public readonly vscode: VsCode;
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


compileRequired
public readonly compile: MavenCompile;
  • Type: projen.java.MavenCompile

Compile component.


distdirRequired
public readonly distdir: string;
  • Type: string

Maven artifact output directory.


packagingRequired
public readonly packaging: MavenPackaging;
  • Type: projen.java.MavenPackaging

Packaging component.


pomRequired
public readonly pom: Pom;
  • Type: projen.java.Pom

API for managing pom.xml.


junitOptional
public readonly junit: Junit;
  • Type: projen.java.Junit

JUnit component.


projenrcOptional
public readonly projenrc: Projenrc;
  • Type: projen.java.Projenrc

Projenrc component.


cdkConfigRequired
public readonly cdkConfig: CdkConfig;

The cdk.json file.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

CDK dependency management helper class.


cdkTasksRequired
public readonly cdkTasks: CdkTasks;

CDK tasks.


mainClassRequired
public readonly mainClass: string;
  • Type: string

The full name of the main class of the java app (package.Class).


mainClassNameRequired
public readonly mainClassName: string;
  • Type: string

The name of the Java class with the static main() method.


mainPackageRequired
public readonly mainPackage: string;
  • Type: string

The name of the Java package that includes the main class.


Constants

NameTypeDescription
DEFAULT_TASK
stringThe name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
public readonly DEFAULT_TASK: string;
  • Type: string

The name of the default task (the task executed when projen is run without arguments).

Normally this task should synthesize the project files.


AwsCdkPythonApp

AWS CDK app in Python.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkPythonApp(options: AwsCdkPythonAppOptions)
NameTypeDescription
options
AwsCdkPythonAppOptions
No description.

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
addExcludeFromCleanup
Exclude the matching files from pre-synth cleanup.
addGitIgnore
Adds a .gitignore pattern.
addPackageIgnore
Exclude these files from the bundled package.
addTask
Adds a new task to this project.
addTip
Prints a "tip" message during synthesis.
annotateGenerated
Marks the provided file(s) as being generated.
postSynthesize
Called after all components are synthesized.
preSynthesize
Called before all components are synthesized.
removeTask
Removes a task from a project.
runTaskCommand
Returns the shell command to execute in order to run a task.
synth
Synthesize all project files into outdir.
tryFindFile
Finds a file at the specified relative path within this project and all its subprojects.
tryFindJsonFile
Finds a json file by name.
tryFindObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
tryRemoveFile
Finds a file at the specified relative path within this project and removes it.
addDependency
Adds a runtime dependency.
addDevDependency
Adds a dev dependency.

toString
public toString(): string

Returns a string representation of this construct.

addExcludeFromCleanup
public addExcludeFromCleanup(globs: string): void

Exclude the matching files from pre-synth cleanup.

Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.

globsRequired
  • Type: string

The glob patterns to match.


addGitIgnore
public addGitIgnore(pattern: string): void

Adds a .gitignore pattern.

patternRequired
  • Type: string

The glob pattern to ignore.


addPackageIgnore
public addPackageIgnore(_pattern: string): void

Exclude these files from the bundled package.

Implemented by project types based on the packaging mechanism. For example, NodeProject delegates this to .npmignore.

_patternRequired
  • Type: string

The glob pattern to exclude.


addTask
public addTask(name: string, props?: TaskOptions): Task

Adds a new task to this project.

This will fail if the project already has a task with this name.

nameRequired
  • Type: string

The task name to add.


propsOptional
  • Type: projen.TaskOptions

Task properties.


addTip
public addTip(message: string): void

Prints a "tip" message during synthesis.

messageRequired
  • Type: string

The message.


annotateGenerated
public annotateGenerated(glob: string): void

Marks the provided file(s) as being generated.

This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.

https://github.com/github/linguist/blob/master/docs/overrides.md

globRequired
  • Type: string

the glob pattern to match (could be a file path).


postSynthesize
public postSynthesize(): void

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before all components are synthesized.

removeTask
public removeTask(name: string): Task

Removes a task from a project.

nameRequired
  • Type: string

The name of the task to remove.


runTaskCommand
public runTaskCommand(task: Task): string

Returns the shell command to execute in order to run a task.

By default, this is npx projen@<version> <task>

taskRequired
  • Type: projen.Task

The task for which the command is required.


synth
public synth(): void

Synthesize all project files into outdir.

  1. Call "this.preSynthesize()"
  2. Delete all generated files
  3. Synthesize all subprojects
  4. Synthesize all components of this project
  5. Call "postSynthesize()" for all components of this project
  6. Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and all its subprojects.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile

Finds a json file by name.

filePathRequired
  • Type: string

The file path.


tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile

Finds an object file (like JsonFile, YamlFile, etc.) by name.

filePathRequired
  • Type: string

The file path.


tryRemoveFile
public tryRemoveFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and removes it.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


addDependency
public addDependency(spec: string): void

Adds a runtime dependency.

specRequired
  • Type: string

Format <module>@<semver>.


addDevDependency
public addDevDependency(spec: string): void

Adds a dev dependency.

specRequired
  • Type: string

Format <module>@<semver>.


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isProject
Test whether the given construct is a project.
of
Find the closest ancestor project for given construct.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkPythonApp.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isProject
import { awscdk } from 'projen'

awscdk.AwsCdkPythonApp.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { awscdk } from 'projen'

awscdk.AwsCdkPythonApp.of(construct: IConstruct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
buildTask
projen.TaskNo description.
commitGenerated
booleanWhether to commit the managed files by default.
compileTask
projen.TaskNo description.
components
projen.Component[]Returns all the components within this project.
deps
projen.DependenciesProject dependencies.
ejected
booleanWhether or not the project is being ejected.
files
projen.FileBase[]All files in this project.
gitattributes
projen.GitAttributesFileThe .gitattributes file for this repository.
gitignore
projen.IgnoreFile.gitignore.
logger
projen.LoggerLogging utilities.
name
stringProject name.
outdir
stringAbsolute output directory of this project.
packageTask
projen.TaskNo description.
postCompileTask
projen.TaskNo description.
preCompileTask
projen.TaskNo description.
projectBuild
projen.ProjectBuildManages the build process of the project.
projenCommand
stringThe command to use in order to run the projen CLI.
root
projen.ProjectThe root project.
subprojects
projen.Project[]Returns all the subprojects within this project.
tasks
projen.TasksProject tasks.
testTask
projen.TaskNo description.
defaultTask
projen.TaskThis is the "default" task, the one that executes "projen".
initProject
projen.InitProjectThe options used when this project is bootstrapped via projen new.
parent
projen.ProjectA parent project.
projectType
projen.ProjectTypeNo description.
autoApprove
projen.github.AutoApproveAuto approve set up for this project.
devContainer
projen.vscode.DevContainerAccess for .devcontainer.json (used for GitHub Codespaces).
github
projen.github.GitHubAccess all github components.
gitpod
projen.GitpodAccess for Gitpod.
vscode
projen.vscode.VsCodeAccess all VSCode components.
depsManager
projen.python.IPythonDepsAPI for managing dependencies.
envManager
projen.python.IPythonEnvAPI for mangaging the Python runtime environment.
moduleName
stringPython module name (the project name, with any hyphens or periods replaced with underscores).
version
stringVersion of the package for distribution (should follow semver).
packagingManager
projen.python.IPythonPackagingAPI for managing packaging the project as a library.
pytest
projen.python.PytestPytest component.
appEntrypoint
stringThe CDK app entrypoint.
cdkConfig
CdkConfig
cdk.json configuration.
cdkDeps
AwsCdkDeps
No description.
cdkTasks
CdkTasks
Common CDK tasks.
cdkVersion
stringThe CDK version this app is using.
testdir
stringThe directory in which the python tests reside.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


buildTaskRequired
public readonly buildTask: Task;
  • Type: projen.Task

commitGeneratedRequired
public readonly commitGenerated: boolean;
  • Type: boolean

Whether to commit the managed files by default.


compileTaskRequired
public readonly compileTask: Task;
  • Type: projen.Task

componentsRequired
public readonly components: Component[];
  • Type: projen.Component[]

Returns all the components within this project.


depsRequired
public readonly deps: Dependencies;
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
public readonly ejected: boolean;
  • Type: boolean

Whether or not the project is being ejected.


filesRequired
public readonly files: FileBase[];
  • Type: projen.FileBase[]

All files in this project.


gitattributesRequired
public readonly gitattributes: GitAttributesFile;
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public readonly gitignore: IgnoreFile;
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
public readonly logger: Logger;
  • Type: projen.Logger

Logging utilities.


nameRequired
public readonly name: string;
  • Type: string

Project name.


outdirRequired
public readonly outdir: string;
  • Type: string

Absolute output directory of this project.


packageTaskRequired
public readonly packageTask: Task;
  • Type: projen.Task

postCompileTaskRequired
public readonly postCompileTask: Task;
  • Type: projen.Task

preCompileTaskRequired
public readonly preCompileTask: Task;
  • Type: projen.Task

projectBuildRequired
public readonly projectBuild: ProjectBuild;
  • Type: projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public readonly projenCommand: string;
  • Type: string

The command to use in order to run the projen CLI.


rootRequired
public readonly root: Project;
  • Type: projen.Project

The root project.


subprojectsRequired
public readonly subprojects: Project[];
  • Type: projen.Project[]

Returns all the subprojects within this project.


tasksRequired
public readonly tasks: Tasks;
  • Type: projen.Tasks

Project tasks.


testTaskRequired
public readonly testTask: Task;
  • Type: projen.Task

defaultTaskOptional
public readonly defaultTask: Task;
  • Type: projen.Task

This is the "default" task, the one that executes "projen".

Undefined if the project is being ejected.


initProjectOptional
public readonly initProject: InitProject;
  • Type: projen.InitProject

The options used when this project is bootstrapped via projen new.

It includes the original set of options passed to the CLI and also the JSII FQN of the project type.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
public readonly projectType: ProjectType;
  • Type: projen.ProjectType

autoApproveOptional
public readonly autoApprove: AutoApprove;
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
public readonly devContainer: DevContainer;
  • Type: projen.vscode.DevContainer

Access for .devcontainer.json (used for GitHub Codespaces).

This will be undefined if devContainer boolean is false


githubOptional
public readonly github: GitHub;
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
public readonly gitpod: Gitpod;
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
public readonly vscode: VsCode;
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


depsManagerRequired
public readonly depsManager: IPythonDeps;
  • Type: projen.python.IPythonDeps

API for managing dependencies.


envManagerRequired
public readonly envManager: IPythonEnv;
  • Type: projen.python.IPythonEnv

API for mangaging the Python runtime environment.


moduleNameRequired
public readonly moduleName: string;
  • Type: string

Python module name (the project name, with any hyphens or periods replaced with underscores).


versionRequired
public readonly version: string;
  • Type: string

Version of the package for distribution (should follow semver).


packagingManagerOptional
public readonly packagingManager: IPythonPackaging;
  • Type: projen.python.IPythonPackaging

API for managing packaging the project as a library.

Only applies when the projectType is LIB.


pytestOptional
public readonly pytest: Pytest;
  • Type: projen.python.Pytest

Pytest component.


appEntrypointRequired
public readonly appEntrypoint: string;
  • Type: string

The CDK app entrypoint.


cdkConfigRequired
public readonly cdkConfig: CdkConfig;

cdk.json configuration.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

cdkTasksRequired
public readonly cdkTasks: CdkTasks;

Common CDK tasks.


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The CDK version this app is using.


testdirRequired
public readonly testdir: string;
  • Type: string

The directory in which the python tests reside.


Constants

NameTypeDescription
DEFAULT_TASK
stringThe name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
public readonly DEFAULT_TASK: string;
  • Type: string

The name of the default task (the task executed when projen is run without arguments).

Normally this task should synthesize the project files.


AwsCdkTypeScriptApp

AWS CDK app in TypeScript.

Initializers

import { awscdk } from 'projen'

new awscdk.AwsCdkTypeScriptApp(options: AwsCdkTypeScriptAppOptions)
NameTypeDescription
options
AwsCdkTypeScriptAppOptions
No description.

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
addExcludeFromCleanup
Exclude the matching files from pre-synth cleanup.
addGitIgnore
Adds a .gitignore pattern.
addPackageIgnore
Adds patterns to be ignored by npm.
addTask
Adds a new task to this project.
addTip
Prints a "tip" message during synthesis.
annotateGenerated
Marks the provided file(s) as being generated.
postSynthesize
Called after all components are synthesized.
preSynthesize
Called before all components are synthesized.
removeTask
Removes a task from a project.
runTaskCommand
Returns the shell command to execute in order to run a task.
synth
Synthesize all project files into outdir.
tryFindFile
Finds a file at the specified relative path within this project and all its subprojects.
tryFindJsonFile
Finds a json file by name.
tryFindObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
tryRemoveFile
Finds a file at the specified relative path within this project and removes it.
addBins
No description.
addBundledDeps
Defines bundled dependencies.
addCompileCommand
DEPRECATED.
addDeps
Defines normal dependencies.
addDevDeps
Defines development/test dependencies.
addFields
Directly set fields in package.json.
addKeywords
Adds keywords to package.json (deduplicated).
addPeerDeps
Defines peer dependencies.
addScripts
Replaces the contents of multiple npm package.json scripts.
addTestCommand
DEPRECATED.
hasScript
Indicates if a script by the name name is defined.
removeScript
Removes the npm script (always successful).
renderWorkflowSetup
Returns the set of workflow steps which should be executed to bootstrap a workflow.
setScript
Replaces the contents of an npm package.json script.
addCdkDependency
Adds an AWS CDK module dependencies.

toString
public toString(): string

Returns a string representation of this construct.

addExcludeFromCleanup
public addExcludeFromCleanup(globs: string): void

Exclude the matching files from pre-synth cleanup.

Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.

globsRequired
  • Type: string

The glob patterns to match.


addGitIgnore
public addGitIgnore(pattern: string): void

Adds a .gitignore pattern.

patternRequired
  • Type: string

The glob pattern to ignore.


addPackageIgnore
public addPackageIgnore(pattern: string): void

Adds patterns to be ignored by npm.

patternRequired
  • Type: string

The pattern to ignore.


addTask
public addTask(name: string, props?: TaskOptions): Task

Adds a new task to this project.

This will fail if the project already has a task with this name.

nameRequired
  • Type: string

The task name to add.


propsOptional
  • Type: projen.TaskOptions

Task properties.


addTip
public addTip(message: string): void

Prints a "tip" message during synthesis.

messageRequired
  • Type: string

The message.


annotateGenerated
public annotateGenerated(glob: string): void

Marks the provided file(s) as being generated.

This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.

https://github.com/github/linguist/blob/master/docs/overrides.md

globRequired
  • Type: string

the glob pattern to match (could be a file path).


postSynthesize
public postSynthesize(): void

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before all components are synthesized.

removeTask
public removeTask(name: string): Task

Removes a task from a project.

nameRequired
  • Type: string

The name of the task to remove.


runTaskCommand
public runTaskCommand(task: Task): string

Returns the shell command to execute in order to run a task.

This will typically be npx projen TASK.

taskRequired
  • Type: projen.Task

The task for which the command is required.


synth
public synth(): void

Synthesize all project files into outdir.

  1. Call "this.preSynthesize()"
  2. Delete all generated files
  3. Synthesize all subprojects
  4. Synthesize all components of this project
  5. Call "postSynthesize()" for all components of this project
  6. Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and all its subprojects.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile

Finds a json file by name.

filePathRequired
  • Type: string

The file path.


tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile

Finds an object file (like JsonFile, YamlFile, etc.) by name.

filePathRequired
  • Type: string

The file path.


tryRemoveFile
public tryRemoveFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and removes it.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


addBins
public addBins(bins: {[ key: string ]: string}): void
binsRequired
  • Type: {[ key: string ]: string}

addBundledDeps
public addBundledDeps(deps: string): void

Defines bundled dependencies.

Bundled dependencies will be added as normal dependencies as well as to the bundledDependencies section of your package.json.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addCompileCommand
public addCompileCommand(commands: string): void

DEPRECATED.

commandsRequired
  • Type: string

addDeps
public addDeps(deps: string): void

Defines normal dependencies.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addDevDeps
public addDevDeps(deps: string): void

Defines development/test dependencies.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addFields
public addFields(fields: {[ key: string ]: any}): void

Directly set fields in package.json.

fieldsRequired
  • Type: {[ key: string ]: any}

The fields to set.


addKeywords
public addKeywords(keywords: string): void

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: string

The keywords to add.


addPeerDeps
public addPeerDeps(deps: string): void

Defines peer dependencies.

When adding peer dependencies, a devDependency will also be added on the pinned version of the declared peer. This will ensure that you are testing your code against the minimum version required from your consumers.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addScripts
public addScripts(scripts: {[ key: string ]: string}): void

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: {[ key: string ]: string}

The scripts to set.


addTestCommand
public addTestCommand(commands: string): void

DEPRECATED.

commandsRequired
  • Type: string

hasScript
public hasScript(name: string): boolean

Indicates if a script by the name name is defined.

nameRequired
  • Type: string

The name of the script.


removeScript
public removeScript(name: string): void

Removes the npm script (always successful).

nameRequired
  • Type: string

The name of the script.


renderWorkflowSetup
public renderWorkflowSetup(options?: RenderWorkflowSetupOptions): JobStep[]

Returns the set of workflow steps which should be executed to bootstrap a workflow.

optionsOptional
  • Type: projen.javascript.RenderWorkflowSetupOptions

Options.


setScript
public setScript(name: string, command: string): void

Replaces the contents of an npm package.json script.

nameRequired
  • Type: string

The script name.


commandRequired
  • Type: string

The command to execute.


addCdkDependency
public addCdkDependency(modules: string): void

Adds an AWS CDK module dependencies.

modulesRequired
  • Type: string

The list of modules to depend on.


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isProject
Test whether the given construct is a project.
of
Find the closest ancestor project for given construct.

isConstruct
import { awscdk } from 'projen'

awscdk.AwsCdkTypeScriptApp.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isProject
import { awscdk } from 'projen'

awscdk.AwsCdkTypeScriptApp.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { awscdk } from 'projen'

awscdk.AwsCdkTypeScriptApp.of(construct: IConstruct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
buildTask
projen.TaskNo description.
commitGenerated
booleanWhether to commit the managed files by default.
compileTask
projen.TaskNo description.
components
projen.Component[]Returns all the components within this project.
deps
projen.DependenciesProject dependencies.
ejected
booleanWhether or not the project is being ejected.
files
projen.FileBase[]All files in this project.
gitattributes
projen.GitAttributesFileThe .gitattributes file for this repository.
gitignore
projen.IgnoreFile.gitignore.
logger
projen.LoggerLogging utilities.
name
stringProject name.
outdir
stringAbsolute output directory of this project.
packageTask
projen.TaskNo description.
postCompileTask
projen.TaskNo description.
preCompileTask
projen.TaskNo description.
projectBuild
projen.ProjectBuildManages the build process of the project.
projenCommand
stringThe command to use in order to run the projen CLI.
root
projen.ProjectThe root project.
subprojects
projen.Project[]Returns all the subprojects within this project.
tasks
projen.TasksProject tasks.
testTask
projen.TaskNo description.
defaultTask
projen.TaskThis is the "default" task, the one that executes "projen".
initProject
projen.InitProjectThe options used when this project is bootstrapped via projen new.
parent
projen.ProjectA parent project.
projectType
projen.ProjectTypeNo description.
autoApprove
projen.github.AutoApproveAuto approve set up for this project.
devContainer
projen.vscode.DevContainerAccess for .devcontainer.json (used for GitHub Codespaces).
github
projen.github.GitHubAccess all github components.
gitpod
projen.GitpodAccess for Gitpod.
vscode
projen.vscode.VsCodeAccess all VSCode components.
allowLibraryDependencies
booleanNo description.
artifactsDirectory
stringThe build output directory.
artifactsJavascriptDirectory
stringThe location of the npm tarball after build (${artifactsDirectory}/js).
bundler
projen.javascript.BundlerNo description.
entrypoint
stringNo description.
manifest
anyNo description.
npmrc
projen.javascript.NpmConfigThe .npmrc file.
package
projen.javascript.NodePackageAPI for managing the node package.
packageManager
projen.javascript.NodePackageManagerThe package manager to use.
runScriptCommand
stringThe command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
autoMerge
projen.github.AutoMergeComponent that sets up mergify for merging approved pull requests.
buildWorkflow
projen.build.BuildWorkflowThe PR build GitHub workflow.
buildWorkflowJobId
stringThe job ID of the build workflow.
jest
projen.javascript.JestThe Jest configuration (if enabled).
maxNodeVersion
stringMaximum node version required by this package.
minNodeVersion
stringMinimum node.js version required by this package.
npmignore
projen.IgnoreFileThe .npmignore file.
prettier
projen.javascript.PrettierNo description.
publisher
projen.release.PublisherPackage publisher.
release
projen.release.ReleaseRelease management.
upgradeWorkflow
projen.javascript.UpgradeDependenciesThe upgrade workflow.
docsDirectory
stringNo description.
libdir
stringThe directory in which compiled .js files reside.
srcdir
stringThe directory in which the .ts sources reside.
testdir
stringThe directory in which tests reside.
tsconfigDev
projen.javascript.TypescriptConfigA typescript configuration file which covers all files (sources, tests, projen).
watchTask
projen.TaskThe "watch" task.
docgen
booleanNo description.
eslint
projen.javascript.EslintNo description.
tsconfig
projen.javascript.TypescriptConfigNo description.
tsconfigEslint
projen.javascript.TypescriptConfigNo description.
appEntrypoint
stringThe CDK app entrypoint.
cdkConfig
CdkConfig
cdk.json configuration.
cdkDeps
AwsCdkDeps
No description.
cdkTasks
CdkTasks
Common CDK tasks.
cdkVersion
stringThe CDK version this app is using.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


buildTaskRequired
public readonly buildTask: Task;
  • Type: projen.Task

commitGeneratedRequired
public readonly commitGenerated: boolean;
  • Type: boolean

Whether to commit the managed files by default.


compileTaskRequired
public readonly compileTask: Task;
  • Type: projen.Task

componentsRequired
public readonly components: Component[];
  • Type: projen.Component[]

Returns all the components within this project.


depsRequired
public readonly deps: Dependencies;
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
public readonly ejected: boolean;
  • Type: boolean

Whether or not the project is being ejected.


filesRequired
public readonly files: FileBase[];
  • Type: projen.FileBase[]

All files in this project.


gitattributesRequired
public readonly gitattributes: GitAttributesFile;
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public readonly gitignore: IgnoreFile;
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
public readonly logger: Logger;
  • Type: projen.Logger

Logging utilities.


nameRequired
public readonly name: string;
  • Type: string

Project name.


outdirRequired
public readonly outdir: string;
  • Type: string

Absolute output directory of this project.


packageTaskRequired
public readonly packageTask: Task;
  • Type: projen.Task

postCompileTaskRequired
public readonly postCompileTask: Task;
  • Type: projen.Task

preCompileTaskRequired
public readonly preCompileTask: Task;
  • Type: projen.Task

projectBuildRequired
public readonly projectBuild: ProjectBuild;
  • Type: projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public readonly projenCommand: string;
  • Type: string

The command to use in order to run the projen CLI.


rootRequired
public readonly root: Project;
  • Type: projen.Project

The root project.


subprojectsRequired
public readonly subprojects: Project[];
  • Type: projen.Project[]

Returns all the subprojects within this project.


tasksRequired
public readonly tasks: Tasks;
  • Type: projen.Tasks

Project tasks.


testTaskRequired
public readonly testTask: Task;
  • Type: projen.Task

defaultTaskOptional
public readonly defaultTask: Task;
  • Type: projen.Task

This is the "default" task, the one that executes "projen".

Undefined if the project is being ejected.


initProjectOptional
public readonly initProject: InitProject;
  • Type: projen.InitProject

The options used when this project is bootstrapped via projen new.

It includes the original set of options passed to the CLI and also the JSII FQN of the project type.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
public readonly projectType: ProjectType;
  • Type: projen.ProjectType

autoApproveOptional
public readonly autoApprove: AutoApprove;
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
public readonly devContainer: DevContainer;
  • Type: projen.vscode.DevContainer

Access for .devcontainer.json (used for GitHub Codespaces).

This will be undefined if devContainer boolean is false


githubOptional
public readonly github: GitHub;
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
public readonly gitpod: Gitpod;
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
public readonly vscode: VsCode;
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


allowLibraryDependenciesRequired
  • Deprecated: use package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
  • Type: boolean

artifactsDirectoryRequired
public readonly artifactsDirectory: string;
  • Type: string

The build output directory.

An npm tarball will be created under the js subdirectory. For example, if this is set to dist (the default), the npm tarball will be placed under dist/js/boom-boom-1.2.3.tg.


artifactsJavascriptDirectoryRequired
public readonly artifactsJavascriptDirectory: string;
  • Type: string

The location of the npm tarball after build (${artifactsDirectory}/js).


bundlerRequired
public readonly bundler: Bundler;
  • Type: projen.javascript.Bundler

entrypointRequired
  • Deprecated: use package.entrypoint
public readonly entrypoint: string;
  • Type: string

manifestRequired
  • Deprecated: use package.addField(x, y)
public readonly manifest: any;
  • Type: any

npmrcRequired
public readonly npmrc: NpmConfig;
  • Type: projen.javascript.NpmConfig

The .npmrc file.


packageRequired
public readonly package: NodePackage;
  • Type: projen.javascript.NodePackage

API for managing the node package.


packageManagerRequired
  • Deprecated: use package.packageManager
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager

The package manager to use.


runScriptCommandRequired
public readonly runScriptCommand: string;
  • Type: string

The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).


autoMergeOptional
public readonly autoMerge: AutoMerge;
  • Type: projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


buildWorkflowOptional
public readonly buildWorkflow: BuildWorkflow;
  • Type: projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


buildWorkflowJobIdOptional
public readonly buildWorkflowJobId: string;
  • Type: string

The job ID of the build workflow.


jestOptional
public readonly jest: Jest;
  • Type: projen.javascript.Jest

The Jest configuration (if enabled).


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string

Maximum node version required by this package.


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string

Minimum node.js version required by this package.


npmignoreOptional
public readonly npmignore: IgnoreFile;
  • Type: projen.IgnoreFile

The .npmignore file.


prettierOptional
public readonly prettier: Prettier;
  • Type: projen.javascript.Prettier

publisherOptional
  • Deprecated: use release.publisher.
public readonly publisher: Publisher;
  • Type: projen.release.Publisher

Package publisher.

This will be undefined if the project does not have a release workflow.


releaseOptional
public readonly release: Release;
  • Type: projen.release.Release

Release management.


upgradeWorkflowOptional
public readonly upgradeWorkflow: UpgradeDependencies;
  • Type: projen.javascript.UpgradeDependencies

The upgrade workflow.


docsDirectoryRequired
public readonly docsDirectory: string;
  • Type: string

libdirRequired
public readonly libdir: string;
  • Type: string

The directory in which compiled .js files reside.


srcdirRequired
public readonly srcdir: string;
  • Type: string

The directory in which the .ts sources reside.


testdirRequired
public readonly testdir: string;
  • Type: string

The directory in which tests reside.


tsconfigDevRequired
public readonly tsconfigDev: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

A typescript configuration file which covers all files (sources, tests, projen).


watchTaskRequired
public readonly watchTask: Task;
  • Type: projen.Task

The "watch" task.


docgenOptional
public readonly docgen: boolean;
  • Type: boolean

eslintOptional
public readonly eslint: Eslint;
  • Type: projen.javascript.Eslint

tsconfigOptional
public readonly tsconfig: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

tsconfigEslintOptional
public readonly tsconfigEslint: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

appEntrypointRequired
public readonly appEntrypoint: string;
  • Type: string

The CDK app entrypoint.


cdkConfigRequired
public readonly cdkConfig: CdkConfig;

cdk.json configuration.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

cdkTasksRequired
public readonly cdkTasks: CdkTasks;

Common CDK tasks.


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The CDK version this app is using.


Constants

NameTypeDescription
DEFAULT_TASK
stringThe name of the default task (the task executed when projen is run without arguments).
DEFAULT_TS_JEST_TRANFORM_PATTERN
stringNo description.

DEFAULT_TASKRequired
public readonly DEFAULT_TASK: string;
  • Type: string

The name of the default task (the task executed when projen is run without arguments).

Normally this task should synthesize the project files.


DEFAULT_TS_JEST_TRANFORM_PATTERNRequired
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
  • Type: string

CdkConfig

Represents cdk.json file.

Initializers

import { awscdk } from 'projen'

new awscdk.CdkConfig(project: Project, options: CdkConfigOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
CdkConfigOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.
addExcludes
Add excludes to cdk.json.
addIncludes
Add includes to cdk.json.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

addExcludes
public addExcludes(patterns: string): void

Add excludes to cdk.json.

patternsRequired
  • Type: string

The excludes to add.


addIncludes
public addIncludes(patterns: string): void

Add includes to cdk.json.

patternsRequired
  • Type: string

The includes to add.


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.CdkConfig.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.CdkConfig.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
cdkout
stringName of the cdk.out directory.
exclude
string[]List of glob patterns to be excluded by CDK.
include
string[]List of glob patterns to be included by CDK.
json
projen.JsonFileRepresents the JSON file.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

cdkoutRequired
public readonly cdkout: string;
  • Type: string

Name of the cdk.out directory.


excludeRequired
public readonly exclude: string[];
  • Type: string[]

List of glob patterns to be excluded by CDK.


includeRequired
public readonly include: string[];
  • Type: string[]

List of glob patterns to be included by CDK.


jsonRequired
public readonly json: JsonFile;
  • Type: projen.JsonFile

Represents the JSON file.


CdkTasks

Adds standard AWS CDK tasks to your project.

Initializers

import { awscdk } from 'projen'

new awscdk.CdkTasks(project: Project)
NameTypeDescription
project
projen.ProjectNo description.

projectRequired
  • Type: projen.Project

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.CdkTasks.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.CdkTasks.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
deploy
projen.TaskDeploys your app.
destroy
projen.TaskDestroys all the stacks.
diff
projen.TaskDiff against production.
synth
projen.TaskSynthesizes your app.
synthSilent
projen.TaskSynthesizes your app and suppresses stdout.
watch
projen.TaskWatch task.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

deployRequired
public readonly deploy: Task;
  • Type: projen.Task

Deploys your app.


destroyRequired
public readonly destroy: Task;
  • Type: projen.Task

Destroys all the stacks.


diffRequired
public readonly diff: Task;
  • Type: projen.Task

Diff against production.


synthRequired
public readonly synth: Task;
  • Type: projen.Task

Synthesizes your app.


synthSilentRequired
public readonly synthSilent: Task;
  • Type: projen.Task

Synthesizes your app and suppresses stdout.


watchRequired
public readonly watch: Task;
  • Type: projen.Task

Watch task.


ConstructLibraryAws

Initializers

import { awscdk } from 'projen'

new awscdk.ConstructLibraryAws(options: AwsCdkConstructLibraryOptions)
NameTypeDescription
options
AwsCdkConstructLibraryOptions
No description.

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
addExcludeFromCleanup
Exclude the matching files from pre-synth cleanup.
addGitIgnore
Adds a .gitignore pattern.
addPackageIgnore
Adds patterns to be ignored by npm.
addTask
Adds a new task to this project.
addTip
Prints a "tip" message during synthesis.
annotateGenerated
Marks the provided file(s) as being generated.
postSynthesize
Called after all components are synthesized.
preSynthesize
Called before all components are synthesized.
removeTask
Removes a task from a project.
runTaskCommand
Returns the shell command to execute in order to run a task.
synth
Synthesize all project files into outdir.
tryFindFile
Finds a file at the specified relative path within this project and all its subprojects.
tryFindJsonFile
Finds a json file by name.
tryFindObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
tryRemoveFile
Finds a file at the specified relative path within this project and removes it.
addBins
No description.
addBundledDeps
Defines bundled dependencies.
addCompileCommand
DEPRECATED.
addDeps
Defines normal dependencies.
addDevDeps
Defines development/test dependencies.
addFields
Directly set fields in package.json.
addKeywords
Adds keywords to package.json (deduplicated).
addPeerDeps
Defines peer dependencies.
addScripts
Replaces the contents of multiple npm package.json scripts.
addTestCommand
DEPRECATED.
hasScript
Indicates if a script by the name name is defined.
removeScript
Removes the npm script (always successful).
renderWorkflowSetup
Returns the set of workflow steps which should be executed to bootstrap a workflow.
setScript
Replaces the contents of an npm package.json script.
addCdkDependencies
Adds dependencies to AWS CDK modules.
addCdkTestDependencies
Adds AWS CDK modules as dev dependencies.

toString
public toString(): string

Returns a string representation of this construct.

addExcludeFromCleanup
public addExcludeFromCleanup(globs: string): void

Exclude the matching files from pre-synth cleanup.

Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.

globsRequired
  • Type: string

The glob patterns to match.


addGitIgnore
public addGitIgnore(pattern: string): void

Adds a .gitignore pattern.

patternRequired
  • Type: string

The glob pattern to ignore.


addPackageIgnore
public addPackageIgnore(pattern: string): void

Adds patterns to be ignored by npm.

patternRequired
  • Type: string

The pattern to ignore.


addTask
public addTask(name: string, props?: TaskOptions): Task

Adds a new task to this project.

This will fail if the project already has a task with this name.

nameRequired
  • Type: string

The task name to add.


propsOptional
  • Type: projen.TaskOptions

Task properties.


addTip
public addTip(message: string): void

Prints a "tip" message during synthesis.

messageRequired
  • Type: string

The message.


annotateGenerated
public annotateGenerated(glob: string): void

Marks the provided file(s) as being generated.

This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.

https://github.com/github/linguist/blob/master/docs/overrides.md

globRequired
  • Type: string

the glob pattern to match (could be a file path).


postSynthesize
public postSynthesize(): void

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before all components are synthesized.

removeTask
public removeTask(name: string): Task

Removes a task from a project.

nameRequired
  • Type: string

The name of the task to remove.


runTaskCommand
public runTaskCommand(task: Task): string

Returns the shell command to execute in order to run a task.

This will typically be npx projen TASK.

taskRequired
  • Type: projen.Task

The task for which the command is required.


synth
public synth(): void

Synthesize all project files into outdir.

  1. Call "this.preSynthesize()"
  2. Delete all generated files
  3. Synthesize all subprojects
  4. Synthesize all components of this project
  5. Call "postSynthesize()" for all components of this project
  6. Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and all its subprojects.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile

Finds a json file by name.

filePathRequired
  • Type: string

The file path.


tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile

Finds an object file (like JsonFile, YamlFile, etc.) by name.

filePathRequired
  • Type: string

The file path.


tryRemoveFile
public tryRemoveFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and removes it.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


addBins
public addBins(bins: {[ key: string ]: string}): void
binsRequired
  • Type: {[ key: string ]: string}

addBundledDeps
public addBundledDeps(deps: string): void

Defines bundled dependencies.

Bundled dependencies will be added as normal dependencies as well as to the bundledDependencies section of your package.json.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addCompileCommand
public addCompileCommand(commands: string): void

DEPRECATED.

commandsRequired
  • Type: string

addDeps
public addDeps(deps: string): void

Defines normal dependencies.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addDevDeps
public addDevDeps(deps: string): void

Defines development/test dependencies.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addFields
public addFields(fields: {[ key: string ]: any}): void

Directly set fields in package.json.

fieldsRequired
  • Type: {[ key: string ]: any}

The fields to set.


addKeywords
public addKeywords(keywords: string): void

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: string

The keywords to add.


addPeerDeps
public addPeerDeps(deps: string): void

Defines peer dependencies.

When adding peer dependencies, a devDependency will also be added on the pinned version of the declared peer. This will ensure that you are testing your code against the minimum version required from your consumers.

depsRequired
  • Type: string

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addScripts
public addScripts(scripts: {[ key: string ]: string}): void

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: {[ key: string ]: string}

The scripts to set.


addTestCommand
public addTestCommand(commands: string): void

DEPRECATED.

commandsRequired
  • Type: string

hasScript
public hasScript(name: string): boolean

Indicates if a script by the name name is defined.

nameRequired
  • Type: string

The name of the script.


removeScript
public removeScript(name: string): void

Removes the npm script (always successful).

nameRequired
  • Type: string

The name of the script.


renderWorkflowSetup
public renderWorkflowSetup(options?: RenderWorkflowSetupOptions): JobStep[]

Returns the set of workflow steps which should be executed to bootstrap a workflow.

optionsOptional
  • Type: projen.javascript.RenderWorkflowSetupOptions

Options.


setScript
public setScript(name: string, command: string): void

Replaces the contents of an npm package.json script.

nameRequired
  • Type: string

The script name.


commandRequired
  • Type: string

The command to execute.


addCdkDependencies
public addCdkDependencies(deps: string): void

Adds dependencies to AWS CDK modules.

Since this is a library project, dependencies will be added as peer dependencies.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


addCdkTestDependencies
public addCdkTestDependencies(deps: string): void

Adds AWS CDK modules as dev dependencies.

depsRequired
  • Type: string

names of cdk modules (e.g. @aws-cdk/aws-lambda).


Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isProject
Test whether the given construct is a project.
of
Find the closest ancestor project for given construct.

isConstruct
import { awscdk } from 'projen'

awscdk.ConstructLibraryAws.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isProject
import { awscdk } from 'projen'

awscdk.ConstructLibraryAws.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { awscdk } from 'projen'

awscdk.ConstructLibraryAws.of(construct: IConstruct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
buildTask
projen.TaskNo description.
commitGenerated
booleanWhether to commit the managed files by default.
compileTask
projen.TaskNo description.
components
projen.Component[]Returns all the components within this project.
deps
projen.DependenciesProject dependencies.
ejected
booleanWhether or not the project is being ejected.
files
projen.FileBase[]All files in this project.
gitattributes
projen.GitAttributesFileThe .gitattributes file for this repository.
gitignore
projen.IgnoreFile.gitignore.
logger
projen.LoggerLogging utilities.
name
stringProject name.
outdir
stringAbsolute output directory of this project.
packageTask
projen.TaskNo description.
postCompileTask
projen.TaskNo description.
preCompileTask
projen.TaskNo description.
projectBuild
projen.ProjectBuildManages the build process of the project.
projenCommand
stringThe command to use in order to run the projen CLI.
root
projen.ProjectThe root project.
subprojects
projen.Project[]Returns all the subprojects within this project.
tasks
projen.TasksProject tasks.
testTask
projen.TaskNo description.
defaultTask
projen.TaskThis is the "default" task, the one that executes "projen".
initProject
projen.InitProjectThe options used when this project is bootstrapped via projen new.
parent
projen.ProjectA parent project.
projectType
projen.ProjectTypeNo description.
autoApprove
projen.github.AutoApproveAuto approve set up for this project.
devContainer
projen.vscode.DevContainerAccess for .devcontainer.json (used for GitHub Codespaces).
github
projen.github.GitHubAccess all github components.
gitpod
projen.GitpodAccess for Gitpod.
vscode
projen.vscode.VsCodeAccess all VSCode components.
allowLibraryDependencies
booleanNo description.
artifactsDirectory
stringThe build output directory.
artifactsJavascriptDirectory
stringThe location of the npm tarball after build (${artifactsDirectory}/js).
bundler
projen.javascript.BundlerNo description.
entrypoint
stringNo description.
manifest
anyNo description.
npmrc
projen.javascript.NpmConfigThe .npmrc file.
package
projen.javascript.NodePackageAPI for managing the node package.
packageManager
projen.javascript.NodePackageManagerThe package manager to use.
runScriptCommand
stringThe command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
autoMerge
projen.github.AutoMergeComponent that sets up mergify for merging approved pull requests.
buildWorkflow
projen.build.BuildWorkflowThe PR build GitHub workflow.
buildWorkflowJobId
stringThe job ID of the build workflow.
jest
projen.javascript.JestThe Jest configuration (if enabled).
maxNodeVersion
stringMaximum node version required by this package.
minNodeVersion
stringMinimum node.js version required by this package.
npmignore
projen.IgnoreFileThe .npmignore file.
prettier
projen.javascript.PrettierNo description.
publisher
projen.release.PublisherPackage publisher.
release
projen.release.ReleaseRelease management.
upgradeWorkflow
projen.javascript.UpgradeDependenciesThe upgrade workflow.
docsDirectory
stringNo description.
libdir
stringThe directory in which compiled .js files reside.
srcdir
stringThe directory in which the .ts sources reside.
testdir
stringThe directory in which tests reside.
tsconfigDev
projen.javascript.TypescriptConfigA typescript configuration file which covers all files (sources, tests, projen).
watchTask
projen.TaskThe "watch" task.
docgen
booleanNo description.
eslint
projen.javascript.EslintNo description.
tsconfig
projen.javascript.TypescriptConfigNo description.
tsconfigEslint
projen.javascript.TypescriptConfigNo description.
cdkDeps
AwsCdkDeps
No description.
cdkVersion
stringThe target CDK version for this library.
version
stringNo description.

nodeRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly node: Node;
  • Type: constructs.Node

The tree node.


buildTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly buildTask: Task;
  • Type: projen.Task

commitGeneratedRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly commitGenerated: boolean;
  • Type: boolean

Whether to commit the managed files by default.


compileTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly compileTask: Task;
  • Type: projen.Task

componentsRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly components: Component[];
  • Type: projen.Component[]

Returns all the components within this project.


depsRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly deps: Dependencies;
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly ejected: boolean;
  • Type: boolean

Whether or not the project is being ejected.


filesRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly files: FileBase[];
  • Type: projen.FileBase[]

All files in this project.


gitattributesRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly gitattributes: GitAttributesFile;
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly gitignore: IgnoreFile;
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly logger: Logger;
  • Type: projen.Logger

Logging utilities.


nameRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly name: string;
  • Type: string

Project name.


outdirRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly outdir: string;
  • Type: string

Absolute output directory of this project.


packageTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly packageTask: Task;
  • Type: projen.Task

postCompileTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly postCompileTask: Task;
  • Type: projen.Task

preCompileTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly preCompileTask: Task;
  • Type: projen.Task

projectBuildRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly projectBuild: ProjectBuild;
  • Type: projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly projenCommand: string;
  • Type: string

The command to use in order to run the projen CLI.


rootRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly root: Project;
  • Type: projen.Project

The root project.


subprojectsRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly subprojects: Project[];
  • Type: projen.Project[]

Returns all the subprojects within this project.


tasksRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly tasks: Tasks;
  • Type: projen.Tasks

Project tasks.


testTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly testTask: Task;
  • Type: projen.Task

defaultTaskOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly defaultTask: Task;
  • Type: projen.Task

This is the "default" task, the one that executes "projen".

Undefined if the project is being ejected.


initProjectOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly initProject: InitProject;
  • Type: projen.InitProject

The options used when this project is bootstrapped via projen new.

It includes the original set of options passed to the CLI and also the JSII FQN of the project type.


parentOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly parent: Project;
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly projectType: ProjectType;
  • Type: projen.ProjectType

autoApproveOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly autoApprove: AutoApprove;
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly devContainer: DevContainer;
  • Type: projen.vscode.DevContainer

Access for .devcontainer.json (used for GitHub Codespaces).

This will be undefined if devContainer boolean is false


githubOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly github: GitHub;
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly gitpod: Gitpod;
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly vscode: VsCode;
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


allowLibraryDependenciesRequired
  • Deprecated: use package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
  • Type: boolean

artifactsDirectoryRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly artifactsDirectory: string;
  • Type: string

The build output directory.

An npm tarball will be created under the js subdirectory. For example, if this is set to dist (the default), the npm tarball will be placed under dist/js/boom-boom-1.2.3.tg.


artifactsJavascriptDirectoryRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly artifactsJavascriptDirectory: string;
  • Type: string

The location of the npm tarball after build (${artifactsDirectory}/js).


bundlerRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly bundler: Bundler;
  • Type: projen.javascript.Bundler

entrypointRequired
  • Deprecated: use package.entrypoint
public readonly entrypoint: string;
  • Type: string

manifestRequired
  • Deprecated: use package.addField(x, y)
public readonly manifest: any;
  • Type: any

npmrcRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly npmrc: NpmConfig;
  • Type: projen.javascript.NpmConfig

The .npmrc file.


packageRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly package: NodePackage;
  • Type: projen.javascript.NodePackage

API for managing the node package.


packageManagerRequired
  • Deprecated: use package.packageManager
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager

The package manager to use.


runScriptCommandRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly runScriptCommand: string;
  • Type: string

The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).


autoMergeOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly autoMerge: AutoMerge;
  • Type: projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


buildWorkflowOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly buildWorkflow: BuildWorkflow;
  • Type: projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


buildWorkflowJobIdOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly buildWorkflowJobId: string;
  • Type: string

The job ID of the build workflow.


jestOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly jest: Jest;
  • Type: projen.javascript.Jest

The Jest configuration (if enabled).


maxNodeVersionOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly maxNodeVersion: string;
  • Type: string

Maximum node version required by this package.


minNodeVersionOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly minNodeVersion: string;
  • Type: string

Minimum node.js version required by this package.


npmignoreOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly npmignore: IgnoreFile;
  • Type: projen.IgnoreFile

The .npmignore file.


prettierOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly prettier: Prettier;
  • Type: projen.javascript.Prettier

publisherOptional
  • Deprecated: use release.publisher.
public readonly publisher: Publisher;
  • Type: projen.release.Publisher

Package publisher.

This will be undefined if the project does not have a release workflow.


releaseOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly release: Release;
  • Type: projen.release.Release

Release management.


upgradeWorkflowOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly upgradeWorkflow: UpgradeDependencies;
  • Type: projen.javascript.UpgradeDependencies

The upgrade workflow.


docsDirectoryRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly docsDirectory: string;
  • Type: string

libdirRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly libdir: string;
  • Type: string

The directory in which compiled .js files reside.


srcdirRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly srcdir: string;
  • Type: string

The directory in which the .ts sources reside.


testdirRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly testdir: string;
  • Type: string

The directory in which tests reside.


tsconfigDevRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly tsconfigDev: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

A typescript configuration file which covers all files (sources, tests, projen).


watchTaskRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly watchTask: Task;
  • Type: projen.Task

The "watch" task.


docgenOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly docgen: boolean;
  • Type: boolean

eslintOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly eslint: Eslint;
  • Type: projen.javascript.Eslint

tsconfigOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly tsconfig: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

tsconfigEslintOptional
  • Deprecated: use AwsCdkConstructLibrary
public readonly tsconfigEslint: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

cdkDepsRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly cdkDeps: AwsCdkDeps;

cdkVersionRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly cdkVersion: string;
  • Type: string

The target CDK version for this library.


versionRequired
  • Deprecated: use cdkVersion
public readonly version: string;
  • Type: string

Constants

NameTypeDescription
DEFAULT_TASK
stringThe name of the default task (the task executed when projen is run without arguments).
DEFAULT_TS_JEST_TRANFORM_PATTERN
stringNo description.

DEFAULT_TASKRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly DEFAULT_TASK: string;
  • Type: string

The name of the default task (the task executed when projen is run without arguments).

Normally this task should synthesize the project files.


DEFAULT_TS_JEST_TRANFORM_PATTERNRequired
  • Deprecated: use AwsCdkConstructLibrary
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
  • Type: string

EdgeLambdaAutoDiscover

Creates edge lambdas from entry points discovered in the project's source tree.

Initializers

import { awscdk } from 'projen'

new awscdk.EdgeLambdaAutoDiscover(project: Project, options: EdgeLambdaAutoDiscoverOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
EdgeLambdaAutoDiscoverOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.EdgeLambdaAutoDiscover.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.EdgeLambdaAutoDiscover.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
entrypoints
string[]Auto-discovered entry points with paths relative to the project directory.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

entrypointsRequired
public readonly entrypoints: string[];
  • Type: string[]

Auto-discovered entry points with paths relative to the project directory.


IntegrationTest

Cloud integration tests.

Initializers

import { awscdk } from 'projen'

new awscdk.IntegrationTest(project: Project, options: IntegrationTestOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
IntegrationTestOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.IntegrationTest.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.IntegrationTest.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
assertTask
projen.TaskSynthesizes the integration test and compares against a local copy (runs during build).
deployTask
projen.TaskDeploy the integration test and update the snapshot upon success.
snapshotTask
projen.TaskJust update snapshot (without deployment).
destroyTask
projen.TaskDestroy the integration test resources.
watchTask
projen.TaskThe watch task.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

assertTaskRequired
public readonly assertTask: Task;
  • Type: projen.Task

Synthesizes the integration test and compares against a local copy (runs during build).


deployTaskRequired
public readonly deployTask: Task;
  • Type: projen.Task

Deploy the integration test and update the snapshot upon success.


snapshotTaskRequired
public readonly snapshotTask: Task;
  • Type: projen.Task

Just update snapshot (without deployment).


destroyTaskRequired
public readonly destroyTask: Task;
  • Type: projen.Task

Destroy the integration test resources.


watchTaskRequired
public readonly watchTask: Task;
  • Type: projen.Task

The watch task.


IntegrationTestAutoDiscover

Creates integration tests from entry points discovered in the test tree.

Initializers

import { awscdk } from 'projen'

new awscdk.IntegrationTestAutoDiscover(project: Project, options: IntegrationTestAutoDiscoverOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
IntegrationTestAutoDiscoverOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.IntegrationTestAutoDiscover.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.IntegrationTestAutoDiscover.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
entrypoints
string[]Auto-discovered entry points with paths relative to the project directory.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

entrypointsRequired
public readonly entrypoints: string[];
  • Type: string[]

Auto-discovered entry points with paths relative to the project directory.


LambdaAutoDiscover

Creates lambdas from entry points discovered in the project's source tree.

Initializers

import { awscdk } from 'projen'

new awscdk.LambdaAutoDiscover(project: Project, options: LambdaAutoDiscoverOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
LambdaAutoDiscoverOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.LambdaAutoDiscover.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.LambdaAutoDiscover.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
entrypoints
string[]Auto-discovered entry points with paths relative to the project directory.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

entrypointsRequired
public readonly entrypoints: string[];
  • Type: string[]

Auto-discovered entry points with paths relative to the project directory.


LambdaExtension

Create a Lambda Extension.

Initializers

import { awscdk } from 'projen'

new awscdk.LambdaExtension(project: Project, options: LambdaExtensionOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
LambdaExtensionOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.LambdaExtension.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.LambdaExtension.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

LambdaExtensionAutoDiscover

Creates Lambda Extensions from entrypoints discovered in the project's source tree.

Initializers

import { awscdk } from 'projen'

new awscdk.LambdaExtensionAutoDiscover(project: Project, options: LambdaExtensionAutoDiscoverOptions)
NameTypeDescription
project
projen.ProjectNo description.
options
LambdaExtensionAutoDiscoverOptions
No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.LambdaExtensionAutoDiscover.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.LambdaExtensionAutoDiscover.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
entrypoints
string[]Auto-discovered entry points with paths relative to the project directory.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

entrypointsRequired
public readonly entrypoints: string[];
  • Type: string[]

Auto-discovered entry points with paths relative to the project directory.


LambdaFunction

Generates a pre-bundled AWS Lambda function construct from handler code.

To use this, create an AWS Lambda handler file under your source tree with the .lambda.ts extension and add a LambdaFunction component to your typescript project pointing to this entrypoint.

This will add a task to your "compile" step which will use esbuild to bundle the handler code into the build directory. It will also generate a file src/foo-function.ts with a custom AWS construct called FooFunction which extends @aws-cdk/aws-lambda.Function which is bound to the bundled handle through an asset.

Example

new LambdaFunction(myProject, {
srcdir: myProject.srcdir,
entrypoint: 'src/foo.lambda.ts',
});

Initializers

import { awscdk } from 'projen'

new awscdk.LambdaFunction(project: Project, options: LambdaFunctionOptions)
NameTypeDescription
project
projen.ProjectThe project to use.
options
LambdaFunctionOptions
Options.

projectRequired
  • Type: projen.Project

The project to use.


optionsRequired

Options.


Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.

isConstruct
import { awscdk } from 'projen'

awscdk.LambdaFunction.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { awscdk } from 'projen'

awscdk.LambdaFunction.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

Structs

AutoDiscoverCommonOptions

Common options for auto discovering project subcomponents.

Initializer

import { awscdk } from 'projen'

const autoDiscoverCommonOptions: awscdk.AutoDiscoverCommonOptions = { ... }

Properties

NameTypeDescription
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
stringPath to the tsconfig file to use for integration tests.

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

Path to the tsconfig file to use for integration tests.


AutoDiscoverOptions

Options for AutoDiscover.

Initializer

import { awscdk } from 'projen'

const autoDiscoverOptions: awscdk.AutoDiscoverOptions = { ... }

Properties

NameTypeDescription
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
stringPath to the tsconfig file to use for integration tests.
srcdir
stringProject source tree (relative to project output directory).
lambdaOptions
LambdaFunctionCommonOptions
Options for AWS Lambda functions.
lambdaExtensionOptions
LambdaExtensionCommonOptions
Options for lambda extensions.
testdir
stringTest source tree.
integrationTestOptions
IntegrationTestCommonOptions
Options for integration tests.
edgeLambdaAutoDiscover
booleanAuto-discover edge lambda functions.
integrationTestAutoDiscover
booleanAuto-discover integration tests.
lambdaAutoDiscover
booleanAuto-discover lambda functions.
lambdaExtensionAutoDiscover
booleanAuto-discover lambda extensions.

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

Path to the tsconfig file to use for integration tests.


srcdirRequired
public readonly srcdir: string;
  • Type: string

Project source tree (relative to project output directory).


lambdaOptionsOptional
public readonly lambdaOptions: LambdaFunctionCommonOptions;

Options for AWS Lambda functions.


lambdaExtensionOptionsOptional
public readonly lambdaExtensionOptions: LambdaExtensionCommonOptions;

Options for lambda extensions.


testdirRequired
public readonly testdir: string;
  • Type: string

Test source tree.


integrationTestOptionsOptional
public readonly integrationTestOptions: IntegrationTestCommonOptions;

Options for integration tests.


edgeLambdaAutoDiscoverOptional
public readonly edgeLambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Auto-discover edge lambda functions.


integrationTestAutoDiscoverOptional
public readonly integrationTestAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Auto-discover integration tests.


lambdaAutoDiscoverOptional
public readonly lambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Auto-discover lambda functions.


lambdaExtensionAutoDiscoverOptional
public readonly lambdaExtensionAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Auto-discover lambda extensions.


AwsCdkConstructLibraryOptions

Options for AwsCdkConstructLibrary.

Initializer

import { awscdk } from 'projen'

const awsCdkConstructLibraryOptions: awscdk.AwsCdkConstructLibraryOptions = { ... }

Properties

NameTypeDescription
name
stringThis is the name of your project.
commitGenerated
booleanWhether to commit the managed files by default.
gitIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .gitignore file.
gitOptions
projen.GitOptionsConfiguration options for git.
logging
projen.LoggerOptionsConfigure logging options such as verbosity.
outdir
stringThe root directory of the project.
parent
projen.ProjectThe parent project, if this project is part of a bigger project.
projenCommand
stringThe shell command to use in order to run the projen CLI.
projenrcJson
booleanGenerate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions
projen.ProjenrcJsonOptionsOptions for .projenrc.json.
renovatebot
booleanUse renovatebot to handle dependency upgrades.
renovatebotOptions
projen.RenovatebotOptionsOptions for renovatebot.
autoApproveOptions
projen.github.AutoApproveOptionsEnable and configure the 'auto approve' workflow.
autoMerge
booleanEnable automatic merging on GitHub.
autoMergeOptions
projen.github.AutoMergeOptionsConfigure options for automatic merging on GitHub.
clobber
booleanAdd a clobber task which resets the repo to origin.
devContainer
booleanAdd a VSCode development environment (used for GitHub Codespaces).
github
booleanEnable GitHub integration.
githubOptions
projen.github.GitHubOptionsOptions for GitHub integration.
gitpod
booleanAdd a Gitpod development environment.
mergify
booleanWhether mergify should be enabled on this repository or not.
mergifyOptions
projen.github.MergifyOptionsOptions for mergify.
projectType
projen.ProjectTypeWhich type of project this is (library/app).
projenCredentials
projen.github.GithubCredentialsChoose a method of providing GitHub API access for projen workflows.
projenTokenSecret
stringThe name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme
projen.SampleReadmePropsThe README setup.
stale
booleanAuto-close of stale issues and pull request.
staleOptions
projen.github.StaleOptionsAuto-close stale issues and pull requests.
vscode
booleanEnable VSCode integration.
allowLibraryDependencies
booleanAllow the project to include peerDependencies and bundledDependencies.
authorEmail
stringAuthor's e-mail.
authorName
stringAuthor's name.
authorOrganization
booleanIs the author an organization.
authorUrl
stringAuthor's URL / Website.
autoDetectBin
booleanAutomatically add all executables under the bin directory to your package.json file under the bin section.
bin
{[ key: string ]: string}Binary programs vended with your module.
bugsEmail
stringThe email address to which issues should be reported.
bugsUrl
stringThe url to your project's issue tracker.
bundledDeps
string[]List of dependencies to bundle into this module.
codeArtifactOptions
projen.javascript.CodeArtifactOptionsOptions for npm packages using AWS CodeArtifact.
deps
string[]Runtime dependencies of this module.
description
stringThe description is just a string that helps people understand the purpose of the package.
devDeps
string[]Build dependencies for this module.
entrypoint
stringModule entrypoint (main in package.json).
homepage
stringPackage's Homepage / Website.
keywords
string[]Keywords to include in package.json.
license
stringLicense's SPDX identifier.
licensed
booleanIndicates if a license should be added.
maxNodeVersion
stringMinimum node.js version to require via engines (inclusive).
minNodeVersion
stringMinimum Node.js version to require via package.json engines (inclusive).
npmAccess
projen.javascript.NpmAccessAccess level of the npm package.
npmProvenance
booleanShould provenance statements be generated when the package is published.
npmRegistry
stringThe host name of the npm registry to publish to.
npmRegistryUrl
stringThe base URL of the npm package registry.
npmTokenSecret
stringGitHub secret which contains the NPM token to use when publishing packages.
packageManager
projen.javascript.NodePackageManagerThe Node Package Manager used to execute scripts.
packageName
stringThe "name" in package.json.
peerDependencyOptions
projen.javascript.PeerDependencyOptionsOptions for peerDeps.
peerDeps
string[]Peer dependencies for this module.
pnpmVersion
stringThe version of PNPM to use if using PNPM as a package manager.
repository
stringThe repository is the location where the actual code for your package lives.
repositoryDirectory
stringIf the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
scopedPackagesOptions
projen.javascript.ScopedPackagesOptions[]Options for privately hosted scoped packages.
scripts
{[ key: string ]: string}npm scripts to include.
stability
stringPackage's Stability.
yarnBerryOptions
projen.javascript.YarnBerryOptionsOptions for Yarn Berry.
jsiiReleaseVersion
stringVersion requirement of publib which is used to publish modules to npm.
majorVersion
numberMajor version to release from the default branch.
minMajorVersion
numberMinimal Major version to release.
npmDistTag
stringThe npmDistTag to use when publishing from the default branch.
postBuildSteps
projen.github.workflows.JobStep[]Steps to execute after build as part of the release workflow.
prerelease
stringBump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun
booleanInstead of actually publishing to package managers, just print the publishing command.
publishTasks
booleanDefine publishing tasks that can be executed manually as well as workflows.
releasableCommits
projen.ReleasableCommitsFind commits that should be considered releasable Used to decide if a release is required.
releaseBranches
{[ key: string ]: projen.release.BranchOptions}Defines additional release branches.
releaseEveryCommit
booleanAutomatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue
booleanCreate a github issue on every failed publishing task.
releaseFailureIssueLabel
stringThe label to apply to issues indicating publish failures.
releaseSchedule
stringCRON schedule to trigger new releases.
releaseTagPrefix
stringAutomatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger
projen.release.ReleaseTriggerThe release trigger to use.
releaseWorkflowName
stringThe name of the default release workflow.
releaseWorkflowSetupSteps
projen.github.workflows.JobStep[]A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions
{[ key: string ]: any}Custom configuration used when creating changelog with standard-version package.
workflowContainerImage
stringContainer image to use for GitHub workflows.
workflowRunsOn
string[]Github Runner selection labels.
workflowRunsOnGroup
projen.GroupRunnerOptionsGithub Runner Group selection options.
defaultReleaseBranch
stringThe name of the main release branch.
artifactsDirectory
stringA directory which will contain build artifacts.
autoApproveUpgrades
booleanAutomatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow
booleanDefine a GitHub workflow for building PRs.
buildWorkflowOptions
projen.javascript.BuildWorkflowOptionsOptions for PR build workflow.
buildWorkflowTriggers
projen.github.workflows.TriggersBuild workflow triggers.
bundlerOptions
projen.javascript.BundlerOptionsOptions for Bundler.
checkLicenses
projen.javascript.LicenseCheckerOptionsConfigure which licenses should be deemed acceptable for use by dependencies.
codeCov
booleanDefine a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.
codeCovTokenSecret
stringDefine the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner
stringLicense copyright owner.
copyrightPeriod
stringThe copyright years to put in the LICENSE file.
dependabot
booleanUse dependabot to handle dependency upgrades.
dependabotOptions
projen.github.DependabotOptionsOptions for dependabot.
depsUpgrade
booleanUse tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions
projen.javascript.UpgradeDependenciesOptionsOptions for UpgradeDependencies.
gitignore
string[]Additional entries to .gitignore.
jest
booleanSetup jest unit tests.
jestOptions
projen.javascript.JestOptionsJest options.
mutableBuild
booleanAutomatically update files modified during builds to pull-request branches.
npmignore
string[]Additional entries to .npmignore.
npmignoreEnabled
booleanDefines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .npmignore file.
package
booleanDefines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier
booleanSetup prettier.
prettierOptions
projen.javascript.PrettierOptionsPrettier options.
projenDevDependency
booleanIndicates of "projen" should be installed as a devDependency.
projenrcJs
booleanGenerate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions
projen.javascript.ProjenrcOptionsOptions for .projenrc.js.
projenVersion
stringVersion of projen to install.
pullRequestTemplate
booleanInclude a GitHub pull request template.
pullRequestTemplateContents
string[]The contents of the pull request template.
release
booleanAdd release management to this project.
releaseToNpm
booleanAutomatically release to npm when new versions are introduced.
releaseWorkflow
booleanDEPRECATED: renamed to release.
workflowBootstrapSteps
projen.github.workflows.JobStep[]Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity
projen.github.GitIdentityThe git identity to use in workflows.
workflowNodeVersion
stringThe node version to use in GitHub workflows.
workflowPackageCache
booleanEnable Node.js package cache in GitHub workflows.
disableTsconfig
booleanDo not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev
booleanDo not generate a tsconfig.dev.json file.
docgen
booleanDocgen by Typedoc.
docsDirectory
stringDocs directory.
entrypointTypes
stringThe .d.ts file that includes the type declarations for this module.
eslint
booleanSetup eslint.
eslintOptions
projen.javascript.EslintOptionsEslint options.
libdir
stringTypescript artifacts output directory.
projenrcTs
booleanUse TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions
projen.typescript.ProjenrcOptionsOptions for .projenrc.ts.
sampleCode
booleanGenerate one-time sample in src/ and test/ if there are no files there.
srcdir
stringTypescript sources directory.
testdir
stringJest tests directory. Tests files should be named xxx.test.ts.
tsconfig
projen.javascript.TypescriptConfigOptionsCustom TSConfig.
tsconfigDev
projen.javascript.TypescriptConfigOptionsCustom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile
stringThe name of the development tsconfig.json file.
tsJestOptions
projen.typescript.TsJestOptionsOptions for ts-jest.
typescriptVersion
stringTypeScript version to use.
author
stringThe name of the library author.
authorAddress
stringEmail or URL of the library author.
repositoryUrl
stringGit repository URL.
compat
booleanAutomatically run API compatibility test against the latest version published to npm after compilation.
compatIgnore
stringName of the ignore file for API compatibility tests.
compressAssembly
booleanEmit a compressed version of the assembly.
docgenFilePath
stringFile path for generated docs.
dotnet
projen.cdk.JsiiDotNetTargetNo description.
excludeTypescript
string[]Accepts a list of glob patterns.
jsiiVersion
stringVersion of the jsii compiler to use.
publishToGo
projen.cdk.JsiiGoTargetPublish Go bindings to a git repository.
publishToMaven
projen.cdk.JsiiJavaTargetPublish to maven.
publishToNuget
projen.cdk.JsiiDotNetTargetPublish to NuGet.
publishToPypi
projen.cdk.JsiiPythonTargetPublish to pypi.
python
projen.cdk.JsiiPythonTargetNo description.
rootdir
stringNo description.
catalog
projen.cdk.CatalogLibraries will be picked up by the construct catalog when they are published to npm as jsii modules and will be published under:.
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.
edgeLambdaAutoDiscover
booleanAutomatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
experimentalIntegRunner
booleanEnable experimental support for the AWS CDK integ-runner.
integrationTestAutoDiscover
booleanAutomatically discovers and creates integration tests for each .integ.ts file under your test directory.
lambdaAutoDiscover
booleanAutomatically adds an aws_lambda.Function for each .lambda.ts handler in your source tree. If this is disabled, you either need to explicitly call aws_lambda.Function.autoDiscover() or define a new aws_lambda.Function() for each handler.
lambdaExtensionAutoDiscover
booleanAutomatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
lambdaOptions
LambdaFunctionCommonOptions
Common options for all AWS Lambda functions.

nameRequired
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
public readonly commitGenerated: boolean;
  • Type: boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
public readonly gitIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
public readonly gitOptions: GitOptions;
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
public readonly logging: LoggerOptions;
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other subprojects.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

The parent project, if this project is part of a bigger project.


projenCommandOptional
public readonly projenCommand: string;
  • Type: string
  • Default: "npx projen"

The shell command to use in order to run the projen CLI.

Can be used to customize in special environments.


projenrcJsonOptional
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
public readonly renovatebot: boolean;
  • Type: boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
public readonly renovatebotOptions: RenovatebotOptions;
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


autoApproveOptionsOptional
public readonly autoApproveOptions: AutoApproveOptions;
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoMergeOptional
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
public readonly autoMergeOptions: AutoMergeOptions;
  • Type: projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


clobberOptional
public readonly clobber: boolean;
  • Type: boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


devContainerOptional
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


githubOptional
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
public readonly githubOptions: GitHubOptions;
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead
public readonly mergify: boolean;
  • Type: boolean
  • Default: true

Whether mergify should be enabled on this repository or not.


mergifyOptionsOptional
  • Deprecated: use githubOptions.mergifyOptions instead
public readonly mergifyOptions: MergifyOptions;
  • Type: projen.github.MergifyOptions
  • Default: default options

Options for mergify.


projectTypeOptional
  • Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


projenCredentialsOptional
public readonly projenCredentials: GithubCredentials;
  • Type: projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

Choose a method of providing GitHub API access for projen workflows.


projenTokenSecretOptional
  • Deprecated: use projenCredentials
public readonly projenTokenSecret: string;
  • Type: string
  • Default: "PROJEN_GITHUB_TOKEN"

The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.

This token needs to have the repo, workflows and packages scope.


readmeOptional
public readonly readme: SampleReadmeProps;
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
public readonly staleOptions: StaleOptions;
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


allowLibraryDependenciesOptional
public readonly allowLibraryDependencies: boolean;
  • Type: boolean
  • Default: true

Allow the project to include peerDependencies and bundledDependencies.

This is normally only allowed for libraries. For apps, there's no meaning for specifying these.


authorEmailOptional
public readonly authorEmail: string;
  • Type: string

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string

Author's name.


authorOrganizationOptional
public readonly authorOrganization: boolean;
  • Type: boolean

Is the author an organization.


authorUrlOptional
public readonly authorUrl: string;
  • Type: string

Author's URL / Website.


autoDetectBinOptional
public readonly autoDetectBin: boolean;
  • Type: boolean
  • Default: true

Automatically add all executables under the bin directory to your package.json file under the bin section.


binOptional
public readonly bin: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Binary programs vended with your module.

You can use this option to add/customize how binaries are represented in your package.json, but unless autoDetectBin is false, every executable file under bin will automatically be added to this section.


bugsEmailOptional
public readonly bugsEmail: string;
  • Type: string

The email address to which issues should be reported.


bugsUrlOptional
public readonly bugsUrl: string;
  • Type: string

The url to your project's issue tracker.


bundledDepsOptional
public readonly bundledDeps: string[];
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and bundledDependencies section of your package.json.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


codeArtifactOptionsOptional
public readonly codeArtifactOptions: CodeArtifactOptions;
  • Type: projen.javascript.CodeArtifactOptions
  • Default: undefined

Options for npm packages using AWS CodeArtifact.

This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact


depsOptional
public readonly deps: string[];
  • Type: string[]
  • Default: []

Runtime dependencies of this module.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


Example

[ 'express', 'lodash', 'foo@^2' ]
descriptionOptional
public readonly description: string;
  • Type: string

The description is just a string that helps people understand the purpose of the package.

It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description


devDepsOptional
public readonly devDeps: string[];
  • Type: string[]
  • Default: []

Build dependencies for this module.

These dependencies will only be available in your build environment but will not be fetched when this module is consumed.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


Example

[ 'typescript', '@types/express' ]
entrypointOptional
public readonly entrypoint: string;
  • Type: string
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

Set to an empty string to not include main in your package.json


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


keywordsOptional
public readonly keywords: string[];
  • Type: string[]

Keywords to include in package.json.


licenseOptional
public readonly license: string;
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the licensed option if you want to no license to be specified.


licensedOptional
public readonly licensed: boolean;
  • Type: boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string
  • Default: no max

Minimum node.js version to require via engines (inclusive).


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string
  • Default: no "engines" specified

Minimum Node.js version to require via package.json engines (inclusive).


npmAccessOptional
public readonly npmAccess: NpmAccess;
  • Type: projen.javascript.NpmAccess
  • Default: for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.

Access level of the npm package.


npmProvenanceOptional
public readonly npmProvenance: boolean;
  • Type: boolean
  • Default: true for public packages, false otherwise

Should provenance statements be generated when the package is published.

A supported package manager is required to publish a package with npm provenance statements and you will need to use a supported CI/CD provider.

Note that the projen Release and Publisher components are using publib to publish packages, which is using npm internally and supports provenance statements independently of the package manager used.

https://docs.npmjs.com/generating-provenance-statements


npmRegistryOptional
  • Deprecated: use npmRegistryUrl instead
public readonly npmRegistry: string;
  • Type: string

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional
public readonly npmRegistryUrl: string;

The base URL of the npm package registry.

Must be a URL (e.g. start with "https://" or "http://")


npmTokenSecretOptional
public readonly npmTokenSecret: string;
  • Type: string
  • Default: "NPM_TOKEN"

GitHub secret which contains the NPM token to use when publishing packages.


packageManagerOptional
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


packageNameOptional
public readonly packageName: string;
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional
public readonly peerDependencyOptions: PeerDependencyOptions;
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peerDepsOptional
public readonly peerDeps: string[];
  • Type: string[]
  • Default: []

Peer dependencies for this module.

Dependencies listed here are required to be installed (and satisfied) by the consumer of this library. Using peer dependencies allows you to ensure that only a single module of a certain library exists in the node_modules tree of your consumers.

Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers.

Unless peerDependencyOptions.pinnedDevDependency is disabled (it is enabled by default), projen will automatically add a dev dependency with a pinned version for each peer dependency. This will ensure that you build & test your module against the lowest peer version required.


pnpmVersionOptional
public readonly pnpmVersion: string;
  • Type: string
  • Default: "7"

The version of PNPM to use if using PNPM as a package manager.


repositoryOptional
public readonly repository: string;
  • Type: string

The repository is the location where the actual code for your package lives.

See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository


repositoryDirectoryOptional
public readonly repositoryDirectory: string;
  • Type: string

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.


scopedPackagesOptionsOptional
public readonly scopedPackagesOptions: ScopedPackagesOptions[];
  • Type: projen.javascript.ScopedPackagesOptions[]
  • Default: fetch all scoped packages from the public npm registry

Options for privately hosted scoped packages.


scriptsOptional
  • Deprecated: use project.addTask() or package.setScript()
public readonly scripts: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: {}

npm scripts to include.

If a script has the same name as a standard script, the standard script will be overwritten. Also adds the script as a task.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


yarnBerryOptionsOptional
public readonly yarnBerryOptions: YarnBerryOptions;
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsiiReleaseVersionOptional
public readonly jsiiReleaseVersion: string;
  • Type: string
  • Default: "latest"

Version requirement of publib which is used to publish modules to npm.


majorVersionOptional
public readonly majorVersion: number;
  • Type: number
  • Default: Major version is not enforced.

Major version to release from the default branch.

If this is specified, we bump the latest version of this major version line. If not specified, we bump the global latest version.


minMajorVersionOptional
public readonly minMajorVersion: number;
  • Type: number
  • Default: No minimum version is being enforced

Minimal Major version to release.

This can be useful to set to 1, as breaking changes before the 1.x major release are not incrementing the major version number.

Can not be set together with majorVersion.


npmDistTagOptional
public readonly npmDistTag: string;
  • Type: string
  • Default: "latest"

The npmDistTag to use when publishing from the default branch.

To set the npm dist-tag for release branches, set the npmDistTag property for each branch.


postBuildStepsOptional
public readonly postBuildSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: []

Steps to execute after build as part of the release workflow.


prereleaseOptional
public readonly prerelease: string;
  • Type: string
  • Default: normal semantic versions

Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").


publishDryRunOptional
public readonly publishDryRun: boolean;
  • Type: boolean
  • Default: false

Instead of actually publishing to package managers, just print the publishing command.


publishTasksOptional
public readonly publishTasks: boolean;
  • Type: boolean
  • Default: false

Define publishing tasks that can be executed manually as well as workflows.

Normally, publishing only happens within automated workflows. Enable this in order to create a publishing task for each publishing activity.


releasableCommitsOptional
public readonly releasableCommits: ReleasableCommits;
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

Find commits that should be considered releasable Used to decide if a release is required.


releaseBranchesOptional
public readonly releaseBranches: {[ key: string ]: BranchOptions};
  • Type: {[ key: string ]: projen.release.BranchOptions}
  • Default: no additional branches are used for release. you can use addBranch() to add additional branches.

Defines additional release branches.

A workflow will be created for each release branch which will publish releases from commits in this branch. Each release branch must be assigned a major version number which is used to enforce that versions published from that branch always use that major version. If multiple branches are used, the majorVersion field must also be provided for the default branch.


releaseEveryCommitOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
public readonly releaseEveryCommit: boolean;
  • Type: boolean
  • Default: true

Automatically release new versions every commit to one of branches in releaseBranches.


releaseFailureIssueOptional
public readonly releaseFailureIssue: boolean;
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
public readonly releaseFailureIssueLabel: string;
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseScheduleOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
public readonly releaseSchedule: string;
  • Type: string
  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseTagPrefixOptional
public readonly releaseTagPrefix: string;
  • Type: string
  • Default: "v"

Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.

Note: this prefix is used to detect the latest tagged version when bumping, so if you change this on a project with an existing version history, you may need to manually tag your latest release with the new prefix.


releaseTriggerOptional
public readonly releaseTrigger: ReleaseTrigger;
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


releaseWorkflowNameOptional
public readonly releaseWorkflowName: string;
  • Type: string
  • Default: "release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional
public readonly releaseWorkflowSetupSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]

A set of workflow steps to execute in order to setup the workflow container.


versionrcOptionsOptional
public readonly versionrcOptions: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: standard configuration applicable for GitHub repositories

Custom configuration used when creating changelog with standard-version package.

Given values either append to default configuration or overwrite values in it.


workflowContainerImageOptional
public readonly workflowContainerImage: string;
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


workflowRunsOnOptional
public readonly workflowRunsOn: string[];
  • Type: string[]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflowRunsOnGroupOptional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


defaultReleaseBranchRequired
public readonly defaultReleaseBranch: string;
  • Type: string
  • Default: "main"

The name of the main release branch.


artifactsDirectoryOptional
public readonly artifactsDirectory: string;
  • Type: string
  • Default: "dist"

A directory which will contain build artifacts.


autoApproveUpgradesOptional
public readonly autoApproveUpgrades: boolean;
  • Type: boolean
  • Default: true

Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).

Throw if set to true but autoApproveOptions are not defined.


buildWorkflowOptional
public readonly buildWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


buildWorkflowOptionsOptional
public readonly buildWorkflowOptions: BuildWorkflowOptions;
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


buildWorkflowTriggersOptional
  • Deprecated: - Use buildWorkflowOptions.workflowTriggers
public readonly buildWorkflowTriggers: Triggers;
  • Type: projen.github.workflows.Triggers
  • Default: "{ pullRequest: {}, workflowDispatch: {} }"

Build workflow triggers.


bundlerOptionsOptional
public readonly bundlerOptions: BundlerOptions;
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


checkLicensesOptional
public readonly checkLicenses: LicenseCheckerOptions;
  • Type: projen.javascript.LicenseCheckerOptions
  • Default: no license checks are run during the build and all licenses will be accepted

Configure which licenses should be deemed acceptable for use by dependencies.

This setting will cause the build to fail, if any prohibited or not allowed licenses ares encountered.


codeCovOptional
public readonly codeCov: boolean;
  • Type: boolean
  • Default: false

Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.


codeCovTokenSecretOptional
public readonly codeCovTokenSecret: string;
  • Type: string
  • Default: if this option is not specified, only public repositories are supported

Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.


copyrightOwnerOptional
public readonly copyrightOwner: string;
  • Type: string
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyrightPeriodOptional
public readonly copyrightPeriod: string;
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
public readonly dependabot: boolean;
  • Type: boolean
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabotOptionsOptional
public readonly dependabotOptions: DependabotOptions;
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsUpgradeOptional
public readonly depsUpgrade: boolean;
  • Type: boolean
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


depsUpgradeOptionsOptional
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
public readonly gitignore: string[];
  • Type: string[]

Additional entries to .gitignore.


jestOptional
public readonly jest: boolean;
  • Type: boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional
public readonly jestOptions: JestOptions;
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


mutableBuildOptional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
public readonly mutableBuild: boolean;
  • Type: boolean
  • Default: true

Automatically update files modified during builds to pull-request branches.

This means that any files synthesized by projen or e.g. test snapshots will always be up-to-date before a PR is merged.

Implies that PR builds do not have anti-tamper checks.


npmignoreOptional
  • Deprecated: - use project.addPackageIgnore
public readonly npmignore: string[];
  • Type: string[]

Additional entries to .npmignore.


npmignoreEnabledOptional
public readonly npmignoreEnabled: boolean;
  • Type: boolean
  • Default: true

Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.


npmIgnoreOptionsOptional
public readonly npmIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
public readonly package: boolean;
  • Type: boolean
  • Default: true

Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).


prettierOptional
public readonly prettier: boolean;
  • Type: boolean
  • Default: false

Setup prettier.


prettierOptionsOptional
public readonly prettierOptions: PrettierOptions;
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projenDevDependencyOptional
public readonly projenDevDependency: boolean;
  • Type: boolean
  • Default: true if not a subproject

Indicates of "projen" should be installed as a devDependency.


projenrcJsOptional
public readonly projenrcJs: boolean;
  • Type: boolean
  • Default: true if projenrcJson is false

Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.


projenrcJsOptionsOptional
public readonly projenrcJsOptions: ProjenrcOptions;
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenVersionOptional
public readonly projenVersion: string;
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
public readonly pullRequestTemplate: boolean;
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
public readonly pullRequestTemplateContents: string[];
  • Type: string[]
  • Default: default content

The contents of the pull request template.


releaseOptional
public readonly release: boolean;
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseWorkflowOptional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
public readonly workflowBootstrapSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowGitIdentityOptional
public readonly workflowGitIdentity: GitIdentity;
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflowNodeVersionOptional
public readonly workflowNodeVersion: string;
  • Type: string
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflowPackageCacheOptional
public readonly workflowPackageCache: boolean;
  • Type: boolean
  • Default: false

Enable Node.js package cache in GitHub workflows.


disableTsconfigOptional
public readonly disableTsconfig: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).


disableTsconfigDevOptional
public readonly disableTsconfigDev: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
public readonly docgen: boolean;
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
public readonly docsDirectory: string;
  • Type: string
  • Default: "docs"

Docs directory.


entrypointTypesOptional
public readonly entrypointTypes: string;
  • Type: string
  • Default: .d.ts file derived from the project's entrypoint (usually lib/index.d.ts)

The .d.ts file that includes the type declarations for this module.


eslintOptional
public readonly eslint: boolean;
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional
public readonly eslintOptions: EslintOptions;
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


projenrcTsOptional
public readonly projenrcTs: boolean;
  • Type: boolean
  • Default: false

Use TypeScript for your projenrc file (.projenrc.ts).


projenrcTsOptionsOptional
public readonly projenrcTsOptions: ProjenrcOptions;
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

Generate one-time sample in src/ and test/ if there are no files there.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


testdirOptional
public readonly testdir: string;
  • Type: string
  • Default: "test"

Jest tests directory. Tests files should be named xxx.test.ts.

If this directory is under srcdir (e.g. src/test, src/__tests__), then tests are going to be compiled into lib/ and executed as javascript. If the test directory is outside of src, then we configure jest to compile the code in-memory.


tsconfigOptional
public readonly tsconfig: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfigDevOptional
public readonly tsconfigDev: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

Custom tsconfig options for the development tsconfig.json file (used for testing).


tsconfigDevFileOptional
public readonly tsconfigDevFile: string;
  • Type: string
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


tsJestOptionsOptional
public readonly tsJestOptions: TsJestOptions;
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescriptVersionOptional
public readonly typescriptVersion: string;
  • Type: string
  • Default: "latest"

TypeScript version to use.

NOTE: Typescript is not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~1.2.3).


authorRequired
public readonly author: string;
  • Type: string
  • Default: $GIT_USER_NAME

The name of the library author.


authorAddressRequired
public readonly authorAddress: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Email or URL of the library author.


repositoryUrlRequired
public readonly repositoryUrl: string;
  • Type: string
  • Default: $GIT_REMOTE

Git repository URL.


compatOptional
public readonly compat: boolean;
  • Type: boolean
  • Default: false

Automatically run API compatibility test against the latest version published to npm after compilation.

You can manually run compatibility tests using yarn compat if this feature is disabled.

  • You can ignore compatibility failures by adding lines to a ".compatignore" file.

compatIgnoreOptional
public readonly compatIgnore: string;
  • Type: string
  • Default: ".compatignore"

Name of the ignore file for API compatibility tests.


compressAssemblyOptional
public readonly compressAssembly: boolean;
  • Type: boolean
  • Default: false

Emit a compressed version of the assembly.


docgenFilePathOptional
public readonly docgenFilePath: string;
  • Type: string
  • Default: "API.md"

File path for generated docs.


dotnetOptional
  • Deprecated: use publishToNuget
public readonly dotnet: JsiiDotNetTarget;
  • Type: projen.cdk.JsiiDotNetTarget

excludeTypescriptOptional
public readonly excludeTypescript: string[];
  • Type: string[]

Accepts a list of glob patterns.

Files matching any of those patterns will be excluded from the TypeScript compiler input.

By default, jsii will include all *.ts files (except .d.ts files) in the TypeScript compiler input. This can be problematic for example when the package's build or test procedure generates .ts files that cannot be compiled with jsii's compiler settings.


jsiiVersionOptional
public readonly jsiiVersion: string;
  • Type: string
  • Default: "1.x"

Version of the jsii compiler to use.

Set to "*" if you want to manually manage the version of jsii in your project by managing updates to package.json on your own.

NOTE: The jsii compiler releases since 5.0.0 are not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~5.0.0).


publishToGoOptional
public readonly publishToGo: JsiiGoTarget;
  • Type: projen.cdk.JsiiGoTarget
  • Default: no publishing

Publish Go bindings to a git repository.


publishToMavenOptional
public readonly publishToMaven: JsiiJavaTarget;
  • Type: projen.cdk.JsiiJavaTarget
  • Default: no publishing

Publish to maven.


publishToNugetOptional
public readonly publishToNuget: JsiiDotNetTarget;
  • Type: projen.cdk.JsiiDotNetTarget
  • Default: no publishing

Publish to NuGet.


publishToPypiOptional
public readonly publishToPypi: JsiiPythonTarget;
  • Type: projen.cdk.JsiiPythonTarget
  • Default: no publishing

Publish to pypi.


pythonOptional
  • Deprecated: use publishToPyPi
public readonly python: JsiiPythonTarget;
  • Type: projen.cdk.JsiiPythonTarget

rootdirOptional
public readonly rootdir: string;
  • Type: string
  • Default: "."

catalogOptional
public readonly catalog: Catalog;
  • Type: projen.cdk.Catalog
  • Default: new version will be announced

Libraries will be picked up by the construct catalog when they are published to npm as jsii modules and will be published under:.

https://awscdk.io/packages/[@SCOPE/]PACKAGE@VERSION

The catalog will also post a tweet to https://twitter.com/awscdkio with the package name, description and the above link. You can disable these tweets through { announce: false }.

You can also add a Twitter handle through { twitter: 'xx' } which will be mentioned in the tweet.

https://github.com/construct-catalog/catalog


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


edgeLambdaAutoDiscoverOptional
public readonly edgeLambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


experimentalIntegRunnerOptional
public readonly experimentalIntegRunner: boolean;
  • Type: boolean
  • Default: false

Enable experimental support for the AWS CDK integ-runner.


integrationTestAutoDiscoverOptional
public readonly integrationTestAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically discovers and creates integration tests for each .integ.ts file under your test directory.


lambdaAutoDiscoverOptional
public readonly lambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an aws_lambda.Function for each .lambda.ts handler in your source tree. If this is disabled, you either need to explicitly call aws_lambda.Function.autoDiscover() or define a new aws_lambda.Function() for each handler.


lambdaExtensionAutoDiscoverOptional
public readonly lambdaExtensionAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


lambdaOptionsOptional
public readonly lambdaOptions: LambdaFunctionCommonOptions;

Common options for all AWS Lambda functions.


AwsCdkDepsCommonOptions

Options for AwsCdkDeps.

Initializer

import { awscdk } from 'projen'

const awsCdkDepsCommonOptions: awscdk.AwsCdkDepsCommonOptions = { ... }

Properties

NameTypeDescription
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.

cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


AwsCdkDepsOptions

Initializer

import { awscdk } from 'projen'

const awsCdkDepsOptions: awscdk.AwsCdkDepsOptions = { ... }

Properties

NameTypeDescription
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.
dependencyType
projen.DependencyTypeThe type of dependency to use for runtime AWS CDK and constructs modules.

cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


dependencyTypeRequired
public readonly dependencyType: DependencyType;
  • Type: projen.DependencyType

The type of dependency to use for runtime AWS CDK and constructs modules.

For libraries, use peer dependencies and for apps use runtime dependencies.


AwsCdkJavaAppOptions

Initializer

import { awscdk } from 'projen'

const awsCdkJavaAppOptions: awscdk.AwsCdkJavaAppOptions = { ... }

Properties

NameTypeDescription
name
stringThis is the name of your project.
commitGenerated
booleanWhether to commit the managed files by default.
gitIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .gitignore file.
gitOptions
projen.GitOptionsConfiguration options for git.
logging
projen.LoggerOptionsConfigure logging options such as verbosity.
outdir
stringThe root directory of the project.
parent
projen.ProjectThe parent project, if this project is part of a bigger project.
projenCommand
stringThe shell command to use in order to run the projen CLI.
projenrcJson
booleanGenerate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions
projen.ProjenrcJsonOptionsOptions for .projenrc.json.
renovatebot
booleanUse renovatebot to handle dependency upgrades.
renovatebotOptions
projen.RenovatebotOptionsOptions for renovatebot.
autoApproveOptions
projen.github.AutoApproveOptionsEnable and configure the 'auto approve' workflow.
autoMerge
booleanEnable automatic merging on GitHub.
autoMergeOptions
projen.github.AutoMergeOptionsConfigure options for automatic merging on GitHub.
clobber
booleanAdd a clobber task which resets the repo to origin.
devContainer
booleanAdd a VSCode development environment (used for GitHub Codespaces).
github
booleanEnable GitHub integration.
githubOptions
projen.github.GitHubOptionsOptions for GitHub integration.
gitpod
booleanAdd a Gitpod development environment.
mergify
booleanWhether mergify should be enabled on this repository or not.
mergifyOptions
projen.github.MergifyOptionsOptions for mergify.
projectType
projen.ProjectTypeWhich type of project this is (library/app).
projenCredentials
projen.github.GithubCredentialsChoose a method of providing GitHub API access for projen workflows.
projenTokenSecret
stringThe name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme
projen.SampleReadmePropsThe README setup.
stale
booleanAuto-close of stale issues and pull request.
staleOptions
projen.github.StaleOptionsAuto-close stale issues and pull requests.
vscode
booleanEnable VSCode integration.
artifactId
stringThe artifactId is generally the name that the project is known by.
groupId
stringThis is generally unique amongst an organization or a project.
version
stringThis is the last piece of the naming puzzle.
description
stringDescription of a project is always good.
packaging
stringProject packaging format.
parentPom
projen.java.ParentPomA Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos.
url
stringThe URL, like the name, is not required.
compileOptions
projen.java.MavenCompileOptionsCompile options.
deps
string[]List of runtime dependencies for this project.
distdir
stringFinal artifact output directory.
junit
booleanInclude junit tests.
junitOptions
projen.java.JunitOptionsjunit options.
packagingOptions
projen.java.MavenPackagingOptionsPackaging options.
projenrcJava
booleanUse projenrc in java.
projenrcJavaOptions
projen.java.ProjenrcOptionsOptions related to projenrc in java.
testDeps
string[]List of test dependencies for this project.
sample
booleanInclude sample code and test if the relevant directories don't exist.
sampleJavaPackage
stringThe java package to use for the code sample.
buildCommand
stringA command to execute before synthesis.
cdkout
stringcdk.out directory.
context
{[ key: string ]: any}Additional context to include in cdk.json.
featureFlags
booleanInclude all feature flags in cdk.json.
requireApproval
ApprovalLevel
To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.
watchExcludes
string[]Glob patterns to exclude from cdk watch.
watchIncludes
string[]Glob patterns to include in cdk watch.
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.
mainClass
stringThe name of the Java class with the static main() method.

nameRequired
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
public readonly commitGenerated: boolean;
  • Type: boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
public readonly gitIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
public readonly gitOptions: GitOptions;
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
public readonly logging: LoggerOptions;
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other subprojects.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

The parent project, if this project is part of a bigger project.


projenCommandOptional
public readonly projenCommand: string;
  • Type: string
  • Default: "npx projen"

The shell command to use in order to run the projen CLI.

Can be used to customize in special environments.


projenrcJsonOptional
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
public readonly renovatebot: boolean;
  • Type: boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
public readonly renovatebotOptions: RenovatebotOptions;
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


autoApproveOptionsOptional
public readonly autoApproveOptions: AutoApproveOptions;
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoMergeOptional
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
public readonly autoMergeOptions: AutoMergeOptions;
  • Type: projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


clobberOptional
public readonly clobber: boolean;
  • Type: boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


devContainerOptional
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


githubOptional
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
public readonly githubOptions: GitHubOptions;
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead
public readonly mergify: boolean;
  • Type: boolean
  • Default: true

Whether mergify should be enabled on this repository or not.


mergifyOptionsOptional
  • Deprecated: use githubOptions.mergifyOptions instead
public readonly mergifyOptions: MergifyOptions;
  • Type: projen.github.MergifyOptions
  • Default: default options

Options for mergify.


projectTypeOptional
  • Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


projenCredentialsOptional
public readonly projenCredentials: GithubCredentials;
  • Type: projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

Choose a method of providing GitHub API access for projen workflows.


projenTokenSecretOptional
  • Deprecated: use projenCredentials
public readonly projenTokenSecret: string;
  • Type: string
  • Default: "PROJEN_GITHUB_TOKEN"

The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.

This token needs to have the repo, workflows and packages scope.


readmeOptional
public readonly readme: SampleReadmeProps;
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
public readonly staleOptions: StaleOptions;
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


artifactIdRequired
public readonly artifactId: string;
  • Type: string
  • Default: "my-app"

The artifactId is generally the name that the project is known by.

Although the groupId is important, people within the group will rarely mention the groupId in discussion (they are often all be the same ID, such as the MojoHaus project groupId: org.codehaus.mojo). It, along with the groupId, creates a key that separates this project from every other project in the world (at least, it should :) ). Along with the groupId, the artifactId fully defines the artifact's living quarters within the repository. In the case of the above project, my-project lives in $M2_REPO/org/codehaus/mojo/my-project.


groupIdRequired
public readonly groupId: string;
  • Type: string
  • Default: "org.acme"

This is generally unique amongst an organization or a project.

For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.


versionRequired
public readonly version: string;
  • Type: string
  • Default: "0.1.0"

This is the last piece of the naming puzzle.

groupId:artifactId denotes a single project but they cannot delineate which incarnation of that project we are talking about. Do we want the junit:junit of 2018 (version 4.12), or of 2007 (version 3.8.2)? In short: code changes, those changes should be versioned, and this element keeps those versions in line. It is also used within an artifact's repository to separate versions from each other. my-project version 1.0 files live in the directory structure $M2_REPO/org/codehaus/mojo/my-project/1.0.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: undefined

Description of a project is always good.

Although this should not replace formal documentation, a quick comment to any readers of the POM is always helpful.


packagingOptional
public readonly packaging: string;
  • Type: string
  • Default: "jar"

Project packaging format.


parentPomOptional
public readonly parentPom: ParentPom;
  • Type: projen.java.ParentPom
  • Default: undefined

A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos.


urlOptional
public readonly url: string;
  • Type: string
  • Default: undefined

The URL, like the name, is not required.

This is a nice gesture for projects users, however, so that they know where the project lives.


compileOptionsOptional
public readonly compileOptions: MavenCompileOptions;
  • Type: projen.java.MavenCompileOptions
  • Default: defaults

Compile options.


depsOptional
public readonly deps: string[];
  • Type: string[]
  • Default: []

List of runtime dependencies for this project.

Dependencies use the format: <groupId>/<artifactId>@<semver>

Additional dependencies can be added via project.addDependency().


distdirOptional
public readonly distdir: string;
  • Type: string
  • Default: "dist/java"

Final artifact output directory.


junitOptional
public readonly junit: boolean;
  • Type: boolean
  • Default: true

Include junit tests.


junitOptionsOptional
public readonly junitOptions: JunitOptions;
  • Type: projen.java.JunitOptions
  • Default: defaults

junit options.


packagingOptionsOptional
public readonly packagingOptions: MavenPackagingOptions;
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


projenrcJavaOptional
public readonly projenrcJava: boolean;
  • Type: boolean
  • Default: true

Use projenrc in java.

This will install projen as a java dependency and will add a synth task which will compile & execute main() from src/main/java/projenrc.java.


projenrcJavaOptionsOptional
public readonly projenrcJavaOptions: ProjenrcOptions;
  • Type: projen.java.ProjenrcOptions
  • Default: default options

Options related to projenrc in java.


testDepsOptional
public readonly testDeps: string[];
  • Type: string[]
  • Default: []

List of test dependencies for this project.

Dependencies use the format: <groupId>/<artifactId>@<semver>

Additional dependencies can be added via project.addTestDependency().


sampleOptional
public readonly sample: boolean;
  • Type: boolean
  • Default: true

Include sample code and test if the relevant directories don't exist.


sampleJavaPackageOptional
public readonly sampleJavaPackage: string;
  • Type: string
  • Default: "org.acme"

The java package to use for the code sample.


buildCommandOptional
public readonly buildCommand: string;
  • Type: string
  • Default: no build command

A command to execute before synthesis.

This command will be called when running cdk synth or when cdk watch identifies a change in your source code before redeployment.


cdkoutOptional
public readonly cdkout: string;
  • Type: string
  • Default: "cdk.out"

cdk.out directory.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context to include in cdk.json.


featureFlagsOptional
public readonly featureFlags: boolean;
  • Type: boolean
  • Default: true

Include all feature flags in cdk.json.


requireApprovalOptional
public readonly requireApproval: ApprovalLevel;

To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.


watchExcludesOptional
public readonly watchExcludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to exclude from cdk watch.


watchIncludesOptional
public readonly watchIncludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to include in cdk watch.


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


mainClassRequired
public readonly mainClass: string;
  • Type: string
  • Default: "org.acme.MyApp"

The name of the Java class with the static main() method.

This method should call app.synth() on the CDK app.


AwsCdkPackageNames

Language-specific AWS CDK package names.

Initializer

import { awscdk } from 'projen'

const awsCdkPackageNames: awscdk.AwsCdkPackageNames = { ... }

Properties

NameTypeDescription
assertions
stringFully qualified name of the assertions library package.
constructs
stringFully qualified name of the constructs library package.
coreV1
stringFully qualified name of the core framework package for CDKv1.
coreV2
stringFully qualified name of the core framework package for CDKv2.
assert
stringFully qualified name of the assert library package Can be empty as it's only really available for javascript projects.

assertionsRequired
public readonly assertions: string;
  • Type: string

Fully qualified name of the assertions library package.


constructsRequired
public readonly constructs: string;
  • Type: string

Fully qualified name of the constructs library package.


coreV1Required
public readonly coreV1: string;
  • Type: string

Fully qualified name of the core framework package for CDKv1.


coreV2Required
public readonly coreV2: string;
  • Type: string

Fully qualified name of the core framework package for CDKv2.


assertOptional
public readonly assert: string;
  • Type: string

Fully qualified name of the assert library package Can be empty as it's only really available for javascript projects.


AwsCdkPythonAppOptions

Options for AwsCdkPythonApp.

Initializer

import { awscdk } from 'projen'

const awsCdkPythonAppOptions: awscdk.AwsCdkPythonAppOptions = { ... }

Properties

NameTypeDescription
name
stringThis is the name of your project.
commitGenerated
booleanWhether to commit the managed files by default.
gitIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .gitignore file.
gitOptions
projen.GitOptionsConfiguration options for git.
logging
projen.LoggerOptionsConfigure logging options such as verbosity.
outdir
stringThe root directory of the project.
parent
projen.ProjectThe parent project, if this project is part of a bigger project.
projenCommand
stringThe shell command to use in order to run the projen CLI.
projenrcJson
booleanGenerate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions
projen.ProjenrcJsonOptionsOptions for .projenrc.json.
renovatebot
booleanUse renovatebot to handle dependency upgrades.
renovatebotOptions
projen.RenovatebotOptionsOptions for renovatebot.
autoApproveOptions
projen.github.AutoApproveOptionsEnable and configure the 'auto approve' workflow.
autoMerge
booleanEnable automatic merging on GitHub.
autoMergeOptions
projen.github.AutoMergeOptionsConfigure options for automatic merging on GitHub.
clobber
booleanAdd a clobber task which resets the repo to origin.
devContainer
booleanAdd a VSCode development environment (used for GitHub Codespaces).
github
booleanEnable GitHub integration.
githubOptions
projen.github.GitHubOptionsOptions for GitHub integration.
gitpod
booleanAdd a Gitpod development environment.
mergify
booleanWhether mergify should be enabled on this repository or not.
mergifyOptions
projen.github.MergifyOptionsOptions for mergify.
projectType
projen.ProjectTypeWhich type of project this is (library/app).
projenCredentials
projen.github.GithubCredentialsChoose a method of providing GitHub API access for projen workflows.
projenTokenSecret
stringThe name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme
projen.SampleReadmePropsThe README setup.
stale
booleanAuto-close of stale issues and pull request.
staleOptions
projen.github.StaleOptionsAuto-close stale issues and pull requests.
vscode
booleanEnable VSCode integration.
authorEmail
stringAuthor's e-mail.
authorName
stringAuthor's name.
version
stringVersion of the package.
classifiers
string[]A list of PyPI trove classifiers that describe the project.
description
stringA short description of the package.
homepage
stringA URL to the website of the project.
license
stringLicense of this package as an SPDX identifier.
packageName
stringPackage name.
poetryOptions
projen.python.PoetryPyprojectOptionsWithoutDepsAdditional options to set for poetry if using poetry.
setupConfig
{[ key: string ]: any}Additional fields to pass in the setup() function if using setuptools.
pythonExec
stringPath to the python executable to use.
moduleName
stringName of the python package as used in imports and filenames.
deps
string[]List of runtime dependencies for this project.
devDeps
string[]List of dev dependencies for this project.
pip
booleanUse pip with a requirements.txt file to track project dependencies.
poetry
booleanUse poetry to manage your project dependencies, virtual environment, and (optional) packaging/publishing.
projenrcJs
booleanUse projenrc in javascript.
projenrcJsOptions
projen.javascript.ProjenrcOptionsOptions related to projenrc in JavaScript.
projenrcPython
booleanUse projenrc in Python.
projenrcPythonOptions
projen.python.ProjenrcOptionsOptions related to projenrc in python.
projenrcTs
booleanUse projenrc in TypeScript.
projenrcTsOptions
projen.typescript.ProjenrcTsOptionsOptions related to projenrc in TypeScript.
pytest
booleanInclude pytest tests.
pytestOptions
projen.python.PytestOptionspytest options.
sample
booleanInclude sample code and test if the relevant directories don't exist.
setuptools
booleanUse setuptools with a setup.py script for packaging and publishing.
venv
booleanUse venv to manage a virtual environment for installing dependencies inside.
venvOptions
projen.python.VenvOptionsVenv options.
buildCommand
stringA command to execute before synthesis.
cdkout
stringcdk.out directory.
context
{[ key: string ]: any}Additional context to include in cdk.json.
featureFlags
booleanInclude all feature flags in cdk.json.
requireApproval
ApprovalLevel
To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.
watchExcludes
string[]Glob patterns to exclude from cdk watch.
watchIncludes
string[]Glob patterns to include in cdk watch.
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.
appEntrypoint
stringThe CDK app's entrypoint (relative to the source directory, which is "src" by default).
testdir
stringPython sources directory.

nameRequired
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
public readonly commitGenerated: boolean;
  • Type: boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
public readonly gitIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
public readonly gitOptions: GitOptions;
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
public readonly logging: LoggerOptions;
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other subprojects.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

The parent project, if this project is part of a bigger project.


projenCommandOptional
public readonly projenCommand: string;
  • Type: string
  • Default: "npx projen"

The shell command to use in order to run the projen CLI.

Can be used to customize in special environments.


projenrcJsonOptional
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
public readonly renovatebot: boolean;
  • Type: boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
public readonly renovatebotOptions: RenovatebotOptions;
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


autoApproveOptionsOptional
public readonly autoApproveOptions: AutoApproveOptions;
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoMergeOptional
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
public readonly autoMergeOptions: AutoMergeOptions;
  • Type: projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


clobberOptional
public readonly clobber: boolean;
  • Type: boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


devContainerOptional
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


githubOptional
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
public readonly githubOptions: GitHubOptions;
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead
public readonly mergify: boolean;
  • Type: boolean
  • Default: true

Whether mergify should be enabled on this repository or not.


mergifyOptionsOptional
  • Deprecated: use githubOptions.mergifyOptions instead
public readonly mergifyOptions: MergifyOptions;
  • Type: projen.github.MergifyOptions
  • Default: default options

Options for mergify.


projectTypeOptional
  • Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


projenCredentialsOptional
public readonly projenCredentials: GithubCredentials;
  • Type: projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

Choose a method of providing GitHub API access for projen workflows.


projenTokenSecretOptional
  • Deprecated: use projenCredentials
public readonly projenTokenSecret: string;
  • Type: string
  • Default: "PROJEN_GITHUB_TOKEN"

The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.

This token needs to have the repo, workflows and packages scope.


readmeOptional
public readonly readme: SampleReadmeProps;
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
public readonly staleOptions: StaleOptions;
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


authorEmailRequired
public readonly authorEmail: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Author's e-mail.


authorNameRequired
public readonly authorName: string;
  • Type: string
  • Default: $GIT_USER_NAME

Author's name.


versionRequired
public readonly version: string;
  • Type: string
  • Default: "0.1.0"

Version of the package.


classifiersOptional
public readonly classifiers: string[];
  • Type: string[]

A list of PyPI trove classifiers that describe the project.

https://pypi.org/classifiers/


descriptionOptional
public readonly description: string;
  • Type: string

A short description of the package.


homepageOptional
public readonly homepage: string;
  • Type: string

A URL to the website of the project.


licenseOptional
public readonly license: string;
  • Type: string

License of this package as an SPDX identifier.


packageNameOptional
public readonly packageName: string;
  • Type: string

Package name.


poetryOptionsOptional
public readonly poetryOptions: PoetryPyprojectOptionsWithoutDeps;
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


setupConfigOptional
public readonly setupConfig: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Additional fields to pass in the setup() function if using setuptools.


pythonExecOptional
public readonly pythonExec: string;
  • Type: string
  • Default: "python"

Path to the python executable to use.


moduleNameRequired
public readonly moduleName: string;
  • Type: string
  • Default: $PYTHON_MODULE_NAME

Name of the python package as used in imports and filenames.

Must only consist of alphanumeric characters and underscores.


depsOptional
public readonly deps: string[];
  • Type: string[]
  • Default: []

List of runtime dependencies for this project.

Dependencies use the format: <module>@<semver>

Additional dependencies can be added via project.addDependency().


devDepsOptional
public readonly devDeps: string[];
  • Type: string[]
  • Default: []

List of dev dependencies for this project.

Dependencies use the format: <module>@<semver>

Additional dependencies can be added via project.addDevDependency().


pipOptional
public readonly pip: boolean;
  • Type: boolean
  • Default: true, unless poetry is true, then false

Use pip with a requirements.txt file to track project dependencies.


poetryOptional
public readonly poetry: boolean;
  • Type: boolean
  • Default: false

Use poetry to manage your project dependencies, virtual environment, and (optional) packaging/publishing.

This feature is incompatible with pip, setuptools, or venv. If you set this option to true, then pip, setuptools, and venv must be set to false.


projenrcJsOptional
public readonly projenrcJs: boolean;
  • Type: boolean
  • Default: false

Use projenrc in javascript.

This will install projen as a JavaScript dependency and add a synth task which will run .projenrc.js.


projenrcJsOptionsOptional
public readonly projenrcJsOptions: ProjenrcOptions;
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options related to projenrc in JavaScript.


projenrcPythonOptional
public readonly projenrcPython: boolean;
  • Type: boolean
  • Default: true

Use projenrc in Python.

This will install projen as a Python dependency and add a synth task which will run .projenrc.py.


projenrcPythonOptionsOptional
public readonly projenrcPythonOptions: ProjenrcOptions;
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


projenrcTsOptional
public readonly projenrcTs: boolean;
  • Type: boolean
  • Default: false

Use projenrc in TypeScript.

This will create a tsconfig file (default: tsconfig.projen.json) and use ts-node in the default task to parse the project source files.


projenrcTsOptionsOptional
public readonly projenrcTsOptions: ProjenrcTsOptions;
  • Type: projen.typescript.ProjenrcTsOptions
  • Default: default options

Options related to projenrc in TypeScript.


pytestOptional
public readonly pytest: boolean;
  • Type: boolean
  • Default: true

Include pytest tests.


pytestOptionsOptional
public readonly pytestOptions: PytestOptions;
  • Type: projen.python.PytestOptions
  • Default: defaults

pytest options.


sampleOptional
public readonly sample: boolean;
  • Type: boolean
  • Default: true

Include sample code and test if the relevant directories don't exist.


setuptoolsOptional
public readonly setuptools: boolean;
  • Type: boolean
  • Default: true, unless poetry is true, then false

Use setuptools with a setup.py script for packaging and publishing.


venvOptional
public readonly venv: boolean;
  • Type: boolean
  • Default: true, unless poetry is true, then false

Use venv to manage a virtual environment for installing dependencies inside.


venvOptionsOptional
public readonly venvOptions: VenvOptions;
  • Type: projen.python.VenvOptions
  • Default: defaults

Venv options.


buildCommandOptional
public readonly buildCommand: string;
  • Type: string
  • Default: no build command

A command to execute before synthesis.

This command will be called when running cdk synth or when cdk watch identifies a change in your source code before redeployment.


cdkoutOptional
public readonly cdkout: string;
  • Type: string
  • Default: "cdk.out"

cdk.out directory.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context to include in cdk.json.


featureFlagsOptional
public readonly featureFlags: boolean;
  • Type: boolean
  • Default: true

Include all feature flags in cdk.json.


requireApprovalOptional
public readonly requireApproval: ApprovalLevel;

To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.


watchExcludesOptional
public readonly watchExcludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to exclude from cdk watch.


watchIncludesOptional
public readonly watchIncludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to include in cdk watch.


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


appEntrypointOptional
public readonly appEntrypoint: string;
  • Type: string
  • Default: "app.py"

The CDK app's entrypoint (relative to the source directory, which is "src" by default).


testdirOptional
public readonly testdir: string;
  • Type: string
  • Default: "tests"

Python sources directory.


AwsCdkTypeScriptAppOptions

Initializer

import { awscdk } from 'projen'

const awsCdkTypeScriptAppOptions: awscdk.AwsCdkTypeScriptAppOptions = { ... }

Properties

NameTypeDescription
name
stringThis is the name of your project.
commitGenerated
booleanWhether to commit the managed files by default.
gitIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .gitignore file.
gitOptions
projen.GitOptionsConfiguration options for git.
logging
projen.LoggerOptionsConfigure logging options such as verbosity.
outdir
stringThe root directory of the project.
parent
projen.ProjectThe parent project, if this project is part of a bigger project.
projenCommand
stringThe shell command to use in order to run the projen CLI.
projenrcJson
booleanGenerate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions
projen.ProjenrcJsonOptionsOptions for .projenrc.json.
renovatebot
booleanUse renovatebot to handle dependency upgrades.
renovatebotOptions
projen.RenovatebotOptionsOptions for renovatebot.
autoApproveOptions
projen.github.AutoApproveOptionsEnable and configure the 'auto approve' workflow.
autoMerge
booleanEnable automatic merging on GitHub.
autoMergeOptions
projen.github.AutoMergeOptionsConfigure options for automatic merging on GitHub.
clobber
booleanAdd a clobber task which resets the repo to origin.
devContainer
booleanAdd a VSCode development environment (used for GitHub Codespaces).
github
booleanEnable GitHub integration.
githubOptions
projen.github.GitHubOptionsOptions for GitHub integration.
gitpod
booleanAdd a Gitpod development environment.
mergify
booleanWhether mergify should be enabled on this repository or not.
mergifyOptions
projen.github.MergifyOptionsOptions for mergify.
projectType
projen.ProjectTypeWhich type of project this is (library/app).
projenCredentials
projen.github.GithubCredentialsChoose a method of providing GitHub API access for projen workflows.
projenTokenSecret
stringThe name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme
projen.SampleReadmePropsThe README setup.
stale
booleanAuto-close of stale issues and pull request.
staleOptions
projen.github.StaleOptionsAuto-close stale issues and pull requests.
vscode
booleanEnable VSCode integration.
allowLibraryDependencies
booleanAllow the project to include peerDependencies and bundledDependencies.
authorEmail
stringAuthor's e-mail.
authorName
stringAuthor's name.
authorOrganization
booleanIs the author an organization.
authorUrl
stringAuthor's URL / Website.
autoDetectBin
booleanAutomatically add all executables under the bin directory to your package.json file under the bin section.
bin
{[ key: string ]: string}Binary programs vended with your module.
bugsEmail
stringThe email address to which issues should be reported.
bugsUrl
stringThe url to your project's issue tracker.
bundledDeps
string[]List of dependencies to bundle into this module.
codeArtifactOptions
projen.javascript.CodeArtifactOptionsOptions for npm packages using AWS CodeArtifact.
deps
string[]Runtime dependencies of this module.
description
stringThe description is just a string that helps people understand the purpose of the package.
devDeps
string[]Build dependencies for this module.
entrypoint
stringModule entrypoint (main in package.json).
homepage
stringPackage's Homepage / Website.
keywords
string[]Keywords to include in package.json.
license
stringLicense's SPDX identifier.
licensed
booleanIndicates if a license should be added.
maxNodeVersion
stringMinimum node.js version to require via engines (inclusive).
minNodeVersion
stringMinimum Node.js version to require via package.json engines (inclusive).
npmAccess
projen.javascript.NpmAccessAccess level of the npm package.
npmProvenance
booleanShould provenance statements be generated when the package is published.
npmRegistry
stringThe host name of the npm registry to publish to.
npmRegistryUrl
stringThe base URL of the npm package registry.
npmTokenSecret
stringGitHub secret which contains the NPM token to use when publishing packages.
packageManager
projen.javascript.NodePackageManagerThe Node Package Manager used to execute scripts.
packageName
stringThe "name" in package.json.
peerDependencyOptions
projen.javascript.PeerDependencyOptionsOptions for peerDeps.
peerDeps
string[]Peer dependencies for this module.
pnpmVersion
stringThe version of PNPM to use if using PNPM as a package manager.
repository
stringThe repository is the location where the actual code for your package lives.
repositoryDirectory
stringIf the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
scopedPackagesOptions
projen.javascript.ScopedPackagesOptions[]Options for privately hosted scoped packages.
scripts
{[ key: string ]: string}npm scripts to include.
stability
stringPackage's Stability.
yarnBerryOptions
projen.javascript.YarnBerryOptionsOptions for Yarn Berry.
jsiiReleaseVersion
stringVersion requirement of publib which is used to publish modules to npm.
majorVersion
numberMajor version to release from the default branch.
minMajorVersion
numberMinimal Major version to release.
npmDistTag
stringThe npmDistTag to use when publishing from the default branch.
postBuildSteps
projen.github.workflows.JobStep[]Steps to execute after build as part of the release workflow.
prerelease
stringBump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun
booleanInstead of actually publishing to package managers, just print the publishing command.
publishTasks
booleanDefine publishing tasks that can be executed manually as well as workflows.
releasableCommits
projen.ReleasableCommitsFind commits that should be considered releasable Used to decide if a release is required.
releaseBranches
{[ key: string ]: projen.release.BranchOptions}Defines additional release branches.
releaseEveryCommit
booleanAutomatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue
booleanCreate a github issue on every failed publishing task.
releaseFailureIssueLabel
stringThe label to apply to issues indicating publish failures.
releaseSchedule
stringCRON schedule to trigger new releases.
releaseTagPrefix
stringAutomatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger
projen.release.ReleaseTriggerThe release trigger to use.
releaseWorkflowName
stringThe name of the default release workflow.
releaseWorkflowSetupSteps
projen.github.workflows.JobStep[]A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions
{[ key: string ]: any}Custom configuration used when creating changelog with standard-version package.
workflowContainerImage
stringContainer image to use for GitHub workflows.
workflowRunsOn
string[]Github Runner selection labels.
workflowRunsOnGroup
projen.GroupRunnerOptionsGithub Runner Group selection options.
defaultReleaseBranch
stringThe name of the main release branch.
artifactsDirectory
stringA directory which will contain build artifacts.
autoApproveUpgrades
booleanAutomatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow
booleanDefine a GitHub workflow for building PRs.
buildWorkflowOptions
projen.javascript.BuildWorkflowOptionsOptions for PR build workflow.
buildWorkflowTriggers
projen.github.workflows.TriggersBuild workflow triggers.
bundlerOptions
projen.javascript.BundlerOptionsOptions for Bundler.
checkLicenses
projen.javascript.LicenseCheckerOptionsConfigure which licenses should be deemed acceptable for use by dependencies.
codeCov
booleanDefine a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.
codeCovTokenSecret
stringDefine the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner
stringLicense copyright owner.
copyrightPeriod
stringThe copyright years to put in the LICENSE file.
dependabot
booleanUse dependabot to handle dependency upgrades.
dependabotOptions
projen.github.DependabotOptionsOptions for dependabot.
depsUpgrade
booleanUse tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions
projen.javascript.UpgradeDependenciesOptionsOptions for UpgradeDependencies.
gitignore
string[]Additional entries to .gitignore.
jest
booleanSetup jest unit tests.
jestOptions
projen.javascript.JestOptionsJest options.
mutableBuild
booleanAutomatically update files modified during builds to pull-request branches.
npmignore
string[]Additional entries to .npmignore.
npmignoreEnabled
booleanDefines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .npmignore file.
package
booleanDefines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier
booleanSetup prettier.
prettierOptions
projen.javascript.PrettierOptionsPrettier options.
projenDevDependency
booleanIndicates of "projen" should be installed as a devDependency.
projenrcJs
booleanGenerate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions
projen.javascript.ProjenrcOptionsOptions for .projenrc.js.
projenVersion
stringVersion of projen to install.
pullRequestTemplate
booleanInclude a GitHub pull request template.
pullRequestTemplateContents
string[]The contents of the pull request template.
release
booleanAdd release management to this project.
releaseToNpm
booleanAutomatically release to npm when new versions are introduced.
releaseWorkflow
booleanDEPRECATED: renamed to release.
workflowBootstrapSteps
projen.github.workflows.JobStep[]Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity
projen.github.GitIdentityThe git identity to use in workflows.
workflowNodeVersion
stringThe node version to use in GitHub workflows.
workflowPackageCache
booleanEnable Node.js package cache in GitHub workflows.
disableTsconfig
booleanDo not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev
booleanDo not generate a tsconfig.dev.json file.
docgen
booleanDocgen by Typedoc.
docsDirectory
stringDocs directory.
entrypointTypes
stringThe .d.ts file that includes the type declarations for this module.
eslint
booleanSetup eslint.
eslintOptions
projen.javascript.EslintOptionsEslint options.
libdir
stringTypescript artifacts output directory.
projenrcTs
booleanUse TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions
projen.typescript.ProjenrcOptionsOptions for .projenrc.ts.
sampleCode
booleanGenerate one-time sample in src/ and test/ if there are no files there.
srcdir
stringTypescript sources directory.
testdir
stringJest tests directory. Tests files should be named xxx.test.ts.
tsconfig
projen.javascript.TypescriptConfigOptionsCustom TSConfig.
tsconfigDev
projen.javascript.TypescriptConfigOptionsCustom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile
stringThe name of the development tsconfig.json file.
tsJestOptions
projen.typescript.TsJestOptionsOptions for ts-jest.
typescriptVersion
stringTypeScript version to use.
buildCommand
stringA command to execute before synthesis.
cdkout
stringcdk.out directory.
context
{[ key: string ]: any}Additional context to include in cdk.json.
featureFlags
booleanInclude all feature flags in cdk.json.
requireApproval
ApprovalLevel
To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.
watchExcludes
string[]Glob patterns to exclude from cdk watch.
watchIncludes
string[]Glob patterns to include in cdk watch.
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.
appEntrypoint
stringThe CDK app's entrypoint (relative to the source directory, which is "src" by default).
edgeLambdaAutoDiscover
booleanAutomatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
experimentalIntegRunner
booleanEnable experimental support for the AWS CDK integ-runner.
integrationTestAutoDiscover
booleanAutomatically discovers and creates integration tests for each .integ.ts file in under your test directory.
lambdaAutoDiscover
booleanAutomatically adds an awscdk.LambdaFunction for each .lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
lambdaExtensionAutoDiscover
booleanAutomatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
lambdaOptions
LambdaFunctionCommonOptions
Common options for all AWS Lambda functions.

nameRequired
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
public readonly commitGenerated: boolean;
  • Type: boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
public readonly gitIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
public readonly gitOptions: GitOptions;
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
public readonly logging: LoggerOptions;
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other subprojects.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

The parent project, if this project is part of a bigger project.


projenCommandOptional
public readonly projenCommand: string;
  • Type: string
  • Default: "npx projen"

The shell command to use in order to run the projen CLI.

Can be used to customize in special environments.


projenrcJsonOptional
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
public readonly renovatebot: boolean;
  • Type: boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
public readonly renovatebotOptions: RenovatebotOptions;
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


autoApproveOptionsOptional
public readonly autoApproveOptions: AutoApproveOptions;
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoMergeOptional
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
public readonly autoMergeOptions: AutoMergeOptions;
  • Type: projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


clobberOptional
public readonly clobber: boolean;
  • Type: boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


devContainerOptional
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


githubOptional
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
public readonly githubOptions: GitHubOptions;
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead
public readonly mergify: boolean;
  • Type: boolean
  • Default: true

Whether mergify should be enabled on this repository or not.


mergifyOptionsOptional
  • Deprecated: use githubOptions.mergifyOptions instead
public readonly mergifyOptions: MergifyOptions;
  • Type: projen.github.MergifyOptions
  • Default: default options

Options for mergify.


projectTypeOptional
  • Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


projenCredentialsOptional
public readonly projenCredentials: GithubCredentials;
  • Type: projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

Choose a method of providing GitHub API access for projen workflows.


projenTokenSecretOptional
  • Deprecated: use projenCredentials
public readonly projenTokenSecret: string;
  • Type: string
  • Default: "PROJEN_GITHUB_TOKEN"

The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.

This token needs to have the repo, workflows and packages scope.


readmeOptional
public readonly readme: SampleReadmeProps;
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
public readonly staleOptions: StaleOptions;
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


allowLibraryDependenciesOptional
public readonly allowLibraryDependencies: boolean;
  • Type: boolean
  • Default: true

Allow the project to include peerDependencies and bundledDependencies.

This is normally only allowed for libraries. For apps, there's no meaning for specifying these.


authorEmailOptional
public readonly authorEmail: string;
  • Type: string

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string

Author's name.


authorOrganizationOptional
public readonly authorOrganization: boolean;
  • Type: boolean

Is the author an organization.


authorUrlOptional
public readonly authorUrl: string;
  • Type: string

Author's URL / Website.


autoDetectBinOptional
public readonly autoDetectBin: boolean;
  • Type: boolean
  • Default: true

Automatically add all executables under the bin directory to your package.json file under the bin section.


binOptional
public readonly bin: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Binary programs vended with your module.

You can use this option to add/customize how binaries are represented in your package.json, but unless autoDetectBin is false, every executable file under bin will automatically be added to this section.


bugsEmailOptional
public readonly bugsEmail: string;
  • Type: string

The email address to which issues should be reported.


bugsUrlOptional
public readonly bugsUrl: string;
  • Type: string

The url to your project's issue tracker.


bundledDepsOptional
public readonly bundledDeps: string[];
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and bundledDependencies section of your package.json.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


codeArtifactOptionsOptional
public readonly codeArtifactOptions: CodeArtifactOptions;
  • Type: projen.javascript.CodeArtifactOptions
  • Default: undefined

Options for npm packages using AWS CodeArtifact.

This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact


depsOptional
public readonly deps: string[];
  • Type: string[]
  • Default: []

Runtime dependencies of this module.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


Example

[ 'express', 'lodash', 'foo@^2' ]
descriptionOptional
public readonly description: string;
  • Type: string

The description is just a string that helps people understand the purpose of the package.

It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description


devDepsOptional
public readonly devDeps: string[];
  • Type: string[]
  • Default: []

Build dependencies for this module.

These dependencies will only be available in your build environment but will not be fetched when this module is consumed.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


Example

[ 'typescript', '@types/express' ]
entrypointOptional
public readonly entrypoint: string;
  • Type: string
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

Set to an empty string to not include main in your package.json


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


keywordsOptional
public readonly keywords: string[];
  • Type: string[]

Keywords to include in package.json.


licenseOptional
public readonly license: string;
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the licensed option if you want to no license to be specified.


licensedOptional
public readonly licensed: boolean;
  • Type: boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string
  • Default: no max

Minimum node.js version to require via engines (inclusive).


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string
  • Default: no "engines" specified

Minimum Node.js version to require via package.json engines (inclusive).


npmAccessOptional
public readonly npmAccess: NpmAccess;
  • Type: projen.javascript.NpmAccess
  • Default: for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.

Access level of the npm package.


npmProvenanceOptional
public readonly npmProvenance: boolean;
  • Type: boolean
  • Default: true for public packages, false otherwise

Should provenance statements be generated when the package is published.

A supported package manager is required to publish a package with npm provenance statements and you will need to use a supported CI/CD provider.

Note that the projen Release and Publisher components are using publib to publish packages, which is using npm internally and supports provenance statements independently of the package manager used.

https://docs.npmjs.com/generating-provenance-statements


npmRegistryOptional
  • Deprecated: use npmRegistryUrl instead
public readonly npmRegistry: string;
  • Type: string

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional
public readonly npmRegistryUrl: string;

The base URL of the npm package registry.

Must be a URL (e.g. start with "https://" or "http://")


npmTokenSecretOptional
public readonly npmTokenSecret: string;
  • Type: string
  • Default: "NPM_TOKEN"

GitHub secret which contains the NPM token to use when publishing packages.


packageManagerOptional
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


packageNameOptional
public readonly packageName: string;
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional
public readonly peerDependencyOptions: PeerDependencyOptions;
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peerDepsOptional
public readonly peerDeps: string[];
  • Type: string[]
  • Default: []

Peer dependencies for this module.

Dependencies listed here are required to be installed (and satisfied) by the consumer of this library. Using peer dependencies allows you to ensure that only a single module of a certain library exists in the node_modules tree of your consumers.

Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers.

Unless peerDependencyOptions.pinnedDevDependency is disabled (it is enabled by default), projen will automatically add a dev dependency with a pinned version for each peer dependency. This will ensure that you build & test your module against the lowest peer version required.


pnpmVersionOptional
public readonly pnpmVersion: string;
  • Type: string
  • Default: "7"

The version of PNPM to use if using PNPM as a package manager.


repositoryOptional
public readonly repository: string;
  • Type: string

The repository is the location where the actual code for your package lives.

See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository


repositoryDirectoryOptional
public readonly repositoryDirectory: string;
  • Type: string

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.


scopedPackagesOptionsOptional
public readonly scopedPackagesOptions: ScopedPackagesOptions[];
  • Type: projen.javascript.ScopedPackagesOptions[]
  • Default: fetch all scoped packages from the public npm registry

Options for privately hosted scoped packages.


scriptsOptional
  • Deprecated: use project.addTask() or package.setScript()
public readonly scripts: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: {}

npm scripts to include.

If a script has the same name as a standard script, the standard script will be overwritten. Also adds the script as a task.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


yarnBerryOptionsOptional
public readonly yarnBerryOptions: YarnBerryOptions;
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsiiReleaseVersionOptional
public readonly jsiiReleaseVersion: string;
  • Type: string
  • Default: "latest"

Version requirement of publib which is used to publish modules to npm.


majorVersionOptional
public readonly majorVersion: number;
  • Type: number
  • Default: Major version is not enforced.

Major version to release from the default branch.

If this is specified, we bump the latest version of this major version line. If not specified, we bump the global latest version.


minMajorVersionOptional
public readonly minMajorVersion: number;
  • Type: number
  • Default: No minimum version is being enforced

Minimal Major version to release.

This can be useful to set to 1, as breaking changes before the 1.x major release are not incrementing the major version number.

Can not be set together with majorVersion.


npmDistTagOptional
public readonly npmDistTag: string;
  • Type: string
  • Default: "latest"

The npmDistTag to use when publishing from the default branch.

To set the npm dist-tag for release branches, set the npmDistTag property for each branch.


postBuildStepsOptional
public readonly postBuildSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: []

Steps to execute after build as part of the release workflow.


prereleaseOptional
public readonly prerelease: string;
  • Type: string
  • Default: normal semantic versions

Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").


publishDryRunOptional
public readonly publishDryRun: boolean;
  • Type: boolean
  • Default: false

Instead of actually publishing to package managers, just print the publishing command.


publishTasksOptional
public readonly publishTasks: boolean;
  • Type: boolean
  • Default: false

Define publishing tasks that can be executed manually as well as workflows.

Normally, publishing only happens within automated workflows. Enable this in order to create a publishing task for each publishing activity.


releasableCommitsOptional
public readonly releasableCommits: ReleasableCommits;
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

Find commits that should be considered releasable Used to decide if a release is required.


releaseBranchesOptional
public readonly releaseBranches: {[ key: string ]: BranchOptions};
  • Type: {[ key: string ]: projen.release.BranchOptions}
  • Default: no additional branches are used for release. you can use addBranch() to add additional branches.

Defines additional release branches.

A workflow will be created for each release branch which will publish releases from commits in this branch. Each release branch must be assigned a major version number which is used to enforce that versions published from that branch always use that major version. If multiple branches are used, the majorVersion field must also be provided for the default branch.


releaseEveryCommitOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
public readonly releaseEveryCommit: boolean;
  • Type: boolean
  • Default: true

Automatically release new versions every commit to one of branches in releaseBranches.


releaseFailureIssueOptional
public readonly releaseFailureIssue: boolean;
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
public readonly releaseFailureIssueLabel: string;
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseScheduleOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
public readonly releaseSchedule: string;
  • Type: string
  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseTagPrefixOptional
public readonly releaseTagPrefix: string;
  • Type: string
  • Default: "v"

Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.

Note: this prefix is used to detect the latest tagged version when bumping, so if you change this on a project with an existing version history, you may need to manually tag your latest release with the new prefix.


releaseTriggerOptional
public readonly releaseTrigger: ReleaseTrigger;
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


releaseWorkflowNameOptional
public readonly releaseWorkflowName: string;
  • Type: string
  • Default: "release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional
public readonly releaseWorkflowSetupSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]

A set of workflow steps to execute in order to setup the workflow container.


versionrcOptionsOptional
public readonly versionrcOptions: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: standard configuration applicable for GitHub repositories

Custom configuration used when creating changelog with standard-version package.

Given values either append to default configuration or overwrite values in it.


workflowContainerImageOptional
public readonly workflowContainerImage: string;
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


workflowRunsOnOptional
public readonly workflowRunsOn: string[];
  • Type: string[]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflowRunsOnGroupOptional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


defaultReleaseBranchRequired
public readonly defaultReleaseBranch: string;
  • Type: string
  • Default: "main"

The name of the main release branch.


artifactsDirectoryOptional
public readonly artifactsDirectory: string;
  • Type: string
  • Default: "dist"

A directory which will contain build artifacts.


autoApproveUpgradesOptional
public readonly autoApproveUpgrades: boolean;
  • Type: boolean
  • Default: true

Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).

Throw if set to true but autoApproveOptions are not defined.


buildWorkflowOptional
public readonly buildWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


buildWorkflowOptionsOptional
public readonly buildWorkflowOptions: BuildWorkflowOptions;
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


buildWorkflowTriggersOptional
  • Deprecated: - Use buildWorkflowOptions.workflowTriggers
public readonly buildWorkflowTriggers: Triggers;
  • Type: projen.github.workflows.Triggers
  • Default: "{ pullRequest: {}, workflowDispatch: {} }"

Build workflow triggers.


bundlerOptionsOptional
public readonly bundlerOptions: BundlerOptions;
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


checkLicensesOptional
public readonly checkLicenses: LicenseCheckerOptions;
  • Type: projen.javascript.LicenseCheckerOptions
  • Default: no license checks are run during the build and all licenses will be accepted

Configure which licenses should be deemed acceptable for use by dependencies.

This setting will cause the build to fail, if any prohibited or not allowed licenses ares encountered.


codeCovOptional
public readonly codeCov: boolean;
  • Type: boolean
  • Default: false

Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.


codeCovTokenSecretOptional
public readonly codeCovTokenSecret: string;
  • Type: string
  • Default: if this option is not specified, only public repositories are supported

Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.


copyrightOwnerOptional
public readonly copyrightOwner: string;
  • Type: string
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyrightPeriodOptional
public readonly copyrightPeriod: string;
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
public readonly dependabot: boolean;
  • Type: boolean
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabotOptionsOptional
public readonly dependabotOptions: DependabotOptions;
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsUpgradeOptional
public readonly depsUpgrade: boolean;
  • Type: boolean
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


depsUpgradeOptionsOptional
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
public readonly gitignore: string[];
  • Type: string[]

Additional entries to .gitignore.


jestOptional
public readonly jest: boolean;
  • Type: boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional
public readonly jestOptions: JestOptions;
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


mutableBuildOptional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
public readonly mutableBuild: boolean;
  • Type: boolean
  • Default: true

Automatically update files modified during builds to pull-request branches.

This means that any files synthesized by projen or e.g. test snapshots will always be up-to-date before a PR is merged.

Implies that PR builds do not have anti-tamper checks.


npmignoreOptional
  • Deprecated: - use project.addPackageIgnore
public readonly npmignore: string[];
  • Type: string[]

Additional entries to .npmignore.


npmignoreEnabledOptional
public readonly npmignoreEnabled: boolean;
  • Type: boolean
  • Default: true

Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.


npmIgnoreOptionsOptional
public readonly npmIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
public readonly package: boolean;
  • Type: boolean
  • Default: true

Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).


prettierOptional
public readonly prettier: boolean;
  • Type: boolean
  • Default: false

Setup prettier.


prettierOptionsOptional
public readonly prettierOptions: PrettierOptions;
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projenDevDependencyOptional
public readonly projenDevDependency: boolean;
  • Type: boolean
  • Default: true if not a subproject

Indicates of "projen" should be installed as a devDependency.


projenrcJsOptional
public readonly projenrcJs: boolean;
  • Type: boolean
  • Default: true if projenrcJson is false

Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.


projenrcJsOptionsOptional
public readonly projenrcJsOptions: ProjenrcOptions;
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenVersionOptional
public readonly projenVersion: string;
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
public readonly pullRequestTemplate: boolean;
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
public readonly pullRequestTemplateContents: string[];
  • Type: string[]
  • Default: default content

The contents of the pull request template.


releaseOptional
public readonly release: boolean;
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseWorkflowOptional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
public readonly workflowBootstrapSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowGitIdentityOptional
public readonly workflowGitIdentity: GitIdentity;
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflowNodeVersionOptional
public readonly workflowNodeVersion: string;
  • Type: string
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflowPackageCacheOptional
public readonly workflowPackageCache: boolean;
  • Type: boolean
  • Default: false

Enable Node.js package cache in GitHub workflows.


disableTsconfigOptional
public readonly disableTsconfig: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).


disableTsconfigDevOptional
public readonly disableTsconfigDev: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
public readonly docgen: boolean;
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
public readonly docsDirectory: string;
  • Type: string
  • Default: "docs"

Docs directory.


entrypointTypesOptional
public readonly entrypointTypes: string;
  • Type: string
  • Default: .d.ts file derived from the project's entrypoint (usually lib/index.d.ts)

The .d.ts file that includes the type declarations for this module.


eslintOptional
public readonly eslint: boolean;
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional
public readonly eslintOptions: EslintOptions;
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


projenrcTsOptional
public readonly projenrcTs: boolean;
  • Type: boolean
  • Default: false

Use TypeScript for your projenrc file (.projenrc.ts).


projenrcTsOptionsOptional
public readonly projenrcTsOptions: ProjenrcOptions;
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

Generate one-time sample in src/ and test/ if there are no files there.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


testdirOptional
public readonly testdir: string;
  • Type: string
  • Default: "test"

Jest tests directory. Tests files should be named xxx.test.ts.

If this directory is under srcdir (e.g. src/test, src/__tests__), then tests are going to be compiled into lib/ and executed as javascript. If the test directory is outside of src, then we configure jest to compile the code in-memory.


tsconfigOptional
public readonly tsconfig: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfigDevOptional
public readonly tsconfigDev: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

Custom tsconfig options for the development tsconfig.json file (used for testing).


tsconfigDevFileOptional
public readonly tsconfigDevFile: string;
  • Type: string
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


tsJestOptionsOptional
public readonly tsJestOptions: TsJestOptions;
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescriptVersionOptional
public readonly typescriptVersion: string;
  • Type: string
  • Default: "latest"

TypeScript version to use.

NOTE: Typescript is not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~1.2.3).


buildCommandOptional
public readonly buildCommand: string;
  • Type: string
  • Default: no build command

A command to execute before synthesis.

This command will be called when running cdk synth or when cdk watch identifies a change in your source code before redeployment.


cdkoutOptional
public readonly cdkout: string;
  • Type: string
  • Default: "cdk.out"

cdk.out directory.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context to include in cdk.json.


featureFlagsOptional
public readonly featureFlags: boolean;
  • Type: boolean
  • Default: true

Include all feature flags in cdk.json.


requireApprovalOptional
public readonly requireApproval: ApprovalLevel;

To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.


watchExcludesOptional
public readonly watchExcludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to exclude from cdk watch.


watchIncludesOptional
public readonly watchIncludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to include in cdk watch.


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


appEntrypointOptional
public readonly appEntrypoint: string;
  • Type: string
  • Default: "main.ts"

The CDK app's entrypoint (relative to the source directory, which is "src" by default).


edgeLambdaAutoDiscoverOptional
public readonly edgeLambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


experimentalIntegRunnerOptional
public readonly experimentalIntegRunner: boolean;
  • Type: boolean
  • Default: false

Enable experimental support for the AWS CDK integ-runner.


integrationTestAutoDiscoverOptional
public readonly integrationTestAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically discovers and creates integration tests for each .integ.ts file in under your test directory.


lambdaAutoDiscoverOptional
public readonly lambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an awscdk.LambdaFunction for each .lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


lambdaExtensionAutoDiscoverOptional
public readonly lambdaExtensionAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


lambdaOptionsOptional
public readonly lambdaOptions: LambdaFunctionCommonOptions;

Common options for all AWS Lambda functions.


CdkConfigCommonOptions

Common options for cdk.json.

Initializer

import { awscdk } from 'projen'

const cdkConfigCommonOptions: awscdk.CdkConfigCommonOptions = { ... }

Properties

NameTypeDescription
buildCommand
stringA command to execute before synthesis.
cdkout
stringcdk.out directory.
context
{[ key: string ]: any}Additional context to include in cdk.json.
featureFlags
booleanInclude all feature flags in cdk.json.
requireApproval
ApprovalLevel
To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.
watchExcludes
string[]Glob patterns to exclude from cdk watch.
watchIncludes
string[]Glob patterns to include in cdk watch.

buildCommandOptional
public readonly buildCommand: string;
  • Type: string
  • Default: no build command

A command to execute before synthesis.

This command will be called when running cdk synth or when cdk watch identifies a change in your source code before redeployment.


cdkoutOptional
public readonly cdkout: string;
  • Type: string
  • Default: "cdk.out"

cdk.out directory.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context to include in cdk.json.


featureFlagsOptional
public readonly featureFlags: boolean;
  • Type: boolean
  • Default: true

Include all feature flags in cdk.json.


requireApprovalOptional
public readonly requireApproval: ApprovalLevel;

To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.


watchExcludesOptional
public readonly watchExcludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to exclude from cdk watch.


watchIncludesOptional
public readonly watchIncludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to include in cdk watch.


CdkConfigOptions

Options for CdkJson.

Initializer

import { awscdk } from 'projen'

const cdkConfigOptions: awscdk.CdkConfigOptions = { ... }

Properties

NameTypeDescription
buildCommand
stringA command to execute before synthesis.
cdkout
stringcdk.out directory.
context
{[ key: string ]: any}Additional context to include in cdk.json.
featureFlags
booleanInclude all feature flags in cdk.json.
requireApproval
ApprovalLevel
To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.
watchExcludes
string[]Glob patterns to exclude from cdk watch.
watchIncludes
string[]Glob patterns to include in cdk watch.
app
stringThe command line to execute in order to synthesize the CDK application (language specific).

buildCommandOptional
public readonly buildCommand: string;
  • Type: string
  • Default: no build command

A command to execute before synthesis.

This command will be called when running cdk synth or when cdk watch identifies a change in your source code before redeployment.


cdkoutOptional
public readonly cdkout: string;
  • Type: string
  • Default: "cdk.out"

cdk.out directory.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context to include in cdk.json.


featureFlagsOptional
public readonly featureFlags: boolean;
  • Type: boolean
  • Default: true

Include all feature flags in cdk.json.


requireApprovalOptional
public readonly requireApproval: ApprovalLevel;

To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.


watchExcludesOptional
public readonly watchExcludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to exclude from cdk watch.


watchIncludesOptional
public readonly watchIncludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to include in cdk watch.


appRequired
public readonly app: string;
  • Type: string

The command line to execute in order to synthesize the CDK application (language specific).


ConstructLibraryAwsOptions

Initializer

import { awscdk } from 'projen'

const constructLibraryAwsOptions: awscdk.ConstructLibraryAwsOptions = { ... }

Properties

NameTypeDescription
name
stringThis is the name of your project.
commitGenerated
booleanWhether to commit the managed files by default.
gitIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .gitignore file.
gitOptions
projen.GitOptionsConfiguration options for git.
logging
projen.LoggerOptionsConfigure logging options such as verbosity.
outdir
stringThe root directory of the project.
parent
projen.ProjectThe parent project, if this project is part of a bigger project.
projenCommand
stringThe shell command to use in order to run the projen CLI.
projenrcJson
booleanGenerate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions
projen.ProjenrcJsonOptionsOptions for .projenrc.json.
renovatebot
booleanUse renovatebot to handle dependency upgrades.
renovatebotOptions
projen.RenovatebotOptionsOptions for renovatebot.
autoApproveOptions
projen.github.AutoApproveOptionsEnable and configure the 'auto approve' workflow.
autoMerge
booleanEnable automatic merging on GitHub.
autoMergeOptions
projen.github.AutoMergeOptionsConfigure options for automatic merging on GitHub.
clobber
booleanAdd a clobber task which resets the repo to origin.
devContainer
booleanAdd a VSCode development environment (used for GitHub Codespaces).
github
booleanEnable GitHub integration.
githubOptions
projen.github.GitHubOptionsOptions for GitHub integration.
gitpod
booleanAdd a Gitpod development environment.
mergify
booleanWhether mergify should be enabled on this repository or not.
mergifyOptions
projen.github.MergifyOptionsOptions for mergify.
projectType
projen.ProjectTypeWhich type of project this is (library/app).
projenCredentials
projen.github.GithubCredentialsChoose a method of providing GitHub API access for projen workflows.
projenTokenSecret
stringThe name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme
projen.SampleReadmePropsThe README setup.
stale
booleanAuto-close of stale issues and pull request.
staleOptions
projen.github.StaleOptionsAuto-close stale issues and pull requests.
vscode
booleanEnable VSCode integration.
allowLibraryDependencies
booleanAllow the project to include peerDependencies and bundledDependencies.
authorEmail
stringAuthor's e-mail.
authorName
stringAuthor's name.
authorOrganization
booleanIs the author an organization.
authorUrl
stringAuthor's URL / Website.
autoDetectBin
booleanAutomatically add all executables under the bin directory to your package.json file under the bin section.
bin
{[ key: string ]: string}Binary programs vended with your module.
bugsEmail
stringThe email address to which issues should be reported.
bugsUrl
stringThe url to your project's issue tracker.
bundledDeps
string[]List of dependencies to bundle into this module.
codeArtifactOptions
projen.javascript.CodeArtifactOptionsOptions for npm packages using AWS CodeArtifact.
deps
string[]Runtime dependencies of this module.
description
stringThe description is just a string that helps people understand the purpose of the package.
devDeps
string[]Build dependencies for this module.
entrypoint
stringModule entrypoint (main in package.json).
homepage
stringPackage's Homepage / Website.
keywords
string[]Keywords to include in package.json.
license
stringLicense's SPDX identifier.
licensed
booleanIndicates if a license should be added.
maxNodeVersion
stringMinimum node.js version to require via engines (inclusive).
minNodeVersion
stringMinimum Node.js version to require via package.json engines (inclusive).
npmAccess
projen.javascript.NpmAccessAccess level of the npm package.
npmProvenance
booleanShould provenance statements be generated when the package is published.
npmRegistry
stringThe host name of the npm registry to publish to.
npmRegistryUrl
stringThe base URL of the npm package registry.
npmTokenSecret
stringGitHub secret which contains the NPM token to use when publishing packages.
packageManager
projen.javascript.NodePackageManagerThe Node Package Manager used to execute scripts.
packageName
stringThe "name" in package.json.
peerDependencyOptions
projen.javascript.PeerDependencyOptionsOptions for peerDeps.
peerDeps
string[]Peer dependencies for this module.
pnpmVersion
stringThe version of PNPM to use if using PNPM as a package manager.
repository
stringThe repository is the location where the actual code for your package lives.
repositoryDirectory
stringIf the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
scopedPackagesOptions
projen.javascript.ScopedPackagesOptions[]Options for privately hosted scoped packages.
scripts
{[ key: string ]: string}npm scripts to include.
stability
stringPackage's Stability.
yarnBerryOptions
projen.javascript.YarnBerryOptionsOptions for Yarn Berry.
jsiiReleaseVersion
stringVersion requirement of publib which is used to publish modules to npm.
majorVersion
numberMajor version to release from the default branch.
minMajorVersion
numberMinimal Major version to release.
npmDistTag
stringThe npmDistTag to use when publishing from the default branch.
postBuildSteps
projen.github.workflows.JobStep[]Steps to execute after build as part of the release workflow.
prerelease
stringBump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun
booleanInstead of actually publishing to package managers, just print the publishing command.
publishTasks
booleanDefine publishing tasks that can be executed manually as well as workflows.
releasableCommits
projen.ReleasableCommitsFind commits that should be considered releasable Used to decide if a release is required.
releaseBranches
{[ key: string ]: projen.release.BranchOptions}Defines additional release branches.
releaseEveryCommit
booleanAutomatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue
booleanCreate a github issue on every failed publishing task.
releaseFailureIssueLabel
stringThe label to apply to issues indicating publish failures.
releaseSchedule
stringCRON schedule to trigger new releases.
releaseTagPrefix
stringAutomatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger
projen.release.ReleaseTriggerThe release trigger to use.
releaseWorkflowName
stringThe name of the default release workflow.
releaseWorkflowSetupSteps
projen.github.workflows.JobStep[]A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions
{[ key: string ]: any}Custom configuration used when creating changelog with standard-version package.
workflowContainerImage
stringContainer image to use for GitHub workflows.
workflowRunsOn
string[]Github Runner selection labels.
workflowRunsOnGroup
projen.GroupRunnerOptionsGithub Runner Group selection options.
defaultReleaseBranch
stringThe name of the main release branch.
artifactsDirectory
stringA directory which will contain build artifacts.
autoApproveUpgrades
booleanAutomatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow
booleanDefine a GitHub workflow for building PRs.
buildWorkflowOptions
projen.javascript.BuildWorkflowOptionsOptions for PR build workflow.
buildWorkflowTriggers
projen.github.workflows.TriggersBuild workflow triggers.
bundlerOptions
projen.javascript.BundlerOptionsOptions for Bundler.
checkLicenses
projen.javascript.LicenseCheckerOptionsConfigure which licenses should be deemed acceptable for use by dependencies.
codeCov
booleanDefine a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.
codeCovTokenSecret
stringDefine the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner
stringLicense copyright owner.
copyrightPeriod
stringThe copyright years to put in the LICENSE file.
dependabot
booleanUse dependabot to handle dependency upgrades.
dependabotOptions
projen.github.DependabotOptionsOptions for dependabot.
depsUpgrade
booleanUse tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions
projen.javascript.UpgradeDependenciesOptionsOptions for UpgradeDependencies.
gitignore
string[]Additional entries to .gitignore.
jest
booleanSetup jest unit tests.
jestOptions
projen.javascript.JestOptionsJest options.
mutableBuild
booleanAutomatically update files modified during builds to pull-request branches.
npmignore
string[]Additional entries to .npmignore.
npmignoreEnabled
booleanDefines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions
projen.IgnoreFileOptionsConfiguration options for .npmignore file.
package
booleanDefines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier
booleanSetup prettier.
prettierOptions
projen.javascript.PrettierOptionsPrettier options.
projenDevDependency
booleanIndicates of "projen" should be installed as a devDependency.
projenrcJs
booleanGenerate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions
projen.javascript.ProjenrcOptionsOptions for .projenrc.js.
projenVersion
stringVersion of projen to install.
pullRequestTemplate
booleanInclude a GitHub pull request template.
pullRequestTemplateContents
string[]The contents of the pull request template.
release
booleanAdd release management to this project.
releaseToNpm
booleanAutomatically release to npm when new versions are introduced.
releaseWorkflow
booleanDEPRECATED: renamed to release.
workflowBootstrapSteps
projen.github.workflows.JobStep[]Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity
projen.github.GitIdentityThe git identity to use in workflows.
workflowNodeVersion
stringThe node version to use in GitHub workflows.
workflowPackageCache
booleanEnable Node.js package cache in GitHub workflows.
disableTsconfig
booleanDo not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev
booleanDo not generate a tsconfig.dev.json file.
docgen
booleanDocgen by Typedoc.
docsDirectory
stringDocs directory.
entrypointTypes
stringThe .d.ts file that includes the type declarations for this module.
eslint
booleanSetup eslint.
eslintOptions
projen.javascript.EslintOptionsEslint options.
libdir
stringTypescript artifacts output directory.
projenrcTs
booleanUse TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions
projen.typescript.ProjenrcOptionsOptions for .projenrc.ts.
sampleCode
booleanGenerate one-time sample in src/ and test/ if there are no files there.
srcdir
stringTypescript sources directory.
testdir
stringJest tests directory. Tests files should be named xxx.test.ts.
tsconfig
projen.javascript.TypescriptConfigOptionsCustom TSConfig.
tsconfigDev
projen.javascript.TypescriptConfigOptionsCustom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile
stringThe name of the development tsconfig.json file.
tsJestOptions
projen.typescript.TsJestOptionsOptions for ts-jest.
typescriptVersion
stringTypeScript version to use.
author
stringThe name of the library author.
authorAddress
stringEmail or URL of the library author.
repositoryUrl
stringGit repository URL.
compat
booleanAutomatically run API compatibility test against the latest version published to npm after compilation.
compatIgnore
stringName of the ignore file for API compatibility tests.
compressAssembly
booleanEmit a compressed version of the assembly.
docgenFilePath
stringFile path for generated docs.
dotnet
projen.cdk.JsiiDotNetTargetNo description.
excludeTypescript
string[]Accepts a list of glob patterns.
jsiiVersion
stringVersion of the jsii compiler to use.
publishToGo
projen.cdk.JsiiGoTargetPublish Go bindings to a git repository.
publishToMaven
projen.cdk.JsiiJavaTargetPublish to maven.
publishToNuget
projen.cdk.JsiiDotNetTargetPublish to NuGet.
publishToPypi
projen.cdk.JsiiPythonTargetPublish to pypi.
python
projen.cdk.JsiiPythonTargetNo description.
rootdir
stringNo description.
catalog
projen.cdk.CatalogLibraries will be picked up by the construct catalog when they are published to npm as jsii modules and will be published under:.
cdkVersion
stringMinimum version of the AWS CDK to depend on.
cdkAssert
booleanWarning: NodeJS only.
cdkAssertions
booleanInstall the assertions library?
cdkDependencies
string[]Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
booleanIf this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).
cdkTestDependencies
string[]AWS CDK modules required for testing.
cdkVersionPinning
booleanUse pinned version instead of caret version for CDK.
constructsVersion
stringMinimum version of the constructs library to depend on.
edgeLambdaAutoDiscover
booleanAutomatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
experimentalIntegRunner
booleanEnable experimental support for the AWS CDK integ-runner.
integrationTestAutoDiscover
booleanAutomatically discovers and creates integration tests for each .integ.ts file under your test directory.
lambdaAutoDiscover
booleanAutomatically adds an aws_lambda.Function for each .lambda.ts handler in your source tree. If this is disabled, you either need to explicitly call aws_lambda.Function.autoDiscover() or define a new aws_lambda.Function() for each handler.
lambdaExtensionAutoDiscover
booleanAutomatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
lambdaOptions
LambdaFunctionCommonOptions
Common options for all AWS Lambda functions.

nameRequired
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly commitGenerated: boolean;
  • Type: boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly gitIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly gitOptions: GitOptions;
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly logging: LoggerOptions;
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly outdir: string;
  • Type: string
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other subprojects.


parentOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly parent: Project;
  • Type: projen.Project

The parent project, if this project is part of a bigger project.


projenCommandOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenCommand: string;
  • Type: string
  • Default: "npx projen"

The shell command to use in order to run the projen CLI.

Can be used to customize in special environments.


projenrcJsonOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly renovatebot: boolean;
  • Type: boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly renovatebotOptions: RenovatebotOptions;
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


autoApproveOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly autoApproveOptions: AutoApproveOptions;
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoMergeOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly autoMergeOptions: AutoMergeOptions;
  • Type: projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


clobberOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly clobber: boolean;
  • Type: boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


devContainerOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


githubOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly githubOptions: GitHubOptions;
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead
public readonly mergify: boolean;
  • Type: boolean
  • Default: true

Whether mergify should be enabled on this repository or not.


mergifyOptionsOptional
  • Deprecated: use githubOptions.mergifyOptions instead
public readonly mergifyOptions: MergifyOptions;
  • Type: projen.github.MergifyOptions
  • Default: default options

Options for mergify.


projectTypeOptional
  • Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


projenCredentialsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenCredentials: GithubCredentials;
  • Type: projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

Choose a method of providing GitHub API access for projen workflows.


projenTokenSecretOptional
  • Deprecated: use projenCredentials
public readonly projenTokenSecret: string;
  • Type: string
  • Default: "PROJEN_GITHUB_TOKEN"

The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.

This token needs to have the repo, workflows and packages scope.


readmeOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly readme: SampleReadmeProps;
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly staleOptions: StaleOptions;
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


allowLibraryDependenciesOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly allowLibraryDependencies: boolean;
  • Type: boolean
  • Default: true

Allow the project to include peerDependencies and bundledDependencies.

This is normally only allowed for libraries. For apps, there's no meaning for specifying these.


authorEmailOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly authorEmail: string;
  • Type: string

Author's e-mail.


authorNameOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly authorName: string;
  • Type: string

Author's name.


authorOrganizationOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly authorOrganization: boolean;
  • Type: boolean

Is the author an organization.


authorUrlOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly authorUrl: string;
  • Type: string

Author's URL / Website.


autoDetectBinOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly autoDetectBin: boolean;
  • Type: boolean
  • Default: true

Automatically add all executables under the bin directory to your package.json file under the bin section.


binOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly bin: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Binary programs vended with your module.

You can use this option to add/customize how binaries are represented in your package.json, but unless autoDetectBin is false, every executable file under bin will automatically be added to this section.


bugsEmailOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly bugsEmail: string;
  • Type: string

The email address to which issues should be reported.


bugsUrlOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly bugsUrl: string;
  • Type: string

The url to your project's issue tracker.


bundledDepsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly bundledDeps: string[];
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and bundledDependencies section of your package.json.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


codeArtifactOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly codeArtifactOptions: CodeArtifactOptions;
  • Type: projen.javascript.CodeArtifactOptions
  • Default: undefined

Options for npm packages using AWS CodeArtifact.

This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact


depsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly deps: string[];
  • Type: string[]
  • Default: []

Runtime dependencies of this module.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


Example

[ 'express', 'lodash', 'foo@^2' ]
descriptionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly description: string;
  • Type: string

The description is just a string that helps people understand the purpose of the package.

It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description


devDepsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly devDeps: string[];
  • Type: string[]
  • Default: []

Build dependencies for this module.

These dependencies will only be available in your build environment but will not be fetched when this module is consumed.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


Example

[ 'typescript', '@types/express' ]
entrypointOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly entrypoint: string;
  • Type: string
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

Set to an empty string to not include main in your package.json


homepageOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


keywordsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly keywords: string[];
  • Type: string[]

Keywords to include in package.json.


licenseOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly license: string;
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the licensed option if you want to no license to be specified.


licensedOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly licensed: boolean;
  • Type: boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly maxNodeVersion: string;
  • Type: string
  • Default: no max

Minimum node.js version to require via engines (inclusive).


minNodeVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly minNodeVersion: string;
  • Type: string
  • Default: no "engines" specified

Minimum Node.js version to require via package.json engines (inclusive).


npmAccessOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmAccess: NpmAccess;
  • Type: projen.javascript.NpmAccess
  • Default: for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.

Access level of the npm package.


npmProvenanceOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmProvenance: boolean;
  • Type: boolean
  • Default: true for public packages, false otherwise

Should provenance statements be generated when the package is published.

A supported package manager is required to publish a package with npm provenance statements and you will need to use a supported CI/CD provider.

Note that the projen Release and Publisher components are using publib to publish packages, which is using npm internally and supports provenance statements independently of the package manager used.

https://docs.npmjs.com/generating-provenance-statements


npmRegistryOptional
  • Deprecated: use npmRegistryUrl instead
public readonly npmRegistry: string;
  • Type: string

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmRegistryUrl: string;

The base URL of the npm package registry.

Must be a URL (e.g. start with "https://" or "http://")


npmTokenSecretOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmTokenSecret: string;
  • Type: string
  • Default: "NPM_TOKEN"

GitHub secret which contains the NPM token to use when publishing packages.


packageManagerOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


packageNameOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly packageName: string;
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly peerDependencyOptions: PeerDependencyOptions;
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peerDepsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly peerDeps: string[];
  • Type: string[]
  • Default: []

Peer dependencies for this module.

Dependencies listed here are required to be installed (and satisfied) by the consumer of this library. Using peer dependencies allows you to ensure that only a single module of a certain library exists in the node_modules tree of your consumers.

Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers.

Unless peerDependencyOptions.pinnedDevDependency is disabled (it is enabled by default), projen will automatically add a dev dependency with a pinned version for each peer dependency. This will ensure that you build & test your module against the lowest peer version required.


pnpmVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly pnpmVersion: string;
  • Type: string
  • Default: "7"

The version of PNPM to use if using PNPM as a package manager.


repositoryOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly repository: string;
  • Type: string

The repository is the location where the actual code for your package lives.

See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository


repositoryDirectoryOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly repositoryDirectory: string;
  • Type: string

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.


scopedPackagesOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly scopedPackagesOptions: ScopedPackagesOptions[];
  • Type: projen.javascript.ScopedPackagesOptions[]
  • Default: fetch all scoped packages from the public npm registry

Options for privately hosted scoped packages.


scriptsOptional
  • Deprecated: use project.addTask() or package.setScript()
public readonly scripts: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: {}

npm scripts to include.

If a script has the same name as a standard script, the standard script will be overwritten. Also adds the script as a task.


stabilityOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly stability: string;
  • Type: string

Package's Stability.


yarnBerryOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly yarnBerryOptions: YarnBerryOptions;
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsiiReleaseVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly jsiiReleaseVersion: string;
  • Type: string
  • Default: "latest"

Version requirement of publib which is used to publish modules to npm.


majorVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly majorVersion: number;
  • Type: number
  • Default: Major version is not enforced.

Major version to release from the default branch.

If this is specified, we bump the latest version of this major version line. If not specified, we bump the global latest version.


minMajorVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly minMajorVersion: number;
  • Type: number
  • Default: No minimum version is being enforced

Minimal Major version to release.

This can be useful to set to 1, as breaking changes before the 1.x major release are not incrementing the major version number.

Can not be set together with majorVersion.


npmDistTagOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmDistTag: string;
  • Type: string
  • Default: "latest"

The npmDistTag to use when publishing from the default branch.

To set the npm dist-tag for release branches, set the npmDistTag property for each branch.


postBuildStepsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly postBuildSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: []

Steps to execute after build as part of the release workflow.


prereleaseOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly prerelease: string;
  • Type: string
  • Default: normal semantic versions

Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").


publishDryRunOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly publishDryRun: boolean;
  • Type: boolean
  • Default: false

Instead of actually publishing to package managers, just print the publishing command.


publishTasksOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly publishTasks: boolean;
  • Type: boolean
  • Default: false

Define publishing tasks that can be executed manually as well as workflows.

Normally, publishing only happens within automated workflows. Enable this in order to create a publishing task for each publishing activity.


releasableCommitsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releasableCommits: ReleasableCommits;
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

Find commits that should be considered releasable Used to decide if a release is required.


releaseBranchesOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseBranches: {[ key: string ]: BranchOptions};
  • Type: {[ key: string ]: projen.release.BranchOptions}
  • Default: no additional branches are used for release. you can use addBranch() to add additional branches.

Defines additional release branches.

A workflow will be created for each release branch which will publish releases from commits in this branch. Each release branch must be assigned a major version number which is used to enforce that versions published from that branch always use that major version. If multiple branches are used, the majorVersion field must also be provided for the default branch.


releaseEveryCommitOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
public readonly releaseEveryCommit: boolean;
  • Type: boolean
  • Default: true

Automatically release new versions every commit to one of branches in releaseBranches.


releaseFailureIssueOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseFailureIssue: boolean;
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseFailureIssueLabel: string;
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseScheduleOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
public readonly releaseSchedule: string;
  • Type: string
  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseTagPrefixOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseTagPrefix: string;
  • Type: string
  • Default: "v"

Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.

Note: this prefix is used to detect the latest tagged version when bumping, so if you change this on a project with an existing version history, you may need to manually tag your latest release with the new prefix.


releaseTriggerOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseTrigger: ReleaseTrigger;
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


releaseWorkflowNameOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseWorkflowName: string;
  • Type: string
  • Default: "release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseWorkflowSetupSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]

A set of workflow steps to execute in order to setup the workflow container.


versionrcOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly versionrcOptions: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: standard configuration applicable for GitHub repositories

Custom configuration used when creating changelog with standard-version package.

Given values either append to default configuration or overwrite values in it.


workflowContainerImageOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowContainerImage: string;
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


workflowRunsOnOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowRunsOn: string[];
  • Type: string[]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflowRunsOnGroupOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowRunsOnGroup: GroupRunnerOptions;
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


defaultReleaseBranchRequired
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly defaultReleaseBranch: string;
  • Type: string
  • Default: "main"

The name of the main release branch.


artifactsDirectoryOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly artifactsDirectory: string;
  • Type: string
  • Default: "dist"

A directory which will contain build artifacts.


autoApproveUpgradesOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly autoApproveUpgrades: boolean;
  • Type: boolean
  • Default: true

Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).

Throw if set to true but autoApproveOptions are not defined.


buildWorkflowOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly buildWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


buildWorkflowOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly buildWorkflowOptions: BuildWorkflowOptions;
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


buildWorkflowTriggersOptional
  • Deprecated: - Use buildWorkflowOptions.workflowTriggers
public readonly buildWorkflowTriggers: Triggers;
  • Type: projen.github.workflows.Triggers
  • Default: "{ pullRequest: {}, workflowDispatch: {} }"

Build workflow triggers.


bundlerOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly bundlerOptions: BundlerOptions;
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


checkLicensesOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly checkLicenses: LicenseCheckerOptions;
  • Type: projen.javascript.LicenseCheckerOptions
  • Default: no license checks are run during the build and all licenses will be accepted

Configure which licenses should be deemed acceptable for use by dependencies.

This setting will cause the build to fail, if any prohibited or not allowed licenses ares encountered.


codeCovOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly codeCov: boolean;
  • Type: boolean
  • Default: false

Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.


codeCovTokenSecretOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly codeCovTokenSecret: string;
  • Type: string
  • Default: if this option is not specified, only public repositories are supported

Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.


copyrightOwnerOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly copyrightOwner: string;
  • Type: string
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyrightPeriodOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly copyrightPeriod: string;
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly dependabot: boolean;
  • Type: boolean
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabotOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly dependabotOptions: DependabotOptions;
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsUpgradeOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly depsUpgrade: boolean;
  • Type: boolean
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


depsUpgradeOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly gitignore: string[];
  • Type: string[]

Additional entries to .gitignore.


jestOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly jest: boolean;
  • Type: boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly jestOptions: JestOptions;
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


mutableBuildOptional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
public readonly mutableBuild: boolean;
  • Type: boolean
  • Default: true

Automatically update files modified during builds to pull-request branches.

This means that any files synthesized by projen or e.g. test snapshots will always be up-to-date before a PR is merged.

Implies that PR builds do not have anti-tamper checks.


npmignoreOptional
  • Deprecated: - use project.addPackageIgnore
public readonly npmignore: string[];
  • Type: string[]

Additional entries to .npmignore.


npmignoreEnabledOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmignoreEnabled: boolean;
  • Type: boolean
  • Default: true

Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.


npmIgnoreOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly npmIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly package: boolean;
  • Type: boolean
  • Default: true

Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).


prettierOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly prettier: boolean;
  • Type: boolean
  • Default: false

Setup prettier.


prettierOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly prettierOptions: PrettierOptions;
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projenDevDependencyOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenDevDependency: boolean;
  • Type: boolean
  • Default: true if not a subproject

Indicates of "projen" should be installed as a devDependency.


projenrcJsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenrcJs: boolean;
  • Type: boolean
  • Default: true if projenrcJson is false

Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.


projenrcJsOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenrcJsOptions: ProjenrcOptions;
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenVersion: string;
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly pullRequestTemplate: boolean;
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly pullRequestTemplateContents: string[];
  • Type: string[]
  • Default: default content

The contents of the pull request template.


releaseOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly release: boolean;
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseWorkflowOptional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowBootstrapSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowGitIdentityOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowGitIdentity: GitIdentity;
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflowNodeVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowNodeVersion: string;
  • Type: string
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflowPackageCacheOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly workflowPackageCache: boolean;
  • Type: boolean
  • Default: false

Enable Node.js package cache in GitHub workflows.


disableTsconfigOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly disableTsconfig: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).


disableTsconfigDevOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly disableTsconfigDev: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly docgen: boolean;
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly docsDirectory: string;
  • Type: string
  • Default: "docs"

Docs directory.


entrypointTypesOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly entrypointTypes: string;
  • Type: string
  • Default: .d.ts file derived from the project's entrypoint (usually lib/index.d.ts)

The .d.ts file that includes the type declarations for this module.


eslintOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly eslint: boolean;
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly eslintOptions: EslintOptions;
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


libdirOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


projenrcTsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenrcTs: boolean;
  • Type: boolean
  • Default: false

Use TypeScript for your projenrc file (.projenrc.ts).


projenrcTsOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly projenrcTsOptions: ProjenrcOptions;
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


sampleCodeOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

Generate one-time sample in src/ and test/ if there are no files there.


srcdirOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


testdirOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly testdir: string;
  • Type: string
  • Default: "test"

Jest tests directory. Tests files should be named xxx.test.ts.

If this directory is under srcdir (e.g. src/test, src/__tests__), then tests are going to be compiled into lib/ and executed as javascript. If the test directory is outside of src, then we configure jest to compile the code in-memory.


tsconfigOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly tsconfig: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfigDevOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly tsconfigDev: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

Custom tsconfig options for the development tsconfig.json file (used for testing).


tsconfigDevFileOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly tsconfigDevFile: string;
  • Type: string
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


tsJestOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly tsJestOptions: TsJestOptions;
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescriptVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly typescriptVersion: string;
  • Type: string
  • Default: "latest"

TypeScript version to use.

NOTE: Typescript is not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~1.2.3).


authorRequired
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly author: string;
  • Type: string
  • Default: $GIT_USER_NAME

The name of the library author.


authorAddressRequired
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly authorAddress: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Email or URL of the library author.


repositoryUrlRequired
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly repositoryUrl: string;
  • Type: string
  • Default: $GIT_REMOTE

Git repository URL.


compatOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly compat: boolean;
  • Type: boolean
  • Default: false

Automatically run API compatibility test against the latest version published to npm after compilation.

You can manually run compatibility tests using yarn compat if this feature is disabled.

  • You can ignore compatibility failures by adding lines to a ".compatignore" file.

compatIgnoreOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly compatIgnore: string;
  • Type: string
  • Default: ".compatignore"

Name of the ignore file for API compatibility tests.


compressAssemblyOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly compressAssembly: boolean;
  • Type: boolean
  • Default: false

Emit a compressed version of the assembly.


docgenFilePathOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly docgenFilePath: string;
  • Type: string
  • Default: "API.md"

File path for generated docs.


dotnetOptional
  • Deprecated: use publishToNuget
public readonly dotnet: JsiiDotNetTarget;
  • Type: projen.cdk.JsiiDotNetTarget

excludeTypescriptOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly excludeTypescript: string[];
  • Type: string[]

Accepts a list of glob patterns.

Files matching any of those patterns will be excluded from the TypeScript compiler input.

By default, jsii will include all *.ts files (except .d.ts files) in the TypeScript compiler input. This can be problematic for example when the package's build or test procedure generates .ts files that cannot be compiled with jsii's compiler settings.


jsiiVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly jsiiVersion: string;
  • Type: string
  • Default: "1.x"

Version of the jsii compiler to use.

Set to "*" if you want to manually manage the version of jsii in your project by managing updates to package.json on your own.

NOTE: The jsii compiler releases since 5.0.0 are not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~5.0.0).


publishToGoOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly publishToGo: JsiiGoTarget;
  • Type: projen.cdk.JsiiGoTarget
  • Default: no publishing

Publish Go bindings to a git repository.


publishToMavenOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly publishToMaven: JsiiJavaTarget;
  • Type: projen.cdk.JsiiJavaTarget
  • Default: no publishing

Publish to maven.


publishToNugetOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly publishToNuget: JsiiDotNetTarget;
  • Type: projen.cdk.JsiiDotNetTarget
  • Default: no publishing

Publish to NuGet.


publishToPypiOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly publishToPypi: JsiiPythonTarget;
  • Type: projen.cdk.JsiiPythonTarget
  • Default: no publishing

Publish to pypi.


pythonOptional
  • Deprecated: use publishToPyPi
public readonly python: JsiiPythonTarget;
  • Type: projen.cdk.JsiiPythonTarget

rootdirOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly rootdir: string;
  • Type: string
  • Default: "."

catalogOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly catalog: Catalog;
  • Type: projen.cdk.Catalog
  • Default: new version will be announced

Libraries will be picked up by the construct catalog when they are published to npm as jsii modules and will be published under:.

https://awscdk.io/packages/[@SCOPE/]PACKAGE@VERSION

The catalog will also post a tweet to https://twitter.com/awscdkio with the package name, description and the above link. You can disable these tweets through { announce: false }.

You can also add a Twitter handle through { twitter: 'xx' } which will be mentioned in the tweet.

https://github.com/construct-catalog/catalog


cdkVersionRequired
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


cdkAssertOptional
  • Deprecated: The
public readonly cdkAssert: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Warning: NodeJS only.

Install the


cdkAssertionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkDependenciesOptional
  • Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
  • Type: string[]

Which AWS CDKv1 modules this project requires.


cdkDependenciesAsDepsOptional
  • Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
  • Type: boolean
  • Default: true

If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies).

This is to ensure that downstream consumers actually have your CDK dependencies installed when using npm < 7 or yarn, where peer dependencies are not automatically installed. If this is disabled, cdkDependencies will be added to devDependencies to ensure they are present during development.

Note: this setting only applies to construct library projects


cdkTestDependenciesOptional
  • Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
  • Type: string[]

AWS CDK modules required for testing.


cdkVersionPinningOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


constructsVersionOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


edgeLambdaAutoDiscoverOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly edgeLambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


experimentalIntegRunnerOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly experimentalIntegRunner: boolean;
  • Type: boolean
  • Default: false

Enable experimental support for the AWS CDK integ-runner.


integrationTestAutoDiscoverOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly integrationTestAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically discovers and creates integration tests for each .integ.ts file under your test directory.


lambdaAutoDiscoverOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly lambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an aws_lambda.Function for each .lambda.ts handler in your source tree. If this is disabled, you either need to explicitly call aws_lambda.Function.autoDiscover() or define a new aws_lambda.Function() for each handler.


lambdaExtensionAutoDiscoverOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly lambdaExtensionAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


lambdaOptionsOptional
  • Deprecated: use AwsCdkConstructLibraryOptions
public readonly lambdaOptions: LambdaFunctionCommonOptions;

Common options for all AWS Lambda functions.


EdgeLambdaAutoDiscoverOptions

Options for EdgeLambdaAutoDiscover.

Initializer

import { awscdk } from 'projen'

const edgeLambdaAutoDiscoverOptions: awscdk.EdgeLambdaAutoDiscoverOptions = { ... }

Properties

NameTypeDescription
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
stringPath to the tsconfig file to use for integration tests.
srcdir
stringProject source tree (relative to project output directory).
lambdaOptions
LambdaFunctionCommonOptions
Options for AWS Lambda functions.

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

Path to the tsconfig file to use for integration tests.


srcdirRequired
public readonly srcdir: string;
  • Type: string

Project source tree (relative to project output directory).


lambdaOptionsOptional
public readonly lambdaOptions: LambdaFunctionCommonOptions;

Options for AWS Lambda functions.


IntegrationTestAutoDiscoverOptions

Options for IntegrationTestAutoDiscover.

Initializer

import { awscdk } from 'projen'

const integrationTestAutoDiscoverOptions: awscdk.IntegrationTestAutoDiscoverOptions = { ... }

Properties

NameTypeDescription
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
stringPath to the tsconfig file to use for integration tests.
testdir
stringTest source tree.
integrationTestOptions
IntegrationTestCommonOptions
Options for integration tests.

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

Path to the tsconfig file to use for integration tests.


testdirRequired
public readonly testdir: string;
  • Type: string

Test source tree.


integrationTestOptionsOptional
public readonly integrationTestOptions: IntegrationTestCommonOptions;

Options for integration tests.


IntegrationTestCommonOptions

Initializer

import { awscdk } from 'projen'

const integrationTestCommonOptions: awscdk.IntegrationTestCommonOptions = { ... }

Properties

NameTypeDescription
destroyAfterDeploy
booleanDestroy the test app after a successful deployment.
pathMetadata
booleanEnables path metadata, adding aws:cdk:path, with the defining construct's path, to the CloudFormation metadata for each synthesized resource.

destroyAfterDeployOptional
public readonly destroyAfterDeploy: boolean;
  • Type: boolean
  • Default: true

Destroy the test app after a successful deployment.

If disabled, leaves the app deployed in the dev account.


pathMetadataOptional
public readonly pathMetadata: boolean;
  • Type: boolean
  • Default: false

Enables path metadata, adding aws:cdk:path, with the defining construct's path, to the CloudFormation metadata for each synthesized resource.


IntegrationTestOptions

Options for IntegrationTest.

Initializer

import { awscdk } from 'projen'

const integrationTestOptions: awscdk.IntegrationTestOptions = { ... }

Properties

NameTypeDescription
destroyAfterDeploy
booleanDestroy the test app after a successful deployment.
pathMetadata
booleanEnables path metadata, adding aws:cdk:path, with the defining construct's path, to the CloudFormation metadata for each synthesized resource.
entrypoint
stringA path from the project root directory to a TypeScript file which contains the integration test app.
tsconfigPath
stringThe path of the tsconfig.json file to use when running integration test cdk apps.
name
stringName of the integration test.
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
stacks
string[]A list of stacks within the integration test to deploy/destroy.

destroyAfterDeployOptional
public readonly destroyAfterDeploy: boolean;
  • Type: boolean
  • Default: true

Destroy the test app after a successful deployment.

If disabled, leaves the app deployed in the dev account.


pathMetadataOptional
public readonly pathMetadata: boolean;
  • Type: boolean
  • Default: false

Enables path metadata, adding aws:cdk:path, with the defining construct's path, to the CloudFormation metadata for each synthesized resource.


entrypointRequired
public readonly entrypoint: string;
  • Type: string

A path from the project root directory to a TypeScript file which contains the integration test app.

This is relative to the root directory of the project.


Example

"test/subdir/foo.integ.ts"
tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

The path of the tsconfig.json file to use when running integration test cdk apps.


nameOptional
public readonly name: string;
  • Type: string
  • Default: Derived from the entrypoint filename.

Name of the integration test.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


stacksOptional
public readonly stacks: string[];
  • Type: string[]
  • Default: ["**"]

A list of stacks within the integration test to deploy/destroy.


LambdaAutoDiscoverOptions

Options for LambdaAutoDiscover.

Initializer

import { awscdk } from 'projen'

const lambdaAutoDiscoverOptions: awscdk.LambdaAutoDiscoverOptions = { ... }

Properties

NameTypeDescription
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
stringPath to the tsconfig file to use for integration tests.
srcdir
stringProject source tree (relative to project output directory).
lambdaOptions
LambdaFunctionCommonOptions
Options for AWS Lambda functions.

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

Path to the tsconfig file to use for integration tests.


srcdirRequired
public readonly srcdir: string;
  • Type: string

Project source tree (relative to project output directory).


lambdaOptionsOptional
public readonly lambdaOptions: LambdaFunctionCommonOptions;

Options for AWS Lambda functions.


LambdaExtensionAutoDiscoverOptions

Options for LambdaExtensionAutoDiscover.

Initializer

import { awscdk } from 'projen'

const lambdaExtensionAutoDiscoverOptions: awscdk.LambdaExtensionAutoDiscoverOptions = { ... }

Properties

NameTypeDescription
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
stringPath to the tsconfig file to use for integration tests.
srcdir
stringProject source tree (relative to project output directory).
lambdaExtensionOptions
LambdaExtensionCommonOptions
Options for lambda extensions.

cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


tsconfigPathRequired
public readonly tsconfigPath: string;
  • Type: string

Path to the tsconfig file to use for integration tests.


srcdirRequired
public readonly srcdir: string;
  • Type: string

Project source tree (relative to project output directory).


lambdaExtensionOptionsOptional
public readonly lambdaExtensionOptions: LambdaExtensionCommonOptions;

Options for lambda extensions.


LambdaExtensionCommonOptions

Common options for creating lambda extensions.

Initializer

import { awscdk } from 'projen'

const lambdaExtensionCommonOptions: awscdk.LambdaExtensionCommonOptions = { ... }

Properties

NameTypeDescription
bundlingOptions
projen.javascript.BundlingOptionsBundling options for this AWS Lambda extension.
compatibleRuntimes
LambdaRuntime[]
The extension's compatible runtimes.

bundlingOptionsOptional
public readonly bundlingOptions: BundlingOptions;
  • Type: projen.javascript.BundlingOptions
  • Default: defaults

Bundling options for this AWS Lambda extension.

If not specified the default bundling options specified for the project Bundler instance will be used.


compatibleRuntimesOptional
public readonly compatibleRuntimes: LambdaRuntime[];

The extension's compatible runtimes.


LambdaExtensionOptions

Options for creating lambda extensions.

Initializer

import { awscdk } from 'projen'

const lambdaExtensionOptions: awscdk.LambdaExtensionOptions = { ... }

Properties

NameTypeDescription
bundlingOptions
projen.javascript.BundlingOptionsBundling options for this AWS Lambda extension.
compatibleRuntimes
LambdaRuntime[]
The extension's compatible runtimes.
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
entrypoint
stringA path from the project root directory to a TypeScript file which contains the AWS Lambda extension entrypoint (stand-alone script).
constructFile
stringThe name of the generated TypeScript source file.
constructName
stringThe name of the generated lambda.LayerVersion subclass.
name
stringName of the extension.

bundlingOptionsOptional
public readonly bundlingOptions: BundlingOptions;
  • Type: projen.javascript.BundlingOptions
  • Default: defaults

Bundling options for this AWS Lambda extension.

If not specified the default bundling options specified for the project Bundler instance will be used.


compatibleRuntimesOptional
public readonly compatibleRuntimes: LambdaRuntime[];

The extension's compatible runtimes.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


entrypointRequired
public readonly entrypoint: string;
  • Type: string

A path from the project root directory to a TypeScript file which contains the AWS Lambda extension entrypoint (stand-alone script).

This is relative to the root directory of the project.


Example

"src/subdir/foo.lambda-extension.ts"
constructFileOptional
public readonly constructFile: string;
  • Type: string
  • Default: The name of the entrypoint file, with the -layer-version.ts suffix instead of .lambda-extension.ts.

The name of the generated TypeScript source file.

This file should also be under the source tree.


constructNameOptional
public readonly constructName: string;
  • Type: string
  • Default: A pascal cased version of the name of the entrypoint file, with the extension LayerVersion (e.g. AppConfigLayerVersion).

The name of the generated lambda.LayerVersion subclass.


nameOptional
public readonly name: string;
  • Type: string
  • Default: Derived from the entrypoint filename.

Name of the extension.


LambdaFunctionCommonOptions

Common options for LambdaFunction.

Applies to all functions in auto-discovery.

Initializer

import { awscdk } from 'projen'

const lambdaFunctionCommonOptions: awscdk.LambdaFunctionCommonOptions = { ... }

Properties

NameTypeDescription
awsSdkConnectionReuse
booleanWhether to automatically reuse TCP connections when working with the AWS SDK for JavaScript.
bundlingOptions
projen.javascript.BundlingOptionsBundling options for this AWS Lambda function.
edgeLambda
booleanWhether to create a cloudfront.experimental.EdgeFunction instead of a lambda.Function.
runtime
LambdaRuntime
The node.js version to target.

awsSdkConnectionReuseOptional
public readonly awsSdkConnectionReuse: boolean;
  • Type: boolean
  • Default: true

Whether to automatically reuse TCP connections when working with the AWS SDK for JavaScript.

This sets the AWS_NODEJS_CONNECTION_REUSE_ENABLED environment variable to 1.

Not applicable when edgeLambda is set to true because environment variables are not supported in Lambda@Edge.

https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html


bundlingOptionsOptional
public readonly bundlingOptions: BundlingOptions;
  • Type: projen.javascript.BundlingOptions
  • Default: defaults

Bundling options for this AWS Lambda function.

If not specified the default bundling options specified for the project Bundler instance will be used.


edgeLambdaOptional
public readonly edgeLambda: boolean;
  • Type: boolean
  • Default: false

Whether to create a cloudfront.experimental.EdgeFunction instead of a lambda.Function.


runtimeOptional
public readonly runtime: LambdaRuntime;

The node.js version to target.


LambdaFunctionOptions

Options for Function.

Initializer

import { awscdk } from 'projen'

const lambdaFunctionOptions: awscdk.LambdaFunctionOptions = { ... }

Properties

NameTypeDescription
awsSdkConnectionReuse
booleanWhether to automatically reuse TCP connections when working with the AWS SDK for JavaScript.
bundlingOptions
projen.javascript.BundlingOptionsBundling options for this AWS Lambda function.
edgeLambda
booleanWhether to create a cloudfront.experimental.EdgeFunction instead of a lambda.Function.
runtime
LambdaRuntime
The node.js version to target.
cdkDeps
AwsCdkDeps
AWS CDK dependency manager.
entrypoint
stringA path from the project root directory to a TypeScript file which contains the AWS Lambda handler entrypoint (exports a handler function).
constructFile
stringThe name of the generated TypeScript source file.
constructName
stringThe name of the generated lambda.Function subclass.

awsSdkConnectionReuseOptional
public readonly awsSdkConnectionReuse: boolean;
  • Type: boolean
  • Default: true

Whether to automatically reuse TCP connections when working with the AWS SDK for JavaScript.

This sets the AWS_NODEJS_CONNECTION_REUSE_ENABLED environment variable to 1.

Not applicable when edgeLambda is set to true because environment variables are not supported in Lambda@Edge.

https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html


bundlingOptionsOptional
public readonly bundlingOptions: BundlingOptions;
  • Type: projen.javascript.BundlingOptions
  • Default: defaults

Bundling options for this AWS Lambda function.

If not specified the default bundling options specified for the project Bundler instance will be used.


edgeLambdaOptional
public readonly edgeLambda: boolean;
  • Type: boolean
  • Default: false

Whether to create a cloudfront.experimental.EdgeFunction instead of a lambda.Function.


runtimeOptional
public readonly runtime: LambdaRuntime;

The node.js version to target.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;

AWS CDK dependency manager.


entrypointRequired
public readonly entrypoint: string;
  • Type: string

A path from the project root directory to a TypeScript file which contains the AWS Lambda handler entrypoint (exports a handler function).

This is relative to the root directory of the project.


Example

"src/subdir/foo.lambda.ts"
constructFileOptional
public readonly constructFile: string;
  • Type: string
  • Default: The name of the entrypoint file, with the -function.ts suffix instead of .lambda.ts.

The name of the generated TypeScript source file.

This file should also be under the source tree.


constructNameOptional
public readonly constructName: string;
  • Type: string
  • Default: A pascal cased version of the name of the entrypoint file, with the extension Function (e.g. ResizeImageFunction).

The name of the generated lambda.Function subclass.


LambdaRuntimeOptions

Options for the AWS Lambda function runtime.

Initializer

import { awscdk } from 'projen'

const lambdaRuntimeOptions: awscdk.LambdaRuntimeOptions = { ... }

Properties

NameTypeDescription
defaultExternals
string[]Packages that are considered externals by default when bundling.

defaultExternalsOptional
public readonly defaultExternals: string[];
  • Type: string[]
  • Default: ['@aws-sdk/*']

Packages that are considered externals by default when bundling.


Classes

LambdaRuntime

The runtime for the AWS Lambda function.

Initializers

import { awscdk } from 'projen'

new awscdk.LambdaRuntime(functionRuntime: string, esbuildTarget: string, options?: LambdaRuntimeOptions)
NameTypeDescription
functionRuntime
stringThe Node.js runtime to use.
esbuildTarget
stringThe esbuild setting to use.
options
LambdaRuntimeOptions
Options for this runtime.

functionRuntimeRequired
  • Type: string

The Node.js runtime to use.


esbuildTargetRequired
  • Type: string

The esbuild setting to use.


optionsOptional

Options for this runtime.


Properties

NameTypeDescription
defaultExternals
string[]No description.
esbuildPlatform
stringNo description.
esbuildTarget
stringThe esbuild setting to use.
functionRuntime
stringThe Node.js runtime to use.

defaultExternalsRequired
public readonly defaultExternals: string[];
  • Type: string[]

esbuildPlatformRequired
public readonly esbuildPlatform: string;
  • Type: string

esbuildTargetRequired
public readonly esbuildTarget: string;
  • Type: string

The esbuild setting to use.


functionRuntimeRequired
public readonly functionRuntime: string;
  • Type: string

The Node.js runtime to use.


Constants

NameTypeDescription
NODEJS_10_X
LambdaRuntime
Node.js 10.x.
NODEJS_12_X
LambdaRuntime
Node.js 12.x.
NODEJS_14_X
LambdaRuntime
Node.js 14.x.
NODEJS_16_X
LambdaRuntime
Node.js 16.x.
NODEJS_18_X
LambdaRuntime
Node.js 18.x.
NODEJS_20_X
LambdaRuntime
Node.js 20.x.

NODEJS_10_XRequired
  • Deprecated: NodeJS10 has been deprecated on February 14, 2022
public readonly NODEJS_10_X: LambdaRuntime;

Node.js 10.x.


NODEJS_12_XRequired
  • Deprecated: NodeJS12 has been deprecated on April 30, 2023
public readonly NODEJS_12_X: LambdaRuntime;

Node.js 12.x.


NODEJS_14_XRequired
  • Deprecated: NodeJS14 will be deprecated on November 27, 2023
public readonly NODEJS_14_X: LambdaRuntime;

Node.js 14.x.


NODEJS_16_XRequired
  • Deprecated: NodeJS16 will be deprecated on March 11, 2024
public readonly NODEJS_16_X: LambdaRuntime;

Node.js 16.x.


NODEJS_18_XRequired
public readonly NODEJS_18_X: LambdaRuntime;

Node.js 18.x.


NODEJS_20_XRequired
public readonly NODEJS_20_X: LambdaRuntime;

Node.js 20.x.


Enums

ApprovalLevel

Which approval is required when deploying CDK apps.

Members

NameDescription
NEVER
Approval is never required.
ANY_CHANGE
Requires approval on any IAM or security-group-related change.
BROADENING
Requires approval when IAM statements or traffic rules are added;

NEVER

Approval is never required.


ANY_CHANGE

Requires approval on any IAM or security-group-related change.


BROADENING

Requires approval when IAM statements or traffic rules are added;

removals don't require approval