Interface ServerlessProjectOptions

Hierarchy

  • AwsCdkTypeScriptAppOptions
    • ServerlessProjectOptions

Properties

allowLibraryDependencies? appEntrypoint? artifactsDirectory? authorEmail? authorName? authorOrganization? authorUrl? autoApproveOptions? autoApproveUpgrades? autoDetectBin? autoMerge? autoMergeOptions? bin? bugsEmail? bugsUrl? buildCommand? buildWorkflow? buildWorkflowTriggers? bundledDeps? bundlerOptions? cdkAssert? cdkAssertions? cdkDependencies? cdkDependenciesAsDeps? cdkTestDependencies? cdkVersion cdkVersionPinning? cdkout? clobber? codeArtifactOptions? codeCov? codeCovTokenSecret? commitGenerated? constructsVersion? context? copyrightOwner? copyrightPeriod? defaultReleaseBranch dependabot? dependabotOptions? deps? depsUpgrade? depsUpgradeOptions? description? devContainer? devDeps? disableTsconfig? docgen? docsDirectory? edgeLambdaAutoDiscover? entrypoint? entrypointTypes? eslint? eslintOptions? featureFlags? gitIgnoreOptions? gitOptions? github? githubOptions? gitignore? gitpod? homepage? integrationTestAutoDiscover? jest? jestOptions? jsiiReleaseVersion? keywords? lambdaAutoDiscover? lambdaExtensionAutoDiscover? lambdaOptions? libdir? license? licensed? logging? majorVersion? maxNodeVersion? mergify? mergifyOptions? minMajorVersion? minNodeVersion? mutableBuild? name npmAccess? npmDistTag? npmIgnoreOptions? npmRegistry? npmRegistryUrl? npmTokenSecret? npmignore? npmignoreEnabled? outdir? package? packageManager? packageName? parent? peerDependencyOptions? peerDeps? pnpmVersion? postBuildSteps? prerelease? prettier? prettierOptions? projectType? projenCommand? projenCredentials? projenDevDependency? projenTokenSecret? projenVersion? projenrcJs? projenrcJsOptions? projenrcJson? projenrcJsonOptions? projenrcTs? projenrcTsOptions? publishDryRun? publishTasks? pullRequestTemplate? pullRequestTemplateContents? readme? release? releaseBranches? releaseEveryCommit? releaseFailureIssue? releaseFailureIssueLabel? releaseSchedule? releaseTagPrefix? releaseToNpm? releaseTrigger? releaseWorkflow? releaseWorkflowName? releaseWorkflowSetupSteps? renovatebot? renovatebotOptions? repository? repositoryDirectory? requireApproval? sampleCode? scopedPackagesOptions? scripts? srcdir? stability? stale? staleOptions? testdir? tsconfig? tsconfigDev? tsconfigDevFile? typescriptVersion? versionrcOptions? vscode? watchExcludes? watchIncludes? workflowBootstrapSteps? workflowContainerImage? workflowGitIdentity? workflowNodeVersion? workflowRunsOn?

Properties

allowLibraryDependencies?: boolean

Allow the project to include peerDependencies and bundledDependencies. This is normally only allowed for libraries. For apps, there's no meaning for specifying these.

Default

true

appEntrypoint?: string

The CDK app's entrypoint (relative to the source directory, which is "src" by default).

Default

"main.ts"

artifactsDirectory?: string

A directory which will contain build artifacts.

Default

"dist"

authorEmail?: string

Author's e-mail

authorName?: string

Author's name

authorOrganization?: boolean

Is the author an organization

authorUrl?: string

Author's URL / Website

autoApproveOptions?: AutoApproveOptions

Enable and configure the 'auto approve' workflow.

Default

  • auto approve is disabled
autoApproveUpgrades?: boolean

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

Throw if set to true but autoApproveOptions are not defined.

Default

  • true
autoDetectBin?: boolean

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

Default

true

autoMerge?: boolean

Enable automatic merging on GitHub. Has no effect if github.mergify is set to false.

Default

true

autoMergeOptions?: AutoMergeOptions

Configure options for automatic merging on GitHub. Has no effect if github.mergify or autoMerge is set to false.

Default

  • see defaults in AutoMergeOptions
bin?: Record<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.

bugsEmail?: string

The email address to which issues should be reported.

bugsUrl?: string

The url to your project's issue tracker.

buildCommand?: string

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.

Default

  • no build command
buildWorkflow?: boolean

Define a GitHub workflow for building PRs.

Default

  • true if not a subproject
buildWorkflowTriggers?: Triggers

Build workflow triggers

Default

"{ pullRequest: {}, workflowDispatch: {} }"

bundledDeps?: 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.

bundlerOptions?: BundlerOptions

Options for Bundler.

cdkAssert?: boolean

Warning: NodeJS only. Install the @aws-cdk/assert library?

Default

  • will be included by default for AWS CDK >= 1.0.0 < 2.0.0

Deprecated

The @aws-cdk/assert library is deprecated in favor of @aws-cdk/assertions (in V1) and included in aws-cdk-lib for V2.

cdkAssertions?: boolean

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'

Default

  • will be included by default for AWS CDK >= 1.111.0 < 2.0.0
cdkDependencies?: string[]

Which AWS CDKv1 modules this project requires

Deprecated

For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)

cdkDependenciesAsDeps?: boolean

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

Default

true

Deprecated

Not supported in CDK v2.

cdkTestDependencies?: string[]

AWS CDK modules required for testing.

Deprecated

For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead

cdkVersion: string

Minimum version of the AWS CDK to depend on.

Default

"2.1.0"

cdkVersionPinning?: 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.

cdkout?: string

cdk.out directory.

Default

"cdk.out"

clobber?: boolean

Add a clobber task which resets the repo to origin.

Default

  • true, but false for subprojects
codeArtifactOptions?: CodeArtifactOptions

Options for npm packages using AWS CodeArtifact. This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact

Default

  • undefined
codeCov?: boolean

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

Code Cov Token Secret

Default

false

codeCovTokenSecret?: string

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

Default

  • if this option is not specified, only public repositories are supported
commitGenerated?: boolean

Whether to commit the managed files by default.

Default

true

constructsVersion?: string

Minimum version of the constructs library to depend on.

Default

  • for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".
context?: {
    [key: string]: any;
}

Additional context to include in cdk.json.

Default

  • no additional context

Type declaration

  • [key: string]: any
copyrightOwner?: string

License copyright owner.

Default

  • defaults to the value of authorName or "" if authorName is undefined.
copyrightPeriod?: string

The copyright years to put in the LICENSE file.

Default

  • current year
defaultReleaseBranch: string

The name of the main release branch.

Default

"main"

dependabot?: boolean

Use dependabot to handle dependency upgrades. Cannot be used in conjunction with depsUpgrade.

Default

false

dependabotOptions?: DependabotOptions

Options for dependabot.

Default

  • default options
deps?: string[]

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' ]

Default

[]

Featured

depsUpgrade?: boolean

Use github workflows to handle dependency upgrades. Cannot be used in conjunction with dependabot.

Default

true

depsUpgradeOptions?: UpgradeDependenciesOptions

Options for UpgradeDependencies.

Default

  • default options
description?: 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

Featured

devContainer?: boolean

Add a VSCode development environment (used for GitHub Codespaces)

Default

false

devDeps?: string[]

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' ]

Default

[]

Featured

disableTsconfig?: boolean

Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).

Default

false

docgen?: boolean

Docgen by Typedoc

Default

false

docsDirectory?: string

Docs directory

Default

"docs"

edgeLambdaAutoDiscover?: boolean

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.

Default

true

entrypoint?: string

Module entrypoint (main in package.json)

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

Default

"lib/index.js"

entrypointTypes?: string

The .d.ts file that includes the type declarations for this module.

Default

  • .d.ts file derived from the project's entrypoint (usually lib/index.d.ts)
eslint?: boolean

Setup eslint.

Default

true

eslintOptions?: EslintOptions

Eslint options

Default

  • opinionated default options
featureFlags?: boolean

Include all feature flags in cdk.json

Default

true

gitIgnoreOptions?: IgnoreFileOptions

Configuration options for .gitignore file

gitOptions?: GitOptions

Configuration options for git

github?: boolean

Enable GitHub integration.

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

Default

true

githubOptions?: GitHubOptions

Options for GitHub integration

Default

  • see GitHubOptions
gitignore?: string[]

Additional entries to .gitignore

gitpod?: boolean

Add a Gitpod development environment

Default

false

homepage?: string

Package's Homepage / Website

integrationTestAutoDiscover?: boolean

Automatically discovers and creates integration tests for each .integ.ts file in under your test directory.

Default

true

jest?: boolean

Setup jest unit tests

Default

true

jestOptions?: JestOptions

Jest options

Default

  • default options
jsiiReleaseVersion?: string

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

Default

"latest"

keywords?: string[]

Keywords to include in package.json.

lambdaAutoDiscover?: boolean

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.

Default

true

lambdaExtensionAutoDiscover?: boolean

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

Default

true

lambdaOptions?: LambdaFunctionCommonOptions

Common options for all AWS Lambda functions.

Default

  • default options
libdir?: string

Typescript artifacts output directory

Default

"lib"

license?: string

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.

Default

"Apache-2.0"

licensed?: boolean

Indicates if a license should be added.

Default

true

logging?: LoggerOptions

Configure logging options such as verbosity.

Default

majorVersion?: number

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.

Default

  • Major version is not enforced.
maxNodeVersion?: string

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

Default

  • no max
mergify?: boolean

Whether mergify should be enabled on this repository or not.

Default

true

Deprecated

use githubOptions.mergify instead

mergifyOptions?: MergifyOptions

Options for mergify

Default

  • default options

Deprecated

use githubOptions.mergifyOptions instead

minMajorVersion?: number

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.

Default

  • No minimum version is being enforced
minNodeVersion?: string

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

Default

  • no "engines" specified
mutableBuild?: boolean

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.

Default

true

name: string

This is the name of your project.

Default

$BASEDIR

Featured

npmAccess?: NpmAccess

Access level of the npm package.

Default

  • for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.
npmDistTag?: string

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.

Default

"latest"

npmIgnoreOptions?: IgnoreFileOptions

Configuration options for .npmignore file

npmRegistry?: string

The host name of the npm registry to publish to. Cannot be set together with npmRegistryUrl.

Deprecated

use npmRegistryUrl instead

npmRegistryUrl?: string

The base URL of the npm package registry.

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

Default

"https://registry.npmjs.org"

npmTokenSecret?: string

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

Default

"NPM_TOKEN"

npmignore?: string[]

Additional entries to .npmignore.

Deprecated

  • use project.addPackageIgnore
npmignoreEnabled?: boolean

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

Default

true

outdir?: string

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 sub-projects.

Default

"."

package?: boolean

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

Default

true

packageManager?: NodePackageManager

The Node Package Manager used to execute scripts

Default

NodePackageManager.YARN

packageName?: string

The "name" in package.json

Default

  • defaults to project name

Featured

parent?: Project

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

peerDependencyOptions?: PeerDependencyOptions

Options for peerDeps.

peerDeps?: string[]

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.

Default

[]

pnpmVersion?: string

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

Default

"7"

postBuildSteps?: JobStep[]

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

Default

[]

prerelease?: string

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

Default

  • normal semantic versions
prettier?: boolean

Setup prettier.

Default

false

prettierOptions?: PrettierOptions

Prettier options

Default

  • default options
projectType?: ProjectType

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

Default

ProjectType.UNKNOWN

Deprecated

no longer supported at the base project level

projenCommand?: string

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

Can be used to customize in special environments.

Default

"npx projen"

projenCredentials?: GithubCredentials

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

Default

  • use a personal access token named PROJEN_GITHUB_TOKEN
projenDevDependency?: boolean

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

Default

true

projenTokenSecret?: string

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.

Default

"PROJEN_GITHUB_TOKEN"

Deprecated

use projenCredentials

projenVersion?: string

Version of projen to install.

Default

  • Defaults to the latest version.
projenrcJs?: boolean

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

Default

  • true if projenrcJson is false
projenrcJsOptions?: ProjenrcOptions

Options for .projenrc.js

Default

  • default options
projenrcJson?: boolean

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

Default

false

projenrcJsonOptions?: ProjenrcJsonOptions

Options for .projenrc.json

Default

  • default options
projenrcTs?: boolean

Use TypeScript for your projenrc file (.projenrc.ts).

Default

false

projenrcTsOptions?: ProjenrcOptions

Options for .projenrc.ts

publishDryRun?: boolean

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

Default

false

publishTasks?: boolean

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.

Default

false

pullRequestTemplate?: boolean

Include a GitHub pull request template.

Default

true

pullRequestTemplateContents?: string[]

The contents of the pull request template.

Default

  • default content
readme?: SampleReadmeProps

The README setup.

Default

  • { filename: 'README.md', contents: '# replace this' }

Example

"{ filename: 'readme.md', contents: '# title' }"
release?: boolean

Add release management to this project.

Default

  • true (false for subprojects)
releaseBranches?: {
    [name: string]: BranchOptions;
}

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.

Default

  • no additional branches are used for release. you can use addBranch() to add additional branches.

Type declaration

  • [name: string]: BranchOptions
releaseEveryCommit?: boolean

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

Default

true

Deprecated

Use releaseTrigger: ReleaseTrigger.continuous() instead

releaseFailureIssue?: boolean

Create a github issue on every failed publishing task.

Default

false

releaseFailureIssueLabel?: string

The label to apply to issues indicating publish failures. Only applies if releaseFailureIssue is true.

Default

"failed-release"

releaseSchedule?: string

CRON schedule to trigger new releases.

Default

  • no scheduled releases

Deprecated

Use releaseTrigger: ReleaseTrigger.scheduled() instead

releaseTagPrefix?: string

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.

Default

"v"

releaseToNpm?: boolean

Automatically release to npm when new versions are introduced.

Default

false

releaseTrigger?: ReleaseTrigger

The release trigger to use.

Default

  • Continuous releases (ReleaseTrigger.continuous())
releaseWorkflow?: boolean

DEPRECATED: renamed to release.

Default

  • true if not a subproject

Deprecated

see release.

releaseWorkflowName?: string

The name of the default release workflow.

Default

"Release"

releaseWorkflowSetupSteps?: JobStep[]

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

renovatebot?: boolean

Use renovatebot to handle dependency upgrades.

Default

false

renovatebotOptions?: RenovatebotOptions

Options for renovatebot.

Default

  • default options
repository?: 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

repositoryDirectory?: 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.

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.

Default

ApprovalLevel.BROADENING

sampleCode?: boolean

Generate one-time sample in src/ and test/ if there are no files there.

Default

true

scopedPackagesOptions?: ScopedPackagesOptions[]

Options for privately hosted scoped packages

Default

  • fetch all scoped packages from the public npm registry
scripts?: {
    [name: string]: string;
}

npm scripts to include. If a script has the same name as a standard script, the standard script will be overwritten.

Default

Type declaration

  • [name: string]: string
srcdir?: string

Typescript sources directory.

Default

"src"

stability?: string

Package's Stability

stale?: boolean

Auto-close of stale issues and pull request. See staleOptions for options.

Default

false

staleOptions?: StaleOptions

Auto-close stale issues and pull requests. To disable set stale to false.

Default

  • see defaults in StaleOptions
testdir?: string

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.

Default

"test"

tsconfig?: TypescriptConfigOptions

Custom TSConfig

Default

  • default options
tsconfigDev?: TypescriptConfigOptions

Custom tsconfig options for the development tsconfig.json file (used for testing).

Default

  • use the production tsconfig options
tsconfigDevFile?: string

The name of the development tsconfig.json file.

Default

"tsconfig.dev.json"

typescriptVersion?: string

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).

Default

"latest"

versionrcOptions?: Record<string, any>

Custom configuration used when creating changelog with standard-version package. Given values either append to default configuration or overwrite values in it.

Default

  • standard configuration applicable for GitHub repositories
vscode?: boolean

Enable VSCode integration.

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

Default

true

watchExcludes?: string[]

Glob patterns to exclude from cdk watch.

Default

[]

watchIncludes?: string[]

Glob patterns to include in cdk watch.

Default

[]

workflowBootstrapSteps?: JobStep[]

Workflow steps to use in order to bootstrap this repo.

Default

"yarn install --frozen-lockfile && yarn projen"

workflowContainerImage?: string

Container image to use for GitHub workflows.

Default

  • default image
workflowGitIdentity?: GitIdentity

The git identity to use in workflows.

Default

  • GitHub Actions
workflowNodeVersion?: string

The node version to use in GitHub workflows.

Default

  • same as minNodeVersion
workflowRunsOn?: string[]

Github Runner selection labels

Default

["ubuntu-latest"]

Generated using TypeDoc