Skip to content

API Reference

Constructs

OpenApiAsyncDefinition

The OpenAPI Spec.

Initializers

import { OpenApiAsyncDefinition } from '@aws/pdk/type-safe-api'

new OpenApiAsyncDefinition(project: Project, options: OpenApiAsyncDefinitionOptions)
Name Type Description
project projen.Project No description.
options OpenApiAsyncDefinitionOptions No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

Name Description
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

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

isConstruct
import { OpenApiAsyncDefinition } from '@aws/pdk/type-safe-api'

OpenApiAsyncDefinition.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 { OpenApiAsyncDefinition } from '@aws/pdk/type-safe-api'

OpenApiAsyncDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
openApiSpecificationPath string Path to the root OpenAPI specification file.

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

The tree node.


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

openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the root OpenAPI specification file.


OpenApiAsyncModelProject

Project for defining an OpenAPI model for a WebSocket API.

Initializers

import { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'

new OpenApiAsyncModelProject(options: OpenApiAsyncModelProjectOptions)
Name Type Description
options OpenApiAsyncModelProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


Static Functions

Name Description
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 { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'

OpenApiAsyncModelProject.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 { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'

OpenApiAsyncModelProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
apiName string Name of the API.
definition OpenApiAsyncDefinition OpenAPI specification component.

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.


apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


definitionRequired
public readonly definition: OpenApiAsyncDefinition;

OpenAPI specification component.


Constants

Name Type Description
DEFAULT_TASK string The 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.


OpenApiDefinition

The OpenAPI Spec.

Initializers

import { OpenApiDefinition } from '@aws/pdk/type-safe-api'

new OpenApiDefinition(project: Project, options: OpenApiDefinitionOptions)
Name Type Description
project projen.Project No description.
options OpenApiDefinitionOptions No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

Name Description
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

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

isConstruct
import { OpenApiDefinition } from '@aws/pdk/type-safe-api'

OpenApiDefinition.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 { OpenApiDefinition } from '@aws/pdk/type-safe-api'

OpenApiDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
openApiSpecificationPath string Path to the root OpenAPI specification file.

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

The tree node.


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

openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the root OpenAPI specification file.


OpenApiModelProject

Project for defining an OpenAPI model for a REST API.

Initializers

import { OpenApiModelProject } from '@aws/pdk/type-safe-api'

new OpenApiModelProject(options: OpenApiModelProjectOptions)
Name Type Description
options OpenApiModelProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


Static Functions

Name Description
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 { OpenApiModelProject } from '@aws/pdk/type-safe-api'

OpenApiModelProject.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 { OpenApiModelProject } from '@aws/pdk/type-safe-api'

OpenApiModelProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { OpenApiModelProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
apiName string Name of the API.
definition OpenApiDefinition OpenAPI specification component.

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.


apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


definitionRequired
public readonly definition: OpenApiDefinition;

OpenAPI specification component.


Constants

Name Type Description
DEFAULT_TASK string The 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.


OpenApiProjectDefinition

The OpenAPI Spec.

Initializers

import { OpenApiProjectDefinition } from '@aws/pdk/type-safe-api'

new OpenApiProjectDefinition(project: Project, _options: OpenApiProjectDefinitionOptions)
Name Type Description
project projen.Project No description.
_options OpenApiProjectDefinitionOptions No description.

projectRequired
  • Type: projen.Project

_optionsRequired

Methods

Name Description
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

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

isConstruct
import { OpenApiProjectDefinition } from '@aws/pdk/type-safe-api'

OpenApiProjectDefinition.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 { OpenApiProjectDefinition } from '@aws/pdk/type-safe-api'

OpenApiProjectDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
openApiSpecificationPath string Path to the root OpenAPI specification file.

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

The tree node.


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

openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the root OpenAPI specification file.


SmithyAsyncModelProject

Smithy model project for a WebSocket API.

Initializers

import { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'

new SmithyAsyncModelProject(options: SmithyAsyncModelProjectOptions)
Name Type Description
options SmithyAsyncModelProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.
addSmithyDeps Add a dependency on other smithy projects.
smithyProjectDefinition Returns the smithy project definition.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
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 { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'

SmithyAsyncModelProject.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 { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'

SmithyAsyncModelProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
apiName string Name of the API.
definition SmithyServiceProjectDefinition Smithy model and build settings.

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.


apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


definitionRequired
public readonly definition: SmithyServiceProjectDefinition;

Smithy model and build settings.


Constants

Name Type Description
DEFAULT_TASK string The 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.


SmithyBaseProject

Base project for Smithy projects.

Initializers

import { SmithyBaseProject } from '@aws/pdk/type-safe-api'

new SmithyBaseProject(options: SmithyBaseProjectOptions)
Name Type Description
options SmithyBaseProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.
addSmithyDeps Add a dependency on other smithy projects.
smithyProjectDefinition Returns the smithy project definition.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
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 { SmithyBaseProject } from '@aws/pdk/type-safe-api'

SmithyBaseProject.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 { SmithyBaseProject } from '@aws/pdk/type-safe-api'

SmithyBaseProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { SmithyBaseProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.

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.


Constants

Name Type Description
DEFAULT_TASK string The 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.


SmithyModelProject

Smithy model project for a REST API.

Initializers

import { SmithyModelProject } from '@aws/pdk/type-safe-api'

new SmithyModelProject(options: SmithyModelProjectOptions)
Name Type Description
options SmithyModelProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.
addSmithyDeps Add a dependency on other smithy projects.
smithyProjectDefinition Returns the smithy project definition.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
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 { SmithyModelProject } from '@aws/pdk/type-safe-api'

SmithyModelProject.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 { SmithyModelProject } from '@aws/pdk/type-safe-api'

SmithyModelProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { SmithyModelProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
apiName string Name of the API.
definition SmithyServiceProjectDefinition Smithy model and build settings.

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.


apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


definitionRequired
public readonly definition: SmithyServiceProjectDefinition;

Smithy model and build settings.


Constants

Name Type Description
DEFAULT_TASK string The 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.


SmithyProjectDefinition

Definition for a Smithy project.

Initializers

import { SmithyProjectDefinition } from '@aws/pdk/type-safe-api'

new SmithyProjectDefinition(project: Project, options: SmithyProjectDefinitionOptions)
Name Type Description
project projen.Project No description.
options SmithyProjectDefinitionOptions No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

Name Description
toString Returns a string representation of this construct.
postSynthesize Called after synthesis.
preSynthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.
addDeps Add maven-style or local file dependencies to the smithy model project.
addSmithyDeps Add dependencies on other smithy models, such that their shapes can be imported in this project.
addSources Add additional paths to model source files or directories.

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.

addDeps
public addDeps(deps: string): void

Add maven-style or local file dependencies to the smithy model project.

depsRequired
  • Type: string

dependencies to add, eg "software.amazon.smithy:smithy-validation-model:1.27.2" or "file://../some/path/build/lib/my-shapes.jar.


addSmithyDeps
public addSmithyDeps(deps: SmithyProjectDefinition): void

Add dependencies on other smithy models, such that their shapes can be imported in this project.

depsRequired

smithy definitions to depend on.


addSources
public addSources(sources: string): void

Add additional paths to model source files or directories.

Paths should be relative to the project outdir. Any absolute paths will be resolved as relative paths.

sourcesRequired
  • Type: string

Static Functions

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

isConstruct
import { SmithyProjectDefinition } from '@aws/pdk/type-safe-api'

SmithyProjectDefinition.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 { SmithyProjectDefinition } from '@aws/pdk/type-safe-api'

SmithyProjectDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
gradleProjectName string Name of the gradle project.
modelDir string Directory of model source code.

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

The tree node.


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

gradleProjectNameRequired
public readonly gradleProjectName: string;
  • Type: string

Name of the gradle project.


modelDirRequired
public readonly modelDir: string;
  • Type: string

Directory of model source code.


SmithyServiceProjectDefinition

Creates a project which defines a Smithy service, and transforms the Smithy model to OpenAPI.

Initializers

import { SmithyServiceProjectDefinition } from '@aws/pdk/type-safe-api'

new SmithyServiceProjectDefinition(project: Project, options: SmithyServiceProjectDefinitionOptions)
Name Type Description
project projen.Project No description.
options SmithyServiceProjectDefinitionOptions No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

Name Description
toString Returns a string representation of this construct.
postSynthesize Called after synthesis.
preSynthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.
addDeps Add maven-style or local file dependencies to the smithy model project.
addSmithyDeps Add dependencies on other smithy models, such that their shapes can be imported in this project.
addSources Add additional paths to model source files or directories.

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.

addDeps
public addDeps(deps: string): void

Add maven-style or local file dependencies to the smithy model project.

depsRequired
  • Type: string

dependencies to add, eg "software.amazon.smithy:smithy-validation-model:1.27.2" or "file://../some/path/build/lib/my-shapes.jar.


addSmithyDeps
public addSmithyDeps(deps: SmithyProjectDefinition): void

Add dependencies on other smithy models, such that their shapes can be imported in this project.

depsRequired

smithy definitions to depend on.


addSources
public addSources(sources: string): void

Add additional paths to model source files or directories.

Paths should be relative to the project outdir. Any absolute paths will be resolved as relative paths.

sourcesRequired
  • Type: string

Static Functions

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

isConstruct
import { SmithyServiceProjectDefinition } from '@aws/pdk/type-safe-api'

SmithyServiceProjectDefinition.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 { SmithyServiceProjectDefinition } from '@aws/pdk/type-safe-api'

SmithyServiceProjectDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
gradleProjectName string Name of the gradle project.
modelDir string Directory of model source code.
generatedModelDir string Directory of generated model source code.
openApiSpecificationPath string Path to the generated OpenAPI specification, relative to the project outdir.
smithyJsonModelPath string Path to the json Smithy model, relative to the project outdir.

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

The tree node.


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

gradleProjectNameRequired
public readonly gradleProjectName: string;
  • Type: string

Name of the gradle project.


modelDirRequired
public readonly modelDir: string;
  • Type: string

Directory of model source code.


generatedModelDirRequired
public readonly generatedModelDir: string;
  • Type: string

Directory of generated model source code.


openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the generated OpenAPI specification, relative to the project outdir.


smithyJsonModelPathRequired
public readonly smithyJsonModelPath: string;
  • Type: string

Path to the json Smithy model, relative to the project outdir.


SmithyShapeLibraryProject

A project for defining a library of Smithy shapes which can be consumed by other projects.

Initializers

import { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'

new SmithyShapeLibraryProject(options: SmithyShapeLibraryProjectOptions)
Name Type Description
options SmithyShapeLibraryProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.
addSmithyDeps Add a dependency on other smithy projects.
smithyProjectDefinition Returns the smithy project definition.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
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 { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'

SmithyShapeLibraryProject.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 { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'

SmithyShapeLibraryProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
definition SmithyProjectDefinition Smithy model and build settings.

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.


definitionRequired
public readonly definition: SmithyProjectDefinition;

Smithy model and build settings.


Constants

Name Type Description
DEFAULT_TASK string The 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.


SnapStartFunction

A lambda function which enables SnapStart on published versions by default.

Initializers

import { SnapStartFunction } from '@aws/pdk/type-safe-api'

new SnapStartFunction(scope: Construct, id: string, props: SnapStartFunctionProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props SnapStartFunctionProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.
addEventSource Adds an event source to this function.
addEventSourceMapping Adds an event source that maps to this AWS Lambda function.
addFunctionUrl Adds a url to this lambda function.
addPermission Adds a permission to the Lambda resource policy.
addToRolePolicy Adds a statement to the IAM role assumed by the instance.
configureAsyncInvoke Configures options for asynchronous invocation.
considerWarningOnInvokeFunctionPermissions A warning will be added to functions under the following conditions: - permissions that include lambda:InvokeFunction are added to the unqualified function.
grantInvoke Grant the given identity permissions to invoke this Lambda.
grantInvokeCompositePrincipal Grant multiple principals the ability to invoke this Lambda via CompositePrincipal.
grantInvokeLatestVersion Grant the given identity permissions to invoke the $LATEST version or unqualified version of this Lambda.
grantInvokeUrl Grant the given identity permissions to invoke this Lambda Function URL.
grantInvokeVersion Grant the given identity permissions to invoke the given version of this Lambda.
metric Return the given named metric for this Function.
metricDuration How long execution of this Lambda takes.
metricErrors How many invocations of this Lambda fail.
metricInvocations How often this Lambda is invoked.
metricThrottles How often this Lambda is throttled.
addAlias Defines an alias for this function.
addEnvironment Adds an environment variable to this Lambda function.
addLayers Adds one or more Lambda Layers to this Lambda function.
invalidateVersionBasedOn Mix additional information into the hash of the Version object.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

addEventSource
public addEventSource(source: IEventSource): void

Adds an event source to this function.

Event sources are implemented in the aws-cdk-lib/aws-lambda-event-sources module.

The following example adds an SQS Queue as an event source:

import { SqsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';
myFunction.addEventSource(new SqsEventSource(myQueue));

sourceRequired
  • Type: aws-cdk-lib.aws_lambda.IEventSource

addEventSourceMapping
public addEventSourceMapping(id: string, options: EventSourceMappingOptions): EventSourceMapping

Adds an event source that maps to this AWS Lambda function.

idRequired
  • Type: string

optionsRequired
  • Type: aws-cdk-lib.aws_lambda.EventSourceMappingOptions

addFunctionUrl
public addFunctionUrl(options?: FunctionUrlOptions): FunctionUrl

Adds a url to this lambda function.

optionsOptional
  • Type: aws-cdk-lib.aws_lambda.FunctionUrlOptions

addPermission
public addPermission(id: string, permission: Permission): void

Adds a permission to the Lambda resource policy.

Permission for details.

idRequired
  • Type: string

The id for the permission construct.


permissionRequired
  • Type: aws-cdk-lib.aws_lambda.Permission

The permission to grant to this Lambda function.


addToRolePolicy
public addToRolePolicy(statement: PolicyStatement): void

Adds a statement to the IAM role assumed by the instance.

statementRequired
  • Type: aws-cdk-lib.aws_iam.PolicyStatement

configureAsyncInvoke
public configureAsyncInvoke(options: EventInvokeConfigOptions): void

Configures options for asynchronous invocation.

optionsRequired
  • Type: aws-cdk-lib.aws_lambda.EventInvokeConfigOptions

considerWarningOnInvokeFunctionPermissions
public considerWarningOnInvokeFunctionPermissions(scope: Construct, action: string): void

A warning will be added to functions under the following conditions: - permissions that include lambda:InvokeFunction are added to the unqualified function.

function.currentVersion is invoked before or after the permission is created.

This applies only to permissions on Lambda functions, not versions or aliases. This function is overridden as a noOp for QualifiedFunctionBase.

scopeRequired
  • Type: constructs.Construct

actionRequired
  • Type: string

grantInvoke
public grantInvoke(grantee: IGrantable): Grant

Grant the given identity permissions to invoke this Lambda.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

grantInvokeCompositePrincipal
public grantInvokeCompositePrincipal(compositePrincipal: CompositePrincipal): Grant[]

Grant multiple principals the ability to invoke this Lambda via CompositePrincipal.

compositePrincipalRequired
  • Type: aws-cdk-lib.aws_iam.CompositePrincipal

grantInvokeLatestVersion
public grantInvokeLatestVersion(grantee: IGrantable): Grant

Grant the given identity permissions to invoke the $LATEST version or unqualified version of this Lambda.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

grantInvokeUrl
public grantInvokeUrl(grantee: IGrantable): Grant

Grant the given identity permissions to invoke this Lambda Function URL.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

grantInvokeVersion
public grantInvokeVersion(grantee: IGrantable, version: IVersion): Grant

Grant the given identity permissions to invoke the given version of this Lambda.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

versionRequired
  • Type: aws-cdk-lib.aws_lambda.IVersion

metric
public metric(metricName: string, props?: MetricOptions): Metric

Return the given named metric for this Function.

metricNameRequired
  • Type: string

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricDuration
public metricDuration(props?: MetricOptions): Metric

How long execution of this Lambda takes.

Average over 5 minutes

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricErrors
public metricErrors(props?: MetricOptions): Metric

How many invocations of this Lambda fail.

Sum over 5 minutes

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricInvocations
public metricInvocations(props?: MetricOptions): Metric

How often this Lambda is invoked.

Sum over 5 minutes

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricThrottles
public metricThrottles(props?: MetricOptions): Metric

How often this Lambda is throttled.

Sum over 5 minutes

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

addAlias
public addAlias(aliasName: string, options?: AliasOptions): Alias

Defines an alias for this function.

The alias will automatically be updated to point to the latest version of the function as it is being updated during a deployment.

declare const fn: lambda.Function;

fn.addAlias('Live');

// Is equivalent to

new lambda.Alias(this, 'AliasLive', {
  aliasName: 'Live',
  version: fn.currentVersion,
});
aliasNameRequired
  • Type: string

The name of the alias.


optionsOptional
  • Type: aws-cdk-lib.aws_lambda.AliasOptions

Alias options.


addEnvironment
public addEnvironment(key: string, value: string, options?: EnvironmentOptions): Function

Adds an environment variable to this Lambda function.

If this is a ref to a Lambda function, this operation results in a no-op.

keyRequired
  • Type: string

The environment variable key.


valueRequired
  • Type: string

The environment variable's value.


optionsOptional
  • Type: aws-cdk-lib.aws_lambda.EnvironmentOptions

Environment variable options.


addLayers
public addLayers(layers: ILayerVersion): void

Adds one or more Lambda Layers to this Lambda function.

layersRequired
  • Type: aws-cdk-lib.aws_lambda.ILayerVersion

the layers to be added.


invalidateVersionBasedOn
public invalidateVersionBasedOn(x: string): void

Mix additional information into the hash of the Version object.

The Lambda Function construct does its best to automatically create a new Version when anything about the Function changes (its code, its layers, any of the other properties).

However, you can sometimes source information from places that the CDK cannot look into, like the deploy-time values of SSM parameters. In those cases, the CDK would not force the creation of a new Version object when it actually should.

This method can be used to invalidate the current Version object. Pass in any string into this method, and make sure the string changes when you know a new Version needs to be created.

This method may be called more than once.

xRequired
  • Type: string

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.
classifyVersionProperty Record whether specific properties in the AWS::Lambda::Function resource should also be associated to the Version resource.
fromFunctionArn Import a lambda function into the CDK using its ARN.
fromFunctionAttributes Creates a Lambda function object which represents a function not defined within this stack.
fromFunctionName Import a lambda function into the CDK using its name.
metricAll Return the given named metric for this Lambda.
metricAllConcurrentExecutions Metric for the number of concurrent executions across all Lambdas.
metricAllDuration Metric for the Duration executing all Lambdas.
metricAllErrors Metric for the number of Errors executing all Lambdas.
metricAllInvocations Metric for the number of invocations of all Lambdas.
metricAllThrottles Metric for the number of throttled invocations of all Lambdas.
metricAllUnreservedConcurrentExecutions Metric for the number of unreserved concurrent executions across all Lambdas.

isConstruct
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

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


isOwnedResource
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

classifyVersionProperty
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.classifyVersionProperty(propertyName: string, locked: boolean)

Record whether specific properties in the AWS::Lambda::Function resource should also be associated to the Version resource.

See 'currentVersion' section in the module README for more details.

propertyNameRequired
  • Type: string

The property to classify.


lockedRequired
  • Type: boolean

whether the property should be associated to the version or not.


fromFunctionArn
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.fromFunctionArn(scope: Construct, id: string, functionArn: string)

Import a lambda function into the CDK using its ARN.

For Function.addPermissions() to work on this imported lambda, make sure that is in the same account and region as the stack you are importing it into.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

functionArnRequired
  • Type: string

fromFunctionAttributes
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.fromFunctionAttributes(scope: Construct, id: string, attrs: FunctionAttributes)

Creates a Lambda function object which represents a function not defined within this stack.

For Function.addPermissions() to work on this imported lambda, set the sameEnvironment property to true if this imported lambda is in the same account and region as the stack you are importing it into.

scopeRequired
  • Type: constructs.Construct

The parent construct.


idRequired
  • Type: string

The name of the lambda construct.


attrsRequired
  • Type: aws-cdk-lib.aws_lambda.FunctionAttributes

the attributes of the function to import.


fromFunctionName
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.fromFunctionName(scope: Construct, id: string, functionName: string)

Import a lambda function into the CDK using its name.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

functionNameRequired
  • Type: string

metricAll
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAll(metricName: string, props?: MetricOptions)

Return the given named metric for this Lambda.

metricNameRequired
  • Type: string

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricAllConcurrentExecutions
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAllConcurrentExecutions(props?: MetricOptions)

Metric for the number of concurrent executions across all Lambdas.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricAllDuration
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAllDuration(props?: MetricOptions)

Metric for the Duration executing all Lambdas.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricAllErrors
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAllErrors(props?: MetricOptions)

Metric for the number of Errors executing all Lambdas.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricAllInvocations
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAllInvocations(props?: MetricOptions)

Metric for the number of invocations of all Lambdas.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricAllThrottles
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAllThrottles(props?: MetricOptions)

Metric for the number of throttled invocations of all Lambdas.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricAllUnreservedConcurrentExecutions
import { SnapStartFunction } from '@aws/pdk/type-safe-api'

SnapStartFunction.metricAllUnreservedConcurrentExecutions(props?: MetricOptions)

Metric for the number of unreserved concurrent executions across all Lambdas.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
architecture aws-cdk-lib.aws_lambda.Architecture The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
connections aws-cdk-lib.aws_ec2.Connections Access the Connections object.
functionArn string ARN of this function.
functionName string Name of this function.
grantPrincipal aws-cdk-lib.aws_iam.IPrincipal The principal this Lambda Function is running as.
isBoundToVpc boolean Whether or not this Lambda function was bound to a VPC.
latestVersion aws-cdk-lib.aws_lambda.IVersion The $LATEST version of this function.
permissionsNode constructs.Node The construct node where permissions are attached.
resourceArnsForGrantInvoke string[] The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
role aws-cdk-lib.aws_iam.IRole Execution role associated with this function.
currentVersion aws-cdk-lib.aws_lambda.Version Returns a lambda.Version which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes.
logGroup aws-cdk-lib.aws_logs.ILogGroup The LogGroup where the Lambda function's logs are made available.
runtime aws-cdk-lib.aws_lambda.Runtime The runtime configured for this lambda.
deadLetterQueue aws-cdk-lib.aws_sqs.IQueue The DLQ (as queue) associated with this Lambda Function (this is an optional attribute).
deadLetterTopic aws-cdk-lib.aws_sns.ITopic The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).
timeout aws-cdk-lib.Duration The timeout configured for this lambda.

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

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


architectureRequired
public readonly architecture: Architecture;
  • Type: aws-cdk-lib.aws_lambda.Architecture

The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).


connectionsRequired
public readonly connections: Connections;
  • Type: aws-cdk-lib.aws_ec2.Connections

Access the Connections object.

Will fail if not a VPC-enabled Lambda Function


functionArnRequired
public readonly functionArn: string;
  • Type: string

ARN of this function.


functionNameRequired
public readonly functionName: string;
  • Type: string

Name of this function.


grantPrincipalRequired
public readonly grantPrincipal: IPrincipal;
  • Type: aws-cdk-lib.aws_iam.IPrincipal

The principal this Lambda Function is running as.


isBoundToVpcRequired
public readonly isBoundToVpc: boolean;
  • Type: boolean

Whether or not this Lambda function was bound to a VPC.

If this is is false, trying to access the connections object will fail.


latestVersionRequired
public readonly latestVersion: IVersion;
  • Type: aws-cdk-lib.aws_lambda.IVersion

The $LATEST version of this function.

Note that this is reference to a non-specific AWS Lambda version, which means the function this version refers to can return different results in different invocations.

To obtain a reference to an explicit version which references the current function configuration, use lambdaFunction.currentVersion instead.


permissionsNodeRequired
public readonly permissionsNode: Node;
  • Type: constructs.Node

The construct node where permissions are attached.


resourceArnsForGrantInvokeRequired
public readonly resourceArnsForGrantInvoke: string[];
  • Type: string[]

The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().


roleOptional
public readonly role: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole

Execution role associated with this function.


currentVersionRequired
public readonly currentVersion: Version;
  • Type: aws-cdk-lib.aws_lambda.Version

Returns a lambda.Version which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes.

You can specify options for this version using the currentVersionOptions prop when initializing the lambda.Function.


logGroupRequired
public readonly logGroup: ILogGroup;
  • Type: aws-cdk-lib.aws_logs.ILogGroup

The LogGroup where the Lambda function's logs are made available.

If either logRetention is set or this property is called, a CloudFormation custom resource is added to the stack that pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention period (never expire, by default).

Further, if the log group already exists and the logRetention is not set, the custom resource will reset the log retention to never expire even if it was configured with a different value.


runtimeRequired
public readonly runtime: Runtime;
  • Type: aws-cdk-lib.aws_lambda.Runtime

The runtime configured for this lambda.


deadLetterQueueOptional
public readonly deadLetterQueue: IQueue;
  • Type: aws-cdk-lib.aws_sqs.IQueue

The DLQ (as queue) associated with this Lambda Function (this is an optional attribute).


deadLetterTopicOptional
public readonly deadLetterTopic: ITopic;
  • Type: aws-cdk-lib.aws_sns.ITopic

The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).


timeoutOptional
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration

The timeout configured for this lambda.


TypeSafeApiAsyncModelBuild

Adds a task to convert the OpenAPI specification into an AsyncAPI specification, which can be used for documentation generation.

Initializers

import { TypeSafeApiAsyncModelBuild } from '@aws/pdk/type-safe-api'

new TypeSafeApiAsyncModelBuild(project: Project, options: TypeSafeApiAsyncModelBuildOptions)
Name Type Description
project projen.Project No description.
options TypeSafeApiAsyncModelBuildOptions No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

Name Description
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

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

isConstruct
import { TypeSafeApiAsyncModelBuild } from '@aws/pdk/type-safe-api'

TypeSafeApiAsyncModelBuild.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 { TypeSafeApiAsyncModelBuild } from '@aws/pdk/type-safe-api'

TypeSafeApiAsyncModelBuild.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.

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

The tree node.


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

TypeSafeApiModelBuild

Adds the build task for parsing/bundling an OpenAPI spec ready for use by code generation projects.

Initializers

import { TypeSafeApiModelBuild } from '@aws/pdk/type-safe-api'

new TypeSafeApiModelBuild(project: Project, options: TypeSafeApiModelBuildOptions)
Name Type Description
project projen.Project No description.
options TypeSafeApiModelBuildOptions No description.

projectRequired
  • Type: projen.Project

optionsRequired

Methods

Name Description
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

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

isConstruct
import { TypeSafeApiModelBuild } from '@aws/pdk/type-safe-api'

TypeSafeApiModelBuild.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 { TypeSafeApiModelBuild } from '@aws/pdk/type-safe-api'

TypeSafeApiModelBuild.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.

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

The tree node.


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

TypeSafeApiProject

Project for a type-safe API, defined using Smithy or OpenAPI.

Generates a CDK construct to deploy your API, as well as client and server code to help build your API quickly.

Initializers

import { TypeSafeApiProject } from '@aws/pdk/type-safe-api'

new TypeSafeApiProject(options: TypeSafeApiProjectOptions)
Name Type Description
options TypeSafeApiProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


Static Functions

Name Description
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 { TypeSafeApiProject } from '@aws/pdk/type-safe-api'

TypeSafeApiProject.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 { TypeSafeApiProject } from '@aws/pdk/type-safe-api'

TypeSafeApiProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { TypeSafeApiProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
all ProjectCollections Collections of all sub-projects managed by this project.
documentation GeneratedDocumentationProjects Generated documentation projects.
handlers GeneratedCodeProjects Lambda handlers projects.
infrastructure GeneratedCodeProjects Generated infrastructure projects.
library GeneratedLibraryProjects Generated library projects.
model ModelProject Project for the api model.
runtime GeneratedCodeProjects Generated runtime projects.

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.


allRequired
public readonly all: ProjectCollections;

Collections of all sub-projects managed by this project.


documentationRequired
public readonly documentation: GeneratedDocumentationProjects;

Generated documentation projects.

Only the properties corresponding to specified documentation.formats will be defined.


handlersRequired
public readonly handlers: GeneratedCodeProjects;

Lambda handlers projects.

Only the properties corresponding to handlers.languages will be defined.


infrastructureRequired
public readonly infrastructure: GeneratedCodeProjects;

Generated infrastructure projects.

Only the property corresponding to infrastructure.language will be defined.


libraryRequired
public readonly library: GeneratedLibraryProjects;

Generated library projects.

Only the properties corresponding to specified library.libraries will be defined.


modelRequired
public readonly model: ModelProject;

Project for the api model.


runtimeRequired
public readonly runtime: GeneratedCodeProjects;

Generated runtime projects.

When runtime.languages includes the corresponding language, the project can be assumed to be defined.


Constants

Name Type Description
DEFAULT_TASK string The 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.


TypeSafeRestApi

A construct for creating an api gateway rest api based on the definition in the OpenAPI spec.

Initializers

import { TypeSafeRestApi } from '@aws/pdk/type-safe-api'

new TypeSafeRestApi(scope: Construct, id: string, props: TypeSafeRestApiProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props TypeSafeRestApiProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { TypeSafeRestApi } from '@aws/pdk/type-safe-api'

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


Properties

Name Type Description
node constructs.Node The tree node.
api aws-cdk-lib.aws_apigateway.SpecRestApi Underlying API Gateway API construct.
extendedApiSpecification any The OpenAPI specification with applied API gateway extensions.
ipSet aws-cdk-lib.aws_wafv2.CfnIPSet Reference to the IP set if created.
webAcl aws-cdk-lib.aws_wafv2.CfnWebACL Reference to the webacl, if created.
webAclAssociation aws-cdk-lib.aws_wafv2.CfnWebACLAssociation Reference to the web acl association if created.

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

The tree node.


apiRequired
public readonly api: SpecRestApi;
  • Type: aws-cdk-lib.aws_apigateway.SpecRestApi

Underlying API Gateway API construct.


extendedApiSpecificationRequired
public readonly extendedApiSpecification: any;
  • Type: any

The OpenAPI specification with applied API gateway extensions.


ipSetOptional
public readonly ipSet: CfnIPSet;
  • Type: aws-cdk-lib.aws_wafv2.CfnIPSet

Reference to the IP set if created.


webAclOptional
public readonly webAcl: CfnWebACL;
  • Type: aws-cdk-lib.aws_wafv2.CfnWebACL

Reference to the webacl, if created.


webAclAssociationOptional
public readonly webAclAssociation: CfnWebACLAssociation;
  • Type: aws-cdk-lib.aws_wafv2.CfnWebACLAssociation

Reference to the web acl association if created.


TypeSafeWebsocketApi

A construct for creating a websocket API, based on the provided spec and integrations.

Initializers

import { TypeSafeWebsocketApi } from '@aws/pdk/type-safe-api'

new TypeSafeWebsocketApi(scope: Construct, id: string, props: TypeSafeWebsocketApiProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props TypeSafeWebsocketApiProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { TypeSafeWebsocketApi } from '@aws/pdk/type-safe-api'

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


Properties

Name Type Description
node constructs.Node The tree node.
api aws-cdk-lib.aws_apigatewayv2.WebSocketApi Reference to the websocket API.
defaultStage aws-cdk-lib.aws_apigatewayv2.WebSocketStage Reference to the default deploy stage.

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

The tree node.


apiRequired
public readonly api: WebSocketApi;
  • Type: aws-cdk-lib.aws_apigatewayv2.WebSocketApi

Reference to the websocket API.


defaultStageRequired
public readonly defaultStage: WebSocketStage;
  • Type: aws-cdk-lib.aws_apigatewayv2.WebSocketStage

Reference to the default deploy stage.


TypeSafeWebSocketApiProject

Project for a Type Safe WebSocket API, defined using Smithy or OpenAPI.

Generates a CDK construct to deploy your API, as well as client and server code to help build your API quickly.

Initializers

import { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'

new TypeSafeWebSocketApiProject(options: TypeSafeWebSocketApiProjectOptions)
Name Type Description
options TypeSafeWebSocketApiProjectOptions No description.

optionsRequired

Methods

Name Description
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 Consider a set of files as "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.

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

Consider a set of files as "generated".

This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.

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


Static Functions

Name Description
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 { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'

TypeSafeWebSocketApiProject.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 { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'

TypeSafeWebSocketApiProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
all ProjectCollections Collections of all sub-projects managed by this project.
documentation GeneratedWebSocketDocumentationProjects Generated documentation projects.
handlers GeneratedCodeProjects Lambda handlers projects.
infrastructure GeneratedCodeProjects Generated infrastructure projects.
library GeneratedWebSocketLibraryProjects Generated library projects.
model WebSocketModelProject Project for the api model.
runtime GeneratedCodeProjects Generated runtime projects.

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.


allRequired
public readonly all: ProjectCollections;

Collections of all sub-projects managed by this project.


documentationRequired
public readonly documentation: GeneratedWebSocketDocumentationProjects;

Generated documentation projects.

Only the properties corresponding to specified documentation.formats will be defined.


handlersRequired
public readonly handlers: GeneratedCodeProjects;

Lambda handlers projects.

Only the properties corresponding to handlers.languages will be defined.


infrastructureRequired
public readonly infrastructure: GeneratedCodeProjects;

Generated infrastructure projects.

Only the property corresponding to infrastructure.language will be defined.


libraryRequired
public readonly library: GeneratedWebSocketLibraryProjects;

Generated library projects.

Only the properties corresponding to specified library.libraries will be defined.


modelRequired
public readonly model: WebSocketModelProject;

Project for the api model.


runtimeRequired
public readonly runtime: GeneratedCodeProjects;

Generated runtime projects.

When runtime.languages includes the corresponding language, the project can be assumed to be defined.


Constants

Name Type Description
DEFAULT_TASK string The 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.


TypeSpecAsyncDefinition

The TypeSpec model definition for an async api.

Initializers

import { TypeSpecAsyncDefinition } from '@aws/pdk/type-safe-api'

new TypeSpecAsyncDefinition(project: NodeProject, options: TypeSpecAsyncDefinitionOptions)
Name Type Description
project projen.javascript.NodeProject No description.
options TypeSpecAsyncDefinitionOptions No description.

projectRequired
  • Type: projen.javascript.NodeProject

optionsRequired

Methods

Name Description
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

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

isConstruct
import { TypeSpecAsyncDefinition } from '@aws/pdk/type-safe-api'

TypeSpecAsyncDefinition.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 { TypeSpecAsyncDefinition } from '@aws/pdk/type-safe-api'

TypeSpecAsyncDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
openApiSpecificationPath string Path to the generated OpenAPI specification.

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

The tree node.


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

openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the generated OpenAPI specification.


TypeSpecAsyncModelProject

Model project for defining a WebSocket API in TypeSpec.

Initializers

import { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'

new TypeSpecAsyncModelProject(options: TypeSpecAsyncModelProjectOptions)
Name Type Description
options TypeSpecAsyncModelProjectOptions No description.

optionsRequired

Methods

Name Description
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.

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.


Static Functions

Name Description
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 { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'

TypeSpecAsyncModelProject.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 { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'

TypeSpecAsyncModelProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
projectType projen.ProjectType No description.
autoApprove projen.github.AutoApprove Auto approve set up for this project.
devContainer projen.vscode.DevContainer Access for .devcontainer.json (used for GitHub Codespaces).
github projen.github.GitHub Access all github components.
gitpod projen.Gitpod Access for Gitpod.
vscode projen.vscode.VsCode Access all VSCode components.
allowLibraryDependencies boolean No description.
artifactsDirectory string The build output directory.
artifactsJavascriptDirectory string The location of the npm tarball after build (${artifactsDirectory}/js).
bundler projen.javascript.Bundler No description.
entrypoint string No description.
manifest any No description.
npmrc projen.javascript.NpmConfig The .npmrc file.
package projen.javascript.NodePackage API for managing the node package.
packageManager projen.javascript.NodePackageManager The package manager to use.
runScriptCommand string The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
autoMerge projen.github.AutoMerge Component that sets up mergify for merging approved pull requests.
buildWorkflow projen.build.BuildWorkflow The PR build GitHub workflow.
buildWorkflowJobId string The job ID of the build workflow.
jest projen.javascript.Jest The Jest configuration (if enabled).
maxNodeVersion string Maximum node version required by this package.
minNodeVersion string Minimum node.js version required by this package.
npmignore projen.IgnoreFile The .npmignore file.
prettier projen.javascript.Prettier No description.
publisher projen.release.Publisher Package publisher.
release projen.release.Release Release management.
upgradeWorkflow projen.javascript.UpgradeDependencies The upgrade workflow.
apiName string No description.
definition TypeSpecAsyncDefinition No 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.


~~allowLibraryDependencies~~Required
  • 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

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

~~manifest~~Required
  • 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.


~~packageManager~~Required
  • 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

~~publisher~~Optional
  • 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.


apiNameRequired
public readonly apiName: string;
  • Type: string

definitionRequired
public readonly definition: TypeSpecAsyncDefinition;

Constants

Name Type Description
DEFAULT_TASK string The 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.


TypeSpecDefinition

The TypeSpec model definition.

Initializers

import { TypeSpecDefinition } from '@aws/pdk/type-safe-api'

new TypeSpecDefinition(project: NodeProject, options: TypeSpecDefinitionOptions)
Name Type Description
project projen.javascript.NodeProject No description.
options TypeSpecDefinitionOptions No description.

projectRequired
  • Type: projen.javascript.NodeProject

optionsRequired

Methods

Name Description
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

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

isConstruct
import { TypeSpecDefinition } from '@aws/pdk/type-safe-api'

TypeSpecDefinition.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 { TypeSpecDefinition } from '@aws/pdk/type-safe-api'

TypeSpecDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
openApiSpecificationPath string Path to the generated OpenAPI specification.

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

The tree node.


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

openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the generated OpenAPI specification.


TypeSpecModelProject

Model project for defining a REST API in TypeSpec.

Initializers

import { TypeSpecModelProject } from '@aws/pdk/type-safe-api'

new TypeSpecModelProject(options: TypeSpecModelProjectOptions)
Name Type Description
options TypeSpecModelProjectOptions No description.

optionsRequired

Methods

Name Description
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.

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.


Static Functions

Name Description
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 { TypeSpecModelProject } from '@aws/pdk/type-safe-api'

TypeSpecModelProject.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 { TypeSpecModelProject } from '@aws/pdk/type-safe-api'

TypeSpecModelProject.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { TypeSpecModelProject } from '@aws/pdk/type-safe-api'

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

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
projectType projen.ProjectType No description.
autoApprove projen.github.AutoApprove Auto approve set up for this project.
devContainer projen.vscode.DevContainer Access for .devcontainer.json (used for GitHub Codespaces).
github projen.github.GitHub Access all github components.
gitpod projen.Gitpod Access for Gitpod.
vscode projen.vscode.VsCode Access all VSCode components.
allowLibraryDependencies boolean No description.
artifactsDirectory string The build output directory.
artifactsJavascriptDirectory string The location of the npm tarball after build (${artifactsDirectory}/js).
bundler projen.javascript.Bundler No description.
entrypoint string No description.
manifest any No description.
npmrc projen.javascript.NpmConfig The .npmrc file.
package projen.javascript.NodePackage API for managing the node package.
packageManager projen.javascript.NodePackageManager The package manager to use.
runScriptCommand string The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
autoMerge projen.github.AutoMerge Component that sets up mergify for merging approved pull requests.
buildWorkflow projen.build.BuildWorkflow The PR build GitHub workflow.
buildWorkflowJobId string The job ID of the build workflow.
jest projen.javascript.Jest The Jest configuration (if enabled).
maxNodeVersion string Maximum node version required by this package.
minNodeVersion string Minimum node.js version required by this package.
npmignore projen.IgnoreFile The .npmignore file.
prettier projen.javascript.Prettier No description.
publisher projen.release.Publisher Package publisher.
release projen.release.Release Release management.
upgradeWorkflow projen.javascript.UpgradeDependencies The upgrade workflow.
apiName string No description.
definition TypeSpecDefinition No 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.


~~allowLibraryDependencies~~Required
  • 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

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

~~manifest~~Required
  • 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.


~~packageManager~~Required
  • 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

~~publisher~~Optional
  • 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.


apiNameRequired
public readonly apiName: string;
  • Type: string

definitionRequired
public readonly definition: TypeSpecDefinition;

Constants

Name Type Description
DEFAULT_TASK string The 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.


TypeSpecProjectDefinition

Creates a project which allows APIs to be defined in TypeSpec.

https://typespec.io/

Initializers

import { TypeSpecProjectDefinition } from '@aws/pdk/type-safe-api'

new TypeSpecProjectDefinition(project: NodeProject, options: TypeSpecProjectDefinitionOptions)
Name Type Description
project projen.javascript.NodeProject No description.
options TypeSpecProjectDefinitionOptions No description.

projectRequired
  • Type: projen.javascript.NodeProject

optionsRequired

Methods

Name Description
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

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

isConstruct
import { TypeSpecProjectDefinition } from '@aws/pdk/type-safe-api'

TypeSpecProjectDefinition.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 { TypeSpecProjectDefinition } from '@aws/pdk/type-safe-api'

TypeSpecProjectDefinition.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
openApiSpecificationPath string Path to the generated OpenAPI specification.

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

The tree node.


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

openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the generated OpenAPI specification.


Structs

ApiGatewayIntegration

Represents an api gateway integration.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html

Initializer

import { ApiGatewayIntegration } from '@aws/pdk/type-safe-api'

const apiGatewayIntegration: ApiGatewayIntegration = { ... }

Properties

Name Type Description
cacheKeyParameters string[] A list of request parameters whose values are to be cached.
cacheNamespace string An API-specific tag group of related cached parameters.
connectionId string The ID of a VpcLink for the private integration.
connectionType string The integration connection type.
contentHandling string Request payload encoding conversion types.
credentials string For AWS IAM role-based credentials, specify the ARN of an appropriate IAM role.
httpMethod string The HTTP method used in the integration request.
passthroughBehavior string Specifies how a request payload of unmapped content type is passed through the integration request without modification.
requestParameters {[ key: string ]: string} Specifies mappings from method request parameters to integration request parameters.
requestTemplates {[ key: string ]: string} Mapping templates for a request payload of specified MIME types.
responses {[ key: string ]: ApiGatewayIntegrationResponse} Defines the method's responses and specifies desired parameter mappings or payload mappings from integration responses to method responses.
timeoutInMillis number Custom timeout between 50 and 29,000 milliseconds.
tlsConfig ApiGatewayIntegrationTlsConfig Specifies the TLS configuration for an integration.
type string The type of integration with the specified backend.
uri string The endpoint URI of the backend.

cacheKeyParametersOptional
public readonly cacheKeyParameters: string[];
  • Type: string[]

A list of request parameters whose values are to be cached.


cacheNamespaceOptional
public readonly cacheNamespace: string;
  • Type: string

An API-specific tag group of related cached parameters.


connectionIdOptional
public readonly connectionId: string;
  • Type: string

The ID of a VpcLink for the private integration.

https://docs.aws.amazon.com/apigateway/latest/api/API_VpcLink.html


connectionTypeOptional
public readonly connectionType: string;
  • Type: string

The integration connection type.

The valid value is "VPC_LINK" for private integration or "INTERNET", otherwise.


contentHandlingOptional
public readonly contentHandling: string;
  • Type: string

Request payload encoding conversion types.

Valid values are 1) CONVERT_TO_TEXT, for converting a binary payload into a base64-encoded string or converting a text payload into a utf-8-encoded string or passing through the text payload natively without modification, and 2) CONVERT_TO_BINARY, for converting a text payload into a base64-decoded blob or passing through a binary payload natively without modification.


credentialsOptional
public readonly credentials: string;
  • Type: string

For AWS IAM role-based credentials, specify the ARN of an appropriate IAM role.

If unspecified, credentials default to resource-based permissions that must be added manually to allow the API to access the resource. For more information, see Granting Permissions Using a Resource Policy.

Note: When using IAM credentials, make sure that AWS STS Regional endpoints are enabled for the Region where this API is deployed for best performance.


httpMethodOptional
public readonly httpMethod: string;
  • Type: string

The HTTP method used in the integration request.

For Lambda function invocations, the value must be POST.


passthroughBehaviorOptional
public readonly passthroughBehavior: string;
  • Type: string

Specifies how a request payload of unmapped content type is passed through the integration request without modification.

Supported values are when_no_templates, when_no_match, and never.

https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html#passthroughBehavior


requestParametersOptional
public readonly requestParameters: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Specifies mappings from method request parameters to integration request parameters.

Supported request parameters are querystring, path, header, and body.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-requestParameters.html


requestTemplatesOptional
public readonly requestTemplates: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Mapping templates for a request payload of specified MIME types.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-requestTemplates.html


responsesOptional
public readonly responses: {[ key: string ]: ApiGatewayIntegrationResponse};

Defines the method's responses and specifies desired parameter mappings or payload mappings from integration responses to method responses.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-responses.html


timeoutInMillisOptional
public readonly timeoutInMillis: number;
  • Type: number

Custom timeout between 50 and 29,000 milliseconds.

The default value is 29,000 milliseconds or 29 seconds.


tlsConfigOptional
public readonly tlsConfig: ApiGatewayIntegrationTlsConfig;

Specifies the TLS configuration for an integration.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-extensions-integration-tls-config.html


typeOptional
public readonly type: string;
  • Type: string

The type of integration with the specified backend.

https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html#type


uriOptional
public readonly uri: string;
  • Type: string

The endpoint URI of the backend.

For integrations of the aws type, this is an ARN value. For the HTTP integration, this is the URL of the HTTP endpoint including the https or http scheme.


ApiGatewayIntegrationResponse

API Gateway integration response.

https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html

Initializer

import { ApiGatewayIntegrationResponse } from '@aws/pdk/type-safe-api'

const apiGatewayIntegrationResponse: ApiGatewayIntegrationResponse = { ... }

Properties

Name Type Description
responseParameters {[ key: string ]: string} Specifies parameter mappings for the response.
responseTemplates {[ key: string ]: string} Specifies MIME type-specific mapping templates for the response’s payload.
statusCode string HTTP status code for the method response.
contentHandling string Response payload encoding conversion types.

responseParametersRequired
public readonly responseParameters: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Specifies parameter mappings for the response.


responseTemplatesRequired
public readonly responseTemplates: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Specifies MIME type-specific mapping templates for the response’s payload.


statusCodeRequired
public readonly statusCode: string;
  • Type: string

HTTP status code for the method response.


contentHandlingOptional
public readonly contentHandling: string;
  • Type: string

Response payload encoding conversion types.

Valid values are 1) CONVERT_TO_TEXT, for converting a binary payload into a base64-encoded string or converting a text payload into a utf-8-encoded string or passing through the text payload natively without modification, and 2) CONVERT_TO_BINARY, for converting a text payload into a base64-decoded blob or passing through a binary payload natively without modification.


ApiGatewayIntegrationTlsConfig

Specifies the TLS configuration for an integration.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-extensions-integration-tls-config.html

Initializer

import { ApiGatewayIntegrationTlsConfig } from '@aws/pdk/type-safe-api'

const apiGatewayIntegrationTlsConfig: ApiGatewayIntegrationTlsConfig = { ... }

Properties

Name Type Description
insecureSkipVerification boolean Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority.

insecureSkipVerificationOptional
public readonly insecureSkipVerification: boolean;
  • Type: boolean

Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority.

This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP and HTTP_PROXY integrations.


ApiKeyOptions

Options for API keys.

Initializer

import { ApiKeyOptions } from '@aws/pdk/type-safe-api'

const apiKeyOptions: ApiKeyOptions = { ... }

Properties

Name Type Description
source aws-cdk-lib.aws_apigateway.ApiKeySourceType Source type for an API key.
requiredByDefault boolean Set to true to require an API key on all operations by default.

sourceRequired
public readonly source: ApiKeySourceType;
  • Type: aws-cdk-lib.aws_apigateway.ApiKeySourceType

Source type for an API key.


requiredByDefaultOptional
public readonly requiredByDefault: boolean;
  • Type: boolean

Set to true to require an API key on all operations by default.

Only applicable when the source is HEADER.


AuthorizerProps

Properties for an authorizer.

Initializer

import { AuthorizerProps } from '@aws/pdk/type-safe-api'

const authorizerProps: AuthorizerProps = { ... }

Properties

Name Type Description
authorizationType aws-cdk-lib.aws_apigateway.AuthorizationType The type of the authorizer.
authorizerId string The unique identifier for the authorizer.
authorizationScopes string[] Scopes for the authorizer, if any.

authorizationTypeRequired
public readonly authorizationType: AuthorizationType;
  • Type: aws-cdk-lib.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

The unique identifier for the authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]

Scopes for the authorizer, if any.


CidrAllowList

Representation of a CIDR range.

Initializer

import { CidrAllowList } from '@aws/pdk/type-safe-api'

const cidrAllowList: CidrAllowList = { ... }

Properties

Name Type Description
cidrRanges string[] Specify an IPv4 address by using CIDR notation.
cidrType string Type of CIDR range.

cidrRangesRequired
public readonly cidrRanges: string[];
  • Type: string[]

Specify an IPv4 address by using CIDR notation.

For example: To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify 192.0.2.44/32 . To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .

For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .

Specify an IPv6 address by using CIDR notation. For example: To configure AWS WAF to allow, block, or count requests that originated from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128 . To configure AWS WAF to allow, block, or count requests that originated from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64 .


cidrTypeRequired
public readonly cidrType: string;
  • Type: string

Type of CIDR range.


CodeGenerationSourceOptions

Options for the source files used for code generation.

Initializer

import { CodeGenerationSourceOptions } from '@aws/pdk/type-safe-api'

const codeGenerationSourceOptions: CodeGenerationSourceOptions = { ... }

Properties

Name Type Description
specPath string Path to the OpenAPI specification.

specPathRequired
public readonly specPath: string;
  • Type: string

Path to the OpenAPI specification.


CognitoAuthorizerProps

Properties used to configure a cognito authorizer.

Initializer

import { CognitoAuthorizerProps } from '@aws/pdk/type-safe-api'

const cognitoAuthorizerProps: CognitoAuthorizerProps = { ... }

Properties

Name Type Description
authorizerId string Unique identifier for this authorizer.
userPools aws-cdk-lib.aws_cognito.IUserPool[] The Cognito user pools associated with this authorizer.
authorizationScopes string[] A list of authorization scopes configured on the method.

authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

Unique identifier for this authorizer.


userPoolsRequired
public readonly userPools: IUserPool[];
  • Type: aws-cdk-lib.aws_cognito.IUserPool[]

The Cognito user pools associated with this authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]
  • Default: []

A list of authorization scopes configured on the method.

When used as the default authorizer, these scopes will be applied to all methods without an authorizer at the integration level.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html#cfn-apigateway-method-authorizationscopes


CustomAuthorizerProps

Properties used to configure a custom authorizer.

Initializer

import { CustomAuthorizerProps } from '@aws/pdk/type-safe-api'

const customAuthorizerProps: CustomAuthorizerProps = { ... }

Properties

Name Type Description
authorizerId string Unique identifier for this authorizer.
function aws-cdk-lib.aws_lambda.IFunction The lambda function used to authorize requests.
authorizerResultTtlInSeconds number The number of seconds during which the authorizer result is cached.
identitySource string The source of the identity in an incoming request.
type CustomAuthorizerType The type of custom authorizer.

authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

Unique identifier for this authorizer.


functionRequired
public readonly function: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The lambda function used to authorize requests.


authorizerResultTtlInSecondsOptional
public readonly authorizerResultTtlInSeconds: number;
  • Type: number
  • Default: 300

The number of seconds during which the authorizer result is cached.


identitySourceOptional
public readonly identitySource: string;
  • Type: string
  • Default: "method.request.header.Authorization"

The source of the identity in an incoming request.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html#cfn-apigateway-authorizer-identitysource


typeOptional
public readonly type: CustomAuthorizerType;

The type of custom authorizer.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html#cfn-apigateway-authorizer-type


CustomIntegrationResponseSetProps

Properties for a custom integration response set.

Initializer

import { CustomIntegrationResponseSetProps } from '@aws/pdk/type-safe-api'

const customIntegrationResponseSetProps: CustomIntegrationResponseSetProps = { ... }

Properties

Name Type Description
responses {[ key: string ]: ApiGatewayIntegrationResponse} The responses to add to the integration response.

responsesOptional
public readonly responses: {[ key: string ]: ApiGatewayIntegrationResponse};

The responses to add to the integration response.


DefaultPassthroughIntegrationResponseSetProps

Options for the DefaultPassthroughIntegrationResponseSet.

Initializer

import { DefaultPassthroughIntegrationResponseSetProps } from '@aws/pdk/type-safe-api'

const defaultPassthroughIntegrationResponseSetProps: DefaultPassthroughIntegrationResponseSetProps = { ... }

Properties

Name Type Description
statusCode number Override the status code returned by the default integration response.

statusCodeOptional
public readonly statusCode: number;
  • Type: number
  • Default: 200

Override the status code returned by the default integration response.


DocumentationConfiguration

Configuration for generated documentation.

Initializer

import { DocumentationConfiguration } from '@aws/pdk/type-safe-api'

const documentationConfiguration: DocumentationConfiguration = { ... }

Properties

Name Type Description
formats DocumentationFormat[] Formats for generated documentation.
options GeneratedDocumentationOptions Options for the generated documentation projects.

formatsRequired
public readonly formats: DocumentationFormat[];

Formats for generated documentation.


optionsOptional
public readonly options: GeneratedDocumentationOptions;

Options for the generated documentation projects.

Note that only those provided for the specified formats will apply


GeneratedAsyncApiHtmlDocumentationOptions

Options for the async api html documentation project.

Initializer

import { GeneratedAsyncApiHtmlDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedAsyncApiHtmlDocumentationOptions: GeneratedAsyncApiHtmlDocumentationOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedAsyncApiMarkdownDocumentationOptions

Options for the async api markdown documentation project.

Initializer

import { GeneratedAsyncApiMarkdownDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedAsyncApiMarkdownDocumentationOptions: GeneratedAsyncApiMarkdownDocumentationOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedCodeProjects

Generated code projects.

Initializer

import { GeneratedCodeProjects } from '@aws/pdk/type-safe-api'

const generatedCodeProjects: GeneratedCodeProjects = { ... }

Properties

Name Type Description
java projen.java.JavaProject Generated java project.
python projen.python.PythonProject Generated python project.
typescript projen.typescript.TypeScriptProject Generated typescript project.

javaOptional
public readonly java: JavaProject;
  • Type: projen.java.JavaProject

Generated java project.


pythonOptional
public readonly python: PythonProject;
  • Type: projen.python.PythonProject

Generated python project.


typescriptOptional
public readonly typescript: TypeScriptProject;
  • Type: projen.typescript.TypeScriptProject

Generated typescript project.


GeneratedDocumentationOptions

Options for generated documentation projects.

Initializer

import { GeneratedDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedDocumentationOptions: GeneratedDocumentationOptions = { ... }

Properties

Name Type Description
htmlRedoc GeneratedHtmlRedocDocumentationOptions Generated html redoc documentation project options.
markdown GeneratedMarkdownDocumentationOptions Generated markdown documentation project options.
plantuml GeneratedPlantumlDocumentationOptions Generated plantuml documentation project options.

htmlRedocOptional
public readonly htmlRedoc: GeneratedHtmlRedocDocumentationOptions;

Generated html redoc documentation project options.


markdownOptional
public readonly markdown: GeneratedMarkdownDocumentationOptions;

Generated markdown documentation project options.


plantumlOptional
public readonly plantuml: GeneratedPlantumlDocumentationOptions;

Generated plantuml documentation project options.


GeneratedDocumentationProjects

Generated documentation project references.

Initializer

import { GeneratedDocumentationProjects } from '@aws/pdk/type-safe-api'

const generatedDocumentationProjects: GeneratedDocumentationProjects = { ... }

Properties

Name Type Description
htmlRedoc projen.Project Generated html redoc documentation project.
markdown projen.Project Generated markdown documentation project.
plantuml projen.Project Generated plantuml documentation project.

htmlRedocOptional
public readonly htmlRedoc: Project;
  • Type: projen.Project

Generated html redoc documentation project.


markdownOptional
public readonly markdown: Project;
  • Type: projen.Project

Generated markdown documentation project.


plantumlOptional
public readonly plantuml: Project;
  • Type: projen.Project

Generated plantuml documentation project.


GeneratedHandlersCodeOptions

Options for lambda handler projects for implementing API operations.

Initializer

import { GeneratedHandlersCodeOptions } from '@aws/pdk/type-safe-api'

const generatedHandlersCodeOptions: GeneratedHandlersCodeOptions = { ... }

Properties

Name Type Description
java GeneratedJavaHandlersOptions Options for the java handlers project.
python GeneratedPythonHandlersOptions Options for the python handlers project.
typescript GeneratedTypeScriptHandlersOptions Options for the typescript handlers project.

javaOptional
public readonly java: GeneratedJavaHandlersOptions;

Options for the java handlers project.

These override the default inferred options.


pythonOptional
public readonly python: GeneratedPythonHandlersOptions;

Options for the python handlers project.

These override the default inferred options.


typescriptOptional
public readonly typescript: GeneratedTypeScriptHandlersOptions;

Options for the typescript handlers project.

These override the default inferred options.


GeneratedHtml2DocumentationOptions

Options for the html2 documentation project.

Initializer

import { GeneratedHtml2DocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedHtml2DocumentationOptions: GeneratedHtml2DocumentationOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedHtmlRedocDocumentationOptions

Options for the html redoc documentation project.

Initializer

import { GeneratedHtmlRedocDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedHtmlRedocDocumentationOptions: GeneratedHtmlRedocDocumentationOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedInfrastructureCodeOptions

Options for generated infrastructure.

Initializer

import { GeneratedInfrastructureCodeOptions } from '@aws/pdk/type-safe-api'

const generatedInfrastructureCodeOptions: GeneratedInfrastructureCodeOptions = { ... }

Properties

Name Type Description
java GeneratedJavaInfrastructureOptions Options for the generated java infrastructure project.
python GeneratedPythonInfrastructureOptions Options for the generated python infrastructure project.
typescript GeneratedTypeScriptInfrastructureOptions Options for the generated typescript infrastructure project.

javaOptional
public readonly java: GeneratedJavaInfrastructureOptions;

Options for the generated java infrastructure project.

These override the default inferred options.


pythonOptional
public readonly python: GeneratedPythonInfrastructureOptions;

Options for the generated python infrastructure project.

These override the default inferred options.


typescriptOptional
public readonly typescript: GeneratedTypeScriptInfrastructureOptions;

Options for the generated typescript infrastructure project.

These override the default inferred options.


GeneratedJavaHandlersOptions

Options for configuring a generated java handlers project.

Initializer

import { GeneratedJavaHandlersOptions } from '@aws/pdk/type-safe-api'

const generatedJavaHandlersOptions: GeneratedJavaHandlersOptions = { ... }

Properties

Name Type Description
artifactId string The artifactId is generally the name that the project is known by.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
compileOptions projen.java.MavenCompileOptions Compile options.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description string Description of a project is always good.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
distdir string Final artifact output directory.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
groupId string This is generally unique amongst an organization or a project.
junit boolean Include junit tests.
junitOptions projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packaging string Project packaging format.
packagingOptions projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parentPom projen.java.ParentPom 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.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJava boolean Use projenrc in java.
projenrcJavaOptions projen.java.ProjenrcOptions Options related to projenrc in java.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
sampleJavaPackage string The java package to use for the code sample.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testDeps string[] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url string The URL, like the name, is not required.
version string This is the last piece of the naming puzzle.
vscode boolean Enable VSCode integration.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
runtimeVersion JavaVersion Runtime version to target for the handlers.

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


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.


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

Whether to commit the managed files by default.


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


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.


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

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


distdirOptional
public readonly distdir: string;
  • Type: string
  • Default: "dist/java"

Final artifact output directory.


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.


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.


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

Add a Gitpod development environment.


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


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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

This is the name of your project.


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.


packagingOptional
public readonly packaging: string;
  • Type: string
  • Default: "jar"

Project packaging format.


packagingOptionsOptional
public readonly packagingOptions: MavenPackagingOptions;
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


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

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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


~~projenTokenSecret~~Optional
  • 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.


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.


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.


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.


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


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.


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


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

Enable VSCode integration.

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


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


runtimeVersionOptional
public readonly runtimeVersion: JavaVersion;

Runtime version to target for the handlers.


GeneratedJavaInfrastructureOptions

Options for configuring a generated java infrastructure project.

Initializer

import { GeneratedJavaInfrastructureOptions } from '@aws/pdk/type-safe-api'

const generatedJavaInfrastructureOptions: GeneratedJavaInfrastructureOptions = { ... }

Properties

Name Type Description
artifactId string The artifactId is generally the name that the project is known by.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
compileOptions projen.java.MavenCompileOptions Compile options.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description string Description of a project is always good.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
distdir string Final artifact output directory.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
groupId string This is generally unique amongst an organization or a project.
junit boolean Include junit tests.
junitOptions projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packaging string Project packaging format.
packagingOptions projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parentPom projen.java.ParentPom 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.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJava boolean Use projenrc in java.
projenrcJavaOptions projen.java.ProjenrcOptions Options related to projenrc in java.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
sampleJavaPackage string The java package to use for the code sample.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testDeps string[] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url string The URL, like the name, is not required.
version string This is the last piece of the naming puzzle.
vscode boolean Enable VSCode integration.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
mockDataOptions MockResponseDataGenerationOptions Options for the generated mock response data.

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


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.


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

Whether to commit the managed files by default.


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


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.


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

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


distdirOptional
public readonly distdir: string;
  • Type: string
  • Default: "dist/java"

Final artifact output directory.


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.


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.


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

Add a Gitpod development environment.


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


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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

This is the name of your project.


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.


packagingOptional
public readonly packaging: string;
  • Type: string
  • Default: "jar"

Project packaging format.


packagingOptionsOptional
public readonly packagingOptions: MavenPackagingOptions;
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


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

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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


~~projenTokenSecret~~Optional
  • 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.


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.


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.


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.


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


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.


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


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

Enable VSCode integration.

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


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


mockDataOptionsOptional
public readonly mockDataOptions: MockResponseDataGenerationOptions;

Options for the generated mock response data.


GeneratedJavaRuntimeOptions

Options for configuring a generated java runtime project.

Initializer

import { GeneratedJavaRuntimeOptions } from '@aws/pdk/type-safe-api'

const generatedJavaRuntimeOptions: GeneratedJavaRuntimeOptions = { ... }

Properties

Name Type Description
artifactId string The artifactId is generally the name that the project is known by.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
compileOptions projen.java.MavenCompileOptions Compile options.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description string Description of a project is always good.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
distdir string Final artifact output directory.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
groupId string This is generally unique amongst an organization or a project.
junit boolean Include junit tests.
junitOptions projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packaging string Project packaging format.
packagingOptions projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parentPom projen.java.ParentPom 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.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJava boolean Use projenrc in java.
projenrcJavaOptions projen.java.ProjenrcOptions Options related to projenrc in java.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
sampleJavaPackage string The java package to use for the code sample.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testDeps string[] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url string The URL, like the name, is not required.
version string This is the last piece of the naming puzzle.
vscode boolean Enable VSCode integration.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

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


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.


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

Whether to commit the managed files by default.


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


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.


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

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


distdirOptional
public readonly distdir: string;
  • Type: string
  • Default: "dist/java"

Final artifact output directory.


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.


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.


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

Add a Gitpod development environment.


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


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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

This is the name of your project.


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.


packagingOptional
public readonly packaging: string;
  • Type: string
  • Default: "jar"

Project packaging format.


packagingOptionsOptional
public readonly packagingOptions: MavenPackagingOptions;
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


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

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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


~~projenTokenSecret~~Optional
  • 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.


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.


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.


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.


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


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.


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


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

Enable VSCode integration.

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


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedLibraryOptions

Options for generated libraries.

Initializer

import { GeneratedLibraryOptions } from '@aws/pdk/type-safe-api'

const generatedLibraryOptions: GeneratedLibraryOptions = { ... }

Properties

Name Type Description
typescriptReactQueryHooks GeneratedTypeScriptReactQueryHooksOptions Options for the generated typescript react-query hooks library.

typescriptReactQueryHooksOptional
public readonly typescriptReactQueryHooks: GeneratedTypeScriptReactQueryHooksOptions;

Options for the generated typescript react-query hooks library.

These override the default inferred options.


GeneratedLibraryProjects

Generated library projects.

Initializer

import { GeneratedLibraryProjects } from '@aws/pdk/type-safe-api'

const generatedLibraryProjects: GeneratedLibraryProjects = { ... }

Properties

Name Type Description
typescriptReactQueryHooks projen.typescript.TypeScriptProject Generated typescript react-query hooks project.

typescriptReactQueryHooksOptional
public readonly typescriptReactQueryHooks: TypeScriptProject;
  • Type: projen.typescript.TypeScriptProject

Generated typescript react-query hooks project.


GeneratedMarkdownDocumentationOptions

Options for the markdown documentation project.

Initializer

import { GeneratedMarkdownDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedMarkdownDocumentationOptions: GeneratedMarkdownDocumentationOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedPlantumlDocumentationOptions

Options for the plantuml documentation project.

Initializer

import { GeneratedPlantumlDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedPlantumlDocumentationOptions: GeneratedPlantumlDocumentationOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedProjectOptions

Options for a code project generated with OpenAPI Generator.

Initializer

import { GeneratedProjectOptions } from '@aws/pdk/type-safe-api'

const generatedProjectOptions: GeneratedProjectOptions = { ... }

Properties

Name Type Description
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedPythonHandlersOptions

Options for configuring a generated python handlers project.

Initializer

import { GeneratedPythonHandlersOptions } from '@aws/pdk/type-safe-api'

const generatedPythonHandlersOptions: GeneratedPythonHandlersOptions = { ... }

Properties

Name Type Description
authorEmail string Author's e-mail.
authorName string Author's name.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers string[] A list of PyPI trove classifiers that describe the project.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description string A short description of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string A URL to the website of the project.
license string License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
moduleName string Name of the python package as used in imports and filenames.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packageName string Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetryOptions projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcPythonOptions projen.python.ProjenrcOptions Options related to projenrc in python.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest boolean Include pytest tests.
pytestOptions projen.python.PytestOptions pytest options.
pythonExec string Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
setupConfig {[ key: string ]: any} Additional fields to pass in the setup() function if using setuptools.
setuptools boolean Use setuptools with a setup.py script for packaging and publishing.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
version string Version of the package.
vscode boolean Enable VSCode integration.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
architecture Architecture The architecture to target for python handlers.
runtimeVersion PythonVersion Runtime version to target for the handlers.

authorEmailOptional
public readonly authorEmail: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string
  • Default: $GIT_USER_NAME

Author's name.


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.


classifiersOptional
public readonly classifiers: string[];
  • Type: string[]

A list of PyPI trove classifiers that describe the project.


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

Add a clobber task which resets the repo to origin.


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

Whether to commit the managed files by default.


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


descriptionOptional
public readonly description: string;
  • Type: string

A short description of the package.


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

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


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


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.


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.


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

Add a Gitpod development environment.


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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


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

This is the name of your project.


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.


packageNameOptional
public readonly packageName: string;
  • Type: string

Package name.


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

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


poetryOptionsOptional
public readonly poetryOptions: PoetryPyprojectOptionsWithoutDeps;
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~projectType~~Optional
  • 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).


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.


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.


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.


projenrcPythonOptionsOptional
public readonly projenrcPythonOptions: ProjenrcOptions;
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projenTokenSecret~~Optional
  • 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.


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.


pythonExecOptional
public readonly pythonExec: string;
  • Type: string
  • Default: "python"

Path to the python executable to use.


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

The README setup.


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.


sampleOptional
public readonly sample: boolean;
  • Type: boolean
  • Default: true

Include sample code and test if the relevant directories don't exist.


setupConfigOptional
public readonly setupConfig: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Additional fields to pass in the setup() function if using setuptools.


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.


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.


versionOptional
public readonly version: string;
  • Type: string
  • Default: "0.1.0"

Version of the package.


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

Enable VSCode integration.

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


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


architectureOptional
public readonly architecture: Architecture;

The architecture to target for python handlers.

This determines the --platform argument passed to the pip install command used to build the lambda distributable.

https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-native-libraries


runtimeVersionOptional
public readonly runtimeVersion: PythonVersion;

Runtime version to target for the handlers.


GeneratedPythonInfrastructureOptions

Options for configuring a generated python infrastructure project.

Initializer

import { GeneratedPythonInfrastructureOptions } from '@aws/pdk/type-safe-api'

const generatedPythonInfrastructureOptions: GeneratedPythonInfrastructureOptions = { ... }

Properties

Name Type Description
authorEmail string Author's e-mail.
authorName string Author's name.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers string[] A list of PyPI trove classifiers that describe the project.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description string A short description of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string A URL to the website of the project.
license string License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
moduleName string Name of the python package as used in imports and filenames.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packageName string Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetryOptions projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcPythonOptions projen.python.ProjenrcOptions Options related to projenrc in python.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest boolean Include pytest tests.
pytestOptions projen.python.PytestOptions pytest options.
pythonExec string Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
setupConfig {[ key: string ]: any} Additional fields to pass in the setup() function if using setuptools.
setuptools boolean Use setuptools with a setup.py script for packaging and publishing.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
version string Version of the package.
vscode boolean Enable VSCode integration.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
mockDataOptions MockResponseDataGenerationOptions Options for the generated mock response data.

authorEmailOptional
public readonly authorEmail: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string
  • Default: $GIT_USER_NAME

Author's name.


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.


classifiersOptional
public readonly classifiers: string[];
  • Type: string[]

A list of PyPI trove classifiers that describe the project.


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

Add a clobber task which resets the repo to origin.


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

Whether to commit the managed files by default.


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


descriptionOptional
public readonly description: string;
  • Type: string

A short description of the package.


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

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


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


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.


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.


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

Add a Gitpod development environment.


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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


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

This is the name of your project.


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.


packageNameOptional
public readonly packageName: string;
  • Type: string

Package name.


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

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


poetryOptionsOptional
public readonly poetryOptions: PoetryPyprojectOptionsWithoutDeps;
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~projectType~~Optional
  • 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).


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.


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.


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.


projenrcPythonOptionsOptional
public readonly projenrcPythonOptions: ProjenrcOptions;
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projenTokenSecret~~Optional
  • 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.


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.


pythonExecOptional
public readonly pythonExec: string;
  • Type: string
  • Default: "python"

Path to the python executable to use.


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

The README setup.


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.


sampleOptional
public readonly sample: boolean;
  • Type: boolean
  • Default: true

Include sample code and test if the relevant directories don't exist.


setupConfigOptional
public readonly setupConfig: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Additional fields to pass in the setup() function if using setuptools.


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.


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.


versionOptional
public readonly version: string;
  • Type: string
  • Default: "0.1.0"

Version of the package.


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

Enable VSCode integration.

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


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


mockDataOptionsOptional
public readonly mockDataOptions: MockResponseDataGenerationOptions;

Options for the generated mock response data.


GeneratedPythonRuntimeOptions

Options for configuring a generated python runtime project.

Initializer

import { GeneratedPythonRuntimeOptions } from '@aws/pdk/type-safe-api'

const generatedPythonRuntimeOptions: GeneratedPythonRuntimeOptions = { ... }

Properties

Name Type Description
authorEmail string Author's e-mail.
authorName string Author's name.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers string[] A list of PyPI trove classifiers that describe the project.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description string A short description of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string A URL to the website of the project.
license string License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
moduleName string Name of the python package as used in imports and filenames.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packageName string Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetryOptions projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcPythonOptions projen.python.ProjenrcOptions Options related to projenrc in python.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest boolean Include pytest tests.
pytestOptions projen.python.PytestOptions pytest options.
pythonExec string Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
setupConfig {[ key: string ]: any} Additional fields to pass in the setup() function if using setuptools.
setuptools boolean Use setuptools with a setup.py script for packaging and publishing.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
version string Version of the package.
vscode boolean Enable VSCode integration.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

authorEmailOptional
public readonly authorEmail: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string
  • Default: $GIT_USER_NAME

Author's name.


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.


classifiersOptional
public readonly classifiers: string[];
  • Type: string[]

A list of PyPI trove classifiers that describe the project.


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

Add a clobber task which resets the repo to origin.


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

Whether to commit the managed files by default.


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


descriptionOptional
public readonly description: string;
  • Type: string

A short description of the package.


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

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


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


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.


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.


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

Add a Gitpod development environment.


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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


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

This is the name of your project.


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.


packageNameOptional
public readonly packageName: string;
  • Type: string

Package name.


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

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


poetryOptionsOptional
public readonly poetryOptions: PoetryPyprojectOptionsWithoutDeps;
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~projectType~~Optional
  • 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).


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.


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.


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.


projenrcPythonOptionsOptional
public readonly projenrcPythonOptions: ProjenrcOptions;
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projenTokenSecret~~Optional
  • 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.


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.


pythonExecOptional
public readonly pythonExec: string;
  • Type: string
  • Default: "python"

Path to the python executable to use.


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

The README setup.


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.


sampleOptional
public readonly sample: boolean;
  • Type: boolean
  • Default: true

Include sample code and test if the relevant directories don't exist.


setupConfigOptional
public readonly setupConfig: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Additional fields to pass in the setup() function if using setuptools.


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.


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.


versionOptional
public readonly version: string;
  • Type: string
  • Default: "0.1.0"

Version of the package.


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

Enable VSCode integration.

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


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedRuntimeCodeOptions

Options for generated runtimes.

Initializer

import { GeneratedRuntimeCodeOptions } from '@aws/pdk/type-safe-api'

const generatedRuntimeCodeOptions: GeneratedRuntimeCodeOptions = { ... }

Properties

Name Type Description
java GeneratedJavaRuntimeOptions Options for a generated java project.
python GeneratedPythonRuntimeOptions Options for a generated python project.
typescript GeneratedTypeScriptRuntimeOptions Options for a generated typescript project.

javaOptional
public readonly java: GeneratedJavaRuntimeOptions;

Options for a generated java project.

These override the default inferred options.


pythonOptional
public readonly python: GeneratedPythonRuntimeOptions;

Options for a generated python project.

These override the default inferred options.


typescriptOptional
public readonly typescript: GeneratedTypeScriptRuntimeOptions;

Options for a generated typescript project.

These override the default inferred options.


GeneratedTypeScriptHandlersOptions

Options for configuring a generated typescript handlers project.

Initializer

import { GeneratedTypeScriptHandlersOptions } from '@aws/pdk/type-safe-api'

const generatedTypeScriptHandlersOptions: GeneratedTypeScriptHandlersOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
handlerEntryPoints string[] Globs for lambda handler entry points, used by esbuild.
runtimeVersion NodeVersion Runtime version to target for the handlers.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


handlerEntryPointsOptional
public readonly handlerEntryPoints: string[];
  • Type: string[]
  • Default: src/*.ts - all files directly under the src directory

Globs for lambda handler entry points, used by esbuild.


runtimeVersionOptional
public readonly runtimeVersion: NodeVersion;

Runtime version to target for the handlers.


GeneratedTypeScriptInfrastructureOptions

Options for configuring a generated typescript infrastructure project.

Initializer

import { GeneratedTypeScriptInfrastructureOptions } from '@aws/pdk/type-safe-api'

const generatedTypeScriptInfrastructureOptions: GeneratedTypeScriptInfrastructureOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
mockDataOptions MockResponseDataGenerationOptions Options for the generated mock response data.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


mockDataOptionsOptional
public readonly mockDataOptions: MockResponseDataGenerationOptions;

Options for the generated mock response data.


GeneratedTypeScriptReactQueryHooksOptions

Options for configuring a generated typescript hooks library project.

Initializer

import { GeneratedTypeScriptReactQueryHooksOptions } from '@aws/pdk/type-safe-api'

const generatedTypeScriptReactQueryHooksOptions: GeneratedTypeScriptReactQueryHooksOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedTypeScriptRuntimeOptions

Options for configuring a generated typescript runtime project.

Initializer

import { GeneratedTypeScriptRuntimeOptions } from '@aws/pdk/type-safe-api'

const generatedTypeScriptRuntimeOptions: GeneratedTypeScriptRuntimeOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedTypeScriptWebSocketClientOptions

Options for configuring a generated typescript websocket client library project.

Initializer

import { GeneratedTypeScriptWebSocketClientOptions } from '@aws/pdk/type-safe-api'

const generatedTypeScriptWebSocketClientOptions: GeneratedTypeScriptWebSocketClientOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedTypeScriptWebSocketHooksOptions

Options for configuring a generated typescript websocket client library project.

Initializer

import { GeneratedTypeScriptWebSocketHooksOptions } from '@aws/pdk/type-safe-api'

const generatedTypeScriptWebSocketHooksOptions: GeneratedTypeScriptWebSocketHooksOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedWebSocketDocumentationOptions

Options for generated websocket documentation projects.

Initializer

import { GeneratedWebSocketDocumentationOptions } from '@aws/pdk/type-safe-api'

const generatedWebSocketDocumentationOptions: GeneratedWebSocketDocumentationOptions = { ... }

Properties

Name Type Description
html GeneratedAsyncApiHtmlDocumentationOptions Generated AsyncAPI html documentation project options.
markdown GeneratedAsyncApiMarkdownDocumentationOptions Generated AsyncAPI markdown documentation project options.

htmlOptional
public readonly html: GeneratedAsyncApiHtmlDocumentationOptions;

Generated AsyncAPI html documentation project options.


markdownOptional
public readonly markdown: GeneratedAsyncApiMarkdownDocumentationOptions;

Generated AsyncAPI markdown documentation project options.


GeneratedWebSocketDocumentationProjects

Initializer

import { GeneratedWebSocketDocumentationProjects } from '@aws/pdk/type-safe-api'

const generatedWebSocketDocumentationProjects: GeneratedWebSocketDocumentationProjects = { ... }

Properties

Name Type Description
html projen.Project Generated AsyncAPI html documentation project.
markdown projen.Project Generated AsyncAPI markdown documentation project.

htmlOptional
public readonly html: Project;
  • Type: projen.Project

Generated AsyncAPI html documentation project.


markdownOptional
public readonly markdown: Project;
  • Type: projen.Project

Generated AsyncAPI markdown documentation project.


GeneratedWebSocketLibraryOptions

Initializer

import { GeneratedWebSocketLibraryOptions } from '@aws/pdk/type-safe-api'

const generatedWebSocketLibraryOptions: GeneratedWebSocketLibraryOptions = { ... }

Properties

Name Type Description
typescriptWebSocketClient GeneratedTypeScriptWebSocketClientOptions Options for the generated typescript websocket client library.
typescriptWebSocketHooks GeneratedTypeScriptWebSocketHooksOptions Options for the generated typescript websocket hooks library.

typescriptWebSocketClientOptional
public readonly typescriptWebSocketClient: GeneratedTypeScriptWebSocketClientOptions;

Options for the generated typescript websocket client library.

These override the default inferred options.


typescriptWebSocketHooksOptional
public readonly typescriptWebSocketHooks: GeneratedTypeScriptWebSocketHooksOptions;

Options for the generated typescript websocket hooks library.

These override the default inferred options.


GeneratedWebSocketLibraryProjects

Generated websocket library projects.

Initializer

import { GeneratedWebSocketLibraryProjects } from '@aws/pdk/type-safe-api'

const generatedWebSocketLibraryProjects: GeneratedWebSocketLibraryProjects = { ... }

Properties

Name Type Description
typescriptWebSocketClient projen.typescript.TypeScriptProject Generated typescript websocket client project.
typescriptWebSocketHooks projen.typescript.TypeScriptProject Generated typescript websocket hooks project.

typescriptWebSocketClientOptional
public readonly typescriptWebSocketClient: TypeScriptProject;
  • Type: projen.typescript.TypeScriptProject

Generated typescript websocket client project.


typescriptWebSocketHooksOptional
public readonly typescriptWebSocketHooks: TypeScriptProject;
  • Type: projen.typescript.TypeScriptProject

Generated typescript websocket hooks project.


HandlersConfiguration

Configuration for generated lambda handlers.

Initializer

import { HandlersConfiguration } from '@aws/pdk/type-safe-api'

const handlersConfiguration: HandlersConfiguration = { ... }

Properties

Name Type Description
languages Language[] The languages lambda handlers are written in.
options GeneratedHandlersCodeOptions Options for the infrastructure package.

languagesRequired
public readonly languages: Language[];

The languages lambda handlers are written in.

Specify multiple languages if you wish to implement different operations as AWS Lambda functions in different languages.


optionsOptional
public readonly options: GeneratedHandlersCodeOptions;

Options for the infrastructure package.

Note that only those provided for the specified language will apply.


InfrastructureConfiguration

Configuration for generated infrastructure.

Initializer

import { InfrastructureConfiguration } from '@aws/pdk/type-safe-api'

const infrastructureConfiguration: InfrastructureConfiguration = { ... }

Properties

Name Type Description
language Language The language to generate the type-safe CDK infrastructure in.
options GeneratedInfrastructureCodeOptions Options for the infrastructure package.

languageRequired
public readonly language: Language;

The language to generate the type-safe CDK infrastructure in.


optionsOptional
public readonly options: GeneratedInfrastructureCodeOptions;

Options for the infrastructure package.

Note that only those provided for the specified language will apply.


IntegrationGrantProps

Properties for granting the API access to invoke the operation.

Initializer

import { IntegrationGrantProps } from '@aws/pdk/type-safe-api'

const integrationGrantProps: IntegrationGrantProps = { ... }

Properties

Name Type Description
method string The http method of this operation.
path string The path of this operation in the api.
contentTypes string[] Content types accepted by this operation.
api aws-cdk-lib.aws_apigateway.SpecRestApi The api to grant permissions for.
operationId string The ID of the operation for which permissions are being granted.
operationLookup {[ key: string ]: OperationDetails} Details about all operations in the API.
scope constructs.Construct The scope in which permission resources can be created.

methodRequired
public readonly method: string;
  • Type: string

The http method of this operation.


pathRequired
public readonly path: string;
  • Type: string

The path of this operation in the api.


contentTypesOptional
public readonly contentTypes: string[];
  • Type: string[]
  • Default: application/json

Content types accepted by this operation.


apiRequired
public readonly api: SpecRestApi;
  • Type: aws-cdk-lib.aws_apigateway.SpecRestApi

The api to grant permissions for.


operationIdRequired
public readonly operationId: string;
  • Type: string

The ID of the operation for which permissions are being granted.


operationLookupRequired
public readonly operationLookup: {[ key: string ]: OperationDetails};

Details about all operations in the API.


scopeRequired
public readonly scope: Construct;
  • Type: constructs.Construct

The scope in which permission resources can be created.


IntegrationRenderProps

Properties for rendering an integration into an API Gateway OpenAPI extension.

Initializer

import { IntegrationRenderProps } from '@aws/pdk/type-safe-api'

const integrationRenderProps: IntegrationRenderProps = { ... }

Properties

Name Type Description
method string The http method of this operation.
path string The path of this operation in the api.
contentTypes string[] Content types accepted by this operation.
operationId string The ID of the operation being rendered.
operationLookup {[ key: string ]: OperationDetails} Details about all operations in the API.
scope constructs.Construct The scope in which the integration is being rendered.
corsOptions SerializedCorsOptions Cross Origin Resource Sharing options for the API.

methodRequired
public readonly method: string;
  • Type: string

The http method of this operation.


pathRequired
public readonly path: string;
  • Type: string

The path of this operation in the api.


contentTypesOptional
public readonly contentTypes: string[];
  • Type: string[]
  • Default: application/json

Content types accepted by this operation.


operationIdRequired
public readonly operationId: string;
  • Type: string

The ID of the operation being rendered.


operationLookupRequired
public readonly operationLookup: {[ key: string ]: OperationDetails};

Details about all operations in the API.


scopeRequired
public readonly scope: Construct;
  • Type: constructs.Construct

The scope in which the integration is being rendered.


corsOptionsOptional
public readonly corsOptions: SerializedCorsOptions;

Cross Origin Resource Sharing options for the API.


JavaProjectOptions

JavaProjectOptions.

Initializer

import { JavaProjectOptions } from '@aws/pdk/type-safe-api'

const javaProjectOptions: JavaProjectOptions = { ... }

Properties

Name Type Description
artifactId string The artifactId is generally the name that the project is known by.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
compileOptions projen.java.MavenCompileOptions Compile options.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description string Description of a project is always good.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
distdir string Final artifact output directory.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
groupId string This is generally unique amongst an organization or a project.
junit boolean Include junit tests.
junitOptions projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packaging string Project packaging format.
packagingOptions projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parentPom projen.java.ParentPom 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.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJava boolean Use projenrc in java.
projenrcJavaOptions projen.java.ProjenrcOptions Options related to projenrc in java.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
sampleJavaPackage string The java package to use for the code sample.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testDeps string[] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url string The URL, like the name, is not required.
version string This is the last piece of the naming puzzle.
vscode boolean Enable VSCode integration.

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


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.


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

Whether to commit the managed files by default.


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


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.


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

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


distdirOptional
public readonly distdir: string;
  • Type: string
  • Default: "dist/java"

Final artifact output directory.


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.


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.


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

Add a Gitpod development environment.


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


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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

This is the name of your project.


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.


packagingOptional
public readonly packaging: string;
  • Type: string
  • Default: "jar"

Project packaging format.


packagingOptionsOptional
public readonly packagingOptions: MavenPackagingOptions;
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


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

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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


~~projenTokenSecret~~Optional
  • 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.


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.


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.


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.


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


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.


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


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

Enable VSCode integration.

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


LibraryConfiguration

Configuration for generated libraries.

Initializer

import { LibraryConfiguration } from '@aws/pdk/type-safe-api'

const libraryConfiguration: LibraryConfiguration = { ... }

Properties

Name Type Description
libraries Library[] The library to generate.
options GeneratedLibraryOptions Options for the generated library package.

librariesRequired
public readonly libraries: Library[];

The library to generate.


optionsOptional
public readonly options: GeneratedLibraryOptions;

Options for the generated library package.

Note that only options for the specified libraries will apply


ManagedRule

Initializer

import { ManagedRule } from '@aws/pdk/type-safe-api'

const managedRule: ManagedRule = { ... }

Properties

Name Type Description
name string The name of the managed rule group.
excludedRules aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ExcludedRuleProperty[] Rules in the referenced rule group whose actions are set to Count .
managedRuleGroupConfigs aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ManagedRuleGroupConfigProperty[] Additional information that's used by a managed rule group.
ruleActionOverrides aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.RuleActionOverrideProperty[] Action settings to use in the place of the rule actions that are configured inside the rule group.
scopeDownStatement aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.StatementProperty An optional nested statement that narrows the scope of the web requests that are evaluated by the managed rule group.
version string The version of the managed rule group to use.
vendor string The name of the managed rule group vendor.
vendorName string The name of the managed rule group vendor.

nameRequired
public readonly name: string;
  • Type: string

The name of the managed rule group.

You use this, along with the vendor name, to identify the rule group.


excludedRulesOptional
public readonly excludedRules: IResolvable | IResolvable | ExcludedRuleProperty[];
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ExcludedRuleProperty[]

Rules in the referenced rule group whose actions are set to Count .

Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .


managedRuleGroupConfigsOptional
public readonly managedRuleGroupConfigs: IResolvable | IResolvable | ManagedRuleGroupConfigProperty[];
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ManagedRuleGroupConfigProperty[]

Additional information that's used by a managed rule group.

Many managed rule groups don't require this. The rule groups used for intelligent threat mitigation require additional configuration:

  • Use the AWSManagedRulesACFPRuleSet configuration object to configure the account creation fraud prevention managed rule group. The configuration includes the registration and sign-up pages of your application and the locations in the account creation request payload of data, such as the user email and phone number fields.
  • Use the AWSManagedRulesATPRuleSet configuration object to configure the account takeover prevention managed rule group. The configuration includes the sign-in page of your application and the locations in the login request payload of data such as the username and password.
  • Use the AWSManagedRulesBotControlRuleSet configuration object to configure the protection level that you want the Bot Control rule group to use.

ruleActionOverridesOptional
public readonly ruleActionOverrides: IResolvable | IResolvable | RuleActionOverrideProperty[];
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.RuleActionOverrideProperty[]

Action settings to use in the place of the rule actions that are configured inside the rule group.

You specify one override for each rule whose action you want to change.

You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.


scopeDownStatementOptional
public readonly scopeDownStatement: IResolvable | StatementProperty;
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.StatementProperty

An optional nested statement that narrows the scope of the web requests that are evaluated by the managed rule group.

Requests are only evaluated by the rule group if they match the scope-down statement. You can use any nestable Statement in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.


versionOptional
public readonly version: string;
  • Type: string

The version of the managed rule group to use.

If you specify this, the version setting is fixed until you change it. If you don't specify this, AWS WAF uses the vendor's default version, and then keeps the version at the vendor's default when the vendor updates the managed rule group settings.


~~vendor~~Optional
  • Deprecated: use the vendorName property instead. This property will be removed in the next major release.
public readonly vendor: string;
  • Type: string

The name of the managed rule group vendor.

You use this, along with the rule group name, to identify the rule group.


vendorNameOptional
public readonly vendorName: string;
  • Type: string

The name of the managed rule group vendor.

You use this, along with the rule group name, to identify a rule group.

Preferred to the property vendor

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-vendorname


MethodAndPath

Structure to contain an API operation's method and path.

Initializer

import { MethodAndPath } from '@aws/pdk/type-safe-api'

const methodAndPath: MethodAndPath = { ... }

Properties

Name Type Description
method string The http method of this operation.
path string The path of this operation in the api.

methodRequired
public readonly method: string;
  • Type: string

The http method of this operation.


pathRequired
public readonly path: string;
  • Type: string

The path of this operation in the api.


MockIntegrationResponse

Properties for a mock integration response.

Initializer

import { MockIntegrationResponse } from '@aws/pdk/type-safe-api'

const mockIntegrationResponse: MockIntegrationResponse = { ... }

Properties

Name Type Description
statusCode number HTTP response status code.
body string Response body.

statusCodeRequired
public readonly statusCode: number;
  • Type: number

HTTP response status code.


bodyOptional
public readonly body: string;
  • Type: string

Response body.


MockResponseDataGenerationOptions

Options for generating mock data.

Initializer

import { MockResponseDataGenerationOptions } from '@aws/pdk/type-safe-api'

const mockResponseDataGenerationOptions: MockResponseDataGenerationOptions = { ... }

Properties

Name Type Description
disable boolean Set to true to disable generating mock data.
locale string Locale of generated data.
maxArrayLength number Maximum length of generated arrays.
seed number Seed for faker to generate data with.

disableOptional
public readonly disable: boolean;
  • Type: boolean
  • Default: false

Set to true to disable generating mock data.


localeOptional
public readonly locale: string;
  • Type: string
  • Default: en

Locale of generated data.

https://fakerjs.dev/guide/localization.html#available-locales


maxArrayLengthOptional
public readonly maxArrayLength: number;
  • Type: number
  • Default: 3

Maximum length of generated arrays.


seedOptional
public readonly seed: number;
  • Type: number
  • Default: 1337

Seed for faker to generate data with.


MockResponseGenerationOptions

Options for generating mock data.

Initializer

import { MockResponseGenerationOptions } from '@aws/pdk/type-safe-api'

const mockResponseGenerationOptions: MockResponseGenerationOptions = { ... }

Properties

Name Type Description
mockDataOptions MockResponseDataGenerationOptions Options for the generated mock response data.

mockDataOptionsOptional
public readonly mockDataOptions: MockResponseDataGenerationOptions;

Options for the generated mock response data.


ModelConfiguration

Configuration for modelling the API.

Initializer

import { ModelConfiguration } from '@aws/pdk/type-safe-api'

const modelConfiguration: ModelConfiguration = { ... }

Properties

Name Type Description
language ModelLanguage The language the API model is defined in.
options ModelOptions Options for the API model.

languageRequired
public readonly language: ModelLanguage;

The language the API model is defined in.


optionsRequired
public readonly options: ModelOptions;

Options for the API model.


ModelOptions

Options for models.

Initializer

import { ModelOptions } from '@aws/pdk/type-safe-api'

const modelOptions: ModelOptions = { ... }

Properties

Name Type Description
openapi OpenApiModelOptions Options for the OpenAPI model - required when model language is OPENAPI.
smithy SmithyModelOptions Options for the Smithy model - required when model language is SMITHY.
typeSpec TypeSpecModelOptions Options for the TypeSpec model - required when the model language is TYPESPEC.

openapiOptional
public readonly openapi: OpenApiModelOptions;

Options for the OpenAPI model - required when model language is OPENAPI.


smithyOptional
public readonly smithy: SmithyModelOptions;

Options for the Smithy model - required when model language is SMITHY.


typeSpecOptional
public readonly typeSpec: TypeSpecModelOptions;

Options for the TypeSpec model - required when the model language is TYPESPEC.


ModelProject

Model project references.

Initializer

import { ModelProject } from '@aws/pdk/type-safe-api'

const modelProject: ModelProject = { ... }

Properties

Name Type Description
apiName string Name of the API.
outdir string Directory of the model project.
parsedSpecFile string Name of the bundled OpenAPI specification file.
openapi OpenApiModelProject Reference to the OpenAPI model project.
smithy SmithyModelProject Reference to the Smithy model project.
typeSpec TypeSpecModelProject Reference to the TypeSpec model project.

apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


outdirRequired
public readonly outdir: string;
  • Type: string

Directory of the model project.


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Name of the bundled OpenAPI specification file.


openapiOptional
public readonly openapi: OpenApiModelProject;

Reference to the OpenAPI model project.

Will be defined if the model language is OpenAPI


smithyOptional
public readonly smithy: SmithyModelProject;

Reference to the Smithy model project.

Will be defined if the model language is Smithy


typeSpecOptional
public readonly typeSpec: TypeSpecModelProject;

Reference to the TypeSpec model project.

Will be defined if the model language is TypeSpec


ModelProjectDetails

Common details for API model projects.

Initializer

import { ModelProjectDetails } from '@aws/pdk/type-safe-api'

const modelProjectDetails: ModelProjectDetails = { ... }

Properties

Name Type Description
apiName string Name of the API.
outdir string Directory of the model project.
parsedSpecFile string Name of the bundled OpenAPI specification file.

apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


outdirRequired
public readonly outdir: string;
  • Type: string

Directory of the model project.


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Name of the bundled OpenAPI specification file.


OpenApiAsyncDefinitionOptions

Options for the OpenAPI Spec.

Initializer

import { OpenApiAsyncDefinitionOptions } from '@aws/pdk/type-safe-api'

const openApiAsyncDefinitionOptions: OpenApiAsyncDefinitionOptions = { ... }

Properties

Name Type Description
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

openApiOptionsRequired
public readonly openApiOptions: OpenApiModelOptions;

Options for the openapi model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


OpenApiAsyncModelProjectOptions

Options for an OpenAPI WebSocket API model.

Initializer

import { OpenApiAsyncModelProjectOptions } from '@aws/pdk/type-safe-api'

const openApiAsyncModelProjectOptions: OpenApiAsyncModelProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).
asyncApiSpecFile string Path to the generated AsyncAPI specification (relative to the project root).

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.


openApiOptionsRequired
public readonly openApiOptions: OpenApiModelOptions;

Options for the openapi model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


asyncApiSpecFileRequired
public readonly asyncApiSpecFile: string;
  • Type: string

Path to the generated AsyncAPI specification (relative to the project root).


OpenApiDefinitionOptions

Options for the OpenAPI Spec.

Initializer

import { OpenApiDefinitionOptions } from '@aws/pdk/type-safe-api'

const openApiDefinitionOptions: OpenApiDefinitionOptions = { ... }

Properties

Name Type Description
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

openApiOptionsRequired
public readonly openApiOptions: OpenApiModelOptions;

Options for the openapi model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


OpenApiModelOptions

Options for the OpenAPI model.

Initializer

import { OpenApiModelOptions } from '@aws/pdk/type-safe-api'

const openApiModelOptions: OpenApiModelOptions = { ... }

Properties

Name Type Description
title string The title in the OpenAPI specification.

titleRequired
public readonly title: string;
  • Type: string

The title in the OpenAPI specification.


OpenApiModelProjectOptions

Initializer

import { OpenApiModelProjectOptions } from '@aws/pdk/type-safe-api'

const openApiModelProjectOptions: OpenApiModelProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).

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.


openApiOptionsRequired
public readonly openApiOptions: OpenApiModelOptions;

Options for the openapi model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


OpenApiProjectDefinitionOptions

Options for the OpenAPI Spec.

Initializer

import { OpenApiProjectDefinitionOptions } from '@aws/pdk/type-safe-api'

const openApiProjectDefinitionOptions: OpenApiProjectDefinitionOptions = { ... }

Properties

Name Type Description
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

openApiOptionsRequired
public readonly openApiOptions: OpenApiModelOptions;

Options for the openapi model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


OperationDetails

Details about an API operation.

Initializer

import { OperationDetails } from '@aws/pdk/type-safe-api'

const operationDetails: OperationDetails = { ... }

Properties

Name Type Description
method string The http method of this operation.
path string The path of this operation in the api.
contentTypes string[] Content types accepted by this operation.

methodRequired
public readonly method: string;
  • Type: string

The http method of this operation.


pathRequired
public readonly path: string;
  • Type: string

The path of this operation in the api.


contentTypesOptional
public readonly contentTypes: string[];
  • Type: string[]
  • Default: application/json

Content types accepted by this operation.


PartialManagedRuleGroupStatementProperty

PartialManagedRuleGroupStatementProperty.

Initializer

import { PartialManagedRuleGroupStatementProperty } from '@aws/pdk/type-safe-api'

const partialManagedRuleGroupStatementProperty: PartialManagedRuleGroupStatementProperty = { ... }

Properties

Name Type Description
name string The name of the managed rule group.
excludedRules aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ExcludedRuleProperty[] Rules in the referenced rule group whose actions are set to Count .
managedRuleGroupConfigs aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ManagedRuleGroupConfigProperty[] Additional information that's used by a managed rule group.
ruleActionOverrides aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.RuleActionOverrideProperty[] Action settings to use in the place of the rule actions that are configured inside the rule group.
scopeDownStatement aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.StatementProperty An optional nested statement that narrows the scope of the web requests that are evaluated by the managed rule group.
version string The version of the managed rule group to use.

nameRequired
public readonly name: string;
  • Type: string

The name of the managed rule group.

You use this, along with the vendor name, to identify the rule group.


excludedRulesOptional
public readonly excludedRules: IResolvable | IResolvable | ExcludedRuleProperty[];
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ExcludedRuleProperty[]

Rules in the referenced rule group whose actions are set to Count .

Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .


managedRuleGroupConfigsOptional
public readonly managedRuleGroupConfigs: IResolvable | IResolvable | ManagedRuleGroupConfigProperty[];
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.ManagedRuleGroupConfigProperty[]

Additional information that's used by a managed rule group.

Many managed rule groups don't require this. The rule groups used for intelligent threat mitigation require additional configuration:

  • Use the AWSManagedRulesACFPRuleSet configuration object to configure the account creation fraud prevention managed rule group. The configuration includes the registration and sign-up pages of your application and the locations in the account creation request payload of data, such as the user email and phone number fields.
  • Use the AWSManagedRulesATPRuleSet configuration object to configure the account takeover prevention managed rule group. The configuration includes the sign-in page of your application and the locations in the login request payload of data such as the username and password.
  • Use the AWSManagedRulesBotControlRuleSet configuration object to configure the protection level that you want the Bot Control rule group to use.

ruleActionOverridesOptional
public readonly ruleActionOverrides: IResolvable | IResolvable | RuleActionOverrideProperty[];
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.RuleActionOverrideProperty[]

Action settings to use in the place of the rule actions that are configured inside the rule group.

You specify one override for each rule whose action you want to change.

You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.


scopeDownStatementOptional
public readonly scopeDownStatement: IResolvable | StatementProperty;
  • Type: aws-cdk-lib.IResolvable | aws-cdk-lib.aws_wafv2.CfnWebACL.StatementProperty

An optional nested statement that narrows the scope of the web requests that are evaluated by the managed rule group.

Requests are only evaluated by the rule group if they match the scope-down statement. You can use any nestable Statement in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.


versionOptional
public readonly version: string;
  • Type: string

The version of the managed rule group to use.

If you specify this, the version setting is fixed until you change it. If you don't specify this, AWS WAF uses the vendor's default version, and then keeps the version at the vendor's default when the vendor updates the managed rule group settings.


ProjectCollections

Collections of projects managed by type-safe-api.

Initializer

import { ProjectCollections } from '@aws/pdk/type-safe-api'

const projectCollections: ProjectCollections = { ... }

Properties

Name Type Description
documentation projen.Project[] Array of all documentation projects.
handlers projen.Project[] Array of all handler projects.
infrastructure projen.Project[] Array of all infrastructure projects.
libraries projen.Project[] Array of all library projects.
model projen.Project[] Array of all model projects.
projects projen.Project[] Array of all projects managed by type-safe-api.
runtimes projen.Project[] Array of all runtime projects.

documentationRequired
public readonly documentation: Project[];
  • Type: projen.Project[]

Array of all documentation projects.


handlersRequired
public readonly handlers: Project[];
  • Type: projen.Project[]

Array of all handler projects.


infrastructureRequired
public readonly infrastructure: Project[];
  • Type: projen.Project[]

Array of all infrastructure projects.


librariesRequired
public readonly libraries: Project[];
  • Type: projen.Project[]

Array of all library projects.


modelRequired
public readonly model: Project[];
  • Type: projen.Project[]

Array of all model projects.


projectsRequired
public readonly projects: Project[];
  • Type: projen.Project[]

Array of all projects managed by type-safe-api.


runtimesRequired
public readonly runtimes: Project[];
  • Type: projen.Project[]

Array of all runtime projects.


PythonProjectOptions

PythonProjectOptions.

Initializer

import { PythonProjectOptions } from '@aws/pdk/type-safe-api'

const pythonProjectOptions: PythonProjectOptions = { ... }

Properties

Name Type Description
authorEmail string Author's e-mail.
authorName string Author's name.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers string[] A list of PyPI trove classifiers that describe the project.
clobber boolean Add a clobber task which resets the repo to origin.
commitGenerated boolean Whether to commit the managed files by default.
deps string[] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description string A short description of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string A URL to the website of the project.
license string License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
moduleName string Name of the python package as used in imports and filenames.
name string This is the name of your project.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
packageName string Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetryOptions projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcPythonOptions projen.python.ProjenrcOptions Options related to projenrc in python.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest boolean Include pytest tests.
pytestOptions projen.python.PytestOptions pytest options.
pythonExec string Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
sample boolean Include sample code and test if the relevant directories don't exist.
setupConfig {[ key: string ]: any} Additional fields to pass in the setup() function if using setuptools.
setuptools boolean Use setuptools with a setup.py script for packaging and publishing.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
version string Version of the package.
vscode boolean Enable VSCode integration.

authorEmailOptional
public readonly authorEmail: string;
  • Type: string
  • Default: $GIT_USER_EMAIL

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string
  • Default: $GIT_USER_NAME

Author's name.


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.


classifiersOptional
public readonly classifiers: string[];
  • Type: string[]

A list of PyPI trove classifiers that describe the project.


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

Add a clobber task which resets the repo to origin.


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

Whether to commit the managed files by default.


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


descriptionOptional
public readonly description: string;
  • Type: string

A short description of the package.


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

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


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


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.


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.


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

Add a Gitpod development environment.


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.


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

Configure logging options such as verbosity.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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


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

This is the name of your project.


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.


packageNameOptional
public readonly packageName: string;
  • Type: string

Package name.


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

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


poetryOptionsOptional
public readonly poetryOptions: PoetryPyprojectOptionsWithoutDeps;
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~projectType~~Optional
  • 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).


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.


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.


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.


projenrcPythonOptionsOptional
public readonly projenrcPythonOptions: ProjenrcOptions;
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projenTokenSecret~~Optional
  • 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.


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.


pythonExecOptional
public readonly pythonExec: string;
  • Type: string
  • Default: "python"

Path to the python executable to use.


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

The README setup.


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.


sampleOptional
public readonly sample: boolean;
  • Type: boolean
  • Default: true

Include sample code and test if the relevant directories don't exist.


setupConfigOptional
public readonly setupConfig: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Additional fields to pass in the setup() function if using setuptools.


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.


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.


versionOptional
public readonly version: string;
  • Type: string
  • Default: "0.1.0"

Version of the package.


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

Enable VSCode integration.

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


RuntimeConfiguration

Configuration for generated runtime projects.

Initializer

import { RuntimeConfiguration } from '@aws/pdk/type-safe-api'

const runtimeConfiguration: RuntimeConfiguration = { ... }

Properties

Name Type Description
languages Language[] The languages that runtime projects will be generated in.
options GeneratedRuntimeCodeOptions Options for the generated runtimes.

languagesRequired
public readonly languages: Language[];

The languages that runtime projects will be generated in.

These projects can be used to provide type safety for both client and server projects.


optionsOptional
public readonly options: GeneratedRuntimeCodeOptions;

Options for the generated runtimes.

Note that only options provided for the specified languages will apply.


S3IntegrationProps

Options for S3Integration.

Initializer

import { S3IntegrationProps } from '@aws/pdk/type-safe-api'

const s3IntegrationProps: S3IntegrationProps = { ... }

Properties

Name Type Description
bucket aws-cdk-lib.aws_s3.IBucket The S3 bucket to be invoked on integration.
integrationResponseSet IntegrationResponseSet Override the integration response set for the S3 integration.
method string The HTTP method to use when invoking the S3 bucket.
path string The path override to use when invoking the S3 bucket.

bucketRequired
public readonly bucket: IBucket;
  • Type: aws-cdk-lib.aws_s3.IBucket

The S3 bucket to be invoked on integration.


integrationResponseSetOptional
public readonly integrationResponseSet: IntegrationResponseSet;
  • Type: IntegrationResponseSet
  • Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()

Override the integration response set for the S3 integration.


methodOptional
public readonly method: string;
  • Type: string
  • Default: integration method is used

The HTTP method to use when invoking the S3 bucket.


pathOptional
public readonly path: string;
  • Type: string
  • Default: integration path is used

The path override to use when invoking the S3 bucket.


SerializedCorsOptions

Cross-origin resource sharing options.

Initializer

import { SerializedCorsOptions } from '@aws/pdk/type-safe-api'

const serializedCorsOptions: SerializedCorsOptions = { ... }

Properties

Name Type Description
allowHeaders string[] Headers to allow.
allowMethods string[] HTTP methods to allow.
allowOrigins string[] Origins to allow.
statusCode number HTTP status code to be returned by preflight requests.

allowHeadersRequired
public readonly allowHeaders: string[];
  • Type: string[]

Headers to allow.


allowMethodsRequired
public readonly allowMethods: string[];
  • Type: string[]

HTTP methods to allow.


allowOriginsRequired
public readonly allowOrigins: string[];
  • Type: string[]

Origins to allow.


statusCodeRequired
public readonly statusCode: number;
  • Type: number

HTTP status code to be returned by preflight requests.


SmithyAsyncModelProjectOptions

Options for the Smithy WebSocket API model project.

Initializer

import { SmithyAsyncModelProjectOptions } from '@aws/pdk/type-safe-api'

const smithyAsyncModelProjectOptions: SmithyAsyncModelProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
smithyOptions SmithyModelOptions Smithy engine options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).
asyncApiSpecFile string Path to the generated AsyncAPI specification (relative to the project root).

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.


smithyOptionsRequired
public readonly smithyOptions: SmithyModelOptions;

Smithy engine options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


asyncApiSpecFileRequired
public readonly asyncApiSpecFile: string;
  • Type: string

Path to the generated AsyncAPI specification (relative to the project root).


SmithyBaseProjectOptions

Options for a Smithy project.

Initializer

import { SmithyBaseProjectOptions } from '@aws/pdk/type-safe-api'

const smithyBaseProjectOptions: SmithyBaseProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.

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.


SmithyBuildOptions

Options for the smithy build files.

Initializer

import { SmithyBuildOptions } from '@aws/pdk/type-safe-api'

const smithyBuildOptions: SmithyBuildOptions = { ... }

Properties

Name Type Description
imports string[] List of imports.
plugins {[ key: string ]: {[ key: string ]: any}} Plugins keyed by plugin id.
additionalSources string[] Paths to any additional model files or directories to be used as sources for the smithy build.
ignoreMissingPlugins boolean If a plugin can't be found, Smithy will by default fail the build.
maven SmithyMavenConfiguration Maven configuration for the Smithy build project, used to specify dependencies and repositories in the build.gradle and smithy-build.json files.
projections {[ key: string ]: SmithyProjection} Map of projections name to projection configurations https://awslabs.github.io/smithy/2.0/guides/building-models/build-config.html#projections.

importsOptional
public readonly imports: string[];
  • Type: string[]

List of imports.


pluginsOptional
public readonly plugins: {[ key: string ]: {[ key: string ]: any}};
  • Type: {[ key: string ]: {[ key: string ]: any}}

Plugins keyed by plugin id.


additionalSourcesOptional
public readonly additionalSources: string[];
  • Type: string[]

Paths to any additional model files or directories to be used as sources for the smithy build.

The src/main/smithy directory is always included. Paths must be relative to the model project directory. Absolute paths will be resolved as relative paths.


ignoreMissingPluginsOptional
public readonly ignoreMissingPlugins: boolean;
  • Type: boolean
  • Default: no ignoreMissingPlugins set in the smithy-build.json file

If a plugin can't be found, Smithy will by default fail the build.

This setting can be set to true to allow the build to progress even if a plugin can't be found on the classpath.


mavenOptional
public readonly maven: SmithyMavenConfiguration;

Maven configuration for the Smithy build project, used to specify dependencies and repositories in the build.gradle and smithy-build.json files.


projectionsOptional
public readonly projections: {[ key: string ]: SmithyProjection};

Map of projections name to projection configurations https://awslabs.github.io/smithy/2.0/guides/building-models/build-config.html#projections.


SmithyCommon

Properties common to smithy plugins and the root smithy build.

Initializer

import { SmithyCommon } from '@aws/pdk/type-safe-api'

const smithyCommon: SmithyCommon = { ... }

Properties

Name Type Description
imports string[] List of imports.
plugins {[ key: string ]: {[ key: string ]: any}} Plugins keyed by plugin id.

importsOptional
public readonly imports: string[];
  • Type: string[]

List of imports.


pluginsOptional
public readonly plugins: {[ key: string ]: {[ key: string ]: any}};
  • Type: {[ key: string ]: {[ key: string ]: any}}

Plugins keyed by plugin id.


SmithyMavenConfiguration

Configuration for smithy maven dependencies.

Initializer

import { SmithyMavenConfiguration } from '@aws/pdk/type-safe-api'

const smithyMavenConfiguration: SmithyMavenConfiguration = { ... }

Properties

Name Type Description
dependencies string[] The dependencies used in the build.gradle and smithy-build.json files eg. software.amazon.smithy:smithy-validation-model:1.28.0 The following required dependencies are always added: - software.amazon.smithy:smithy-cli:1.28.0 - software.amazon.smithy:smithy-model:1.28.0 - software.amazon.smithy:smithy-openapi:1.28.0 - software.amazon.smithy:smithy-aws-traits:1.28.0 You can however override the version of these dependencies if required.
repositoryUrls string[] The repository urls used in the build.gradle and smithy-build.json files.

dependenciesOptional
public readonly dependencies: string[];
  • Type: string[]

The dependencies used in the build.gradle and smithy-build.json files eg. software.amazon.smithy:smithy-validation-model:1.28.0 The following required dependencies are always added: - software.amazon.smithy:smithy-cli:1.28.0 - software.amazon.smithy:smithy-model:1.28.0 - software.amazon.smithy:smithy-openapi:1.28.0 - software.amazon.smithy:smithy-aws-traits:1.28.0 You can however override the version of these dependencies if required.


repositoryUrlsOptional
public readonly repositoryUrls: string[];
  • Type: string[]
  • Default: maven central and maven local

The repository urls used in the build.gradle and smithy-build.json files.


SmithyModelOptions

Options for a Smithy model.

Initializer

import { SmithyModelOptions } from '@aws/pdk/type-safe-api'

const smithyModelOptions: SmithyModelOptions = { ... }

Properties

Name Type Description
ignoreGradleWrapper boolean Set to false if you would like to check in your gradle wrapper.
ignoreSmithyBuildOutput boolean Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.
smithyBuildOptions SmithyBuildOptions Smithy build options.
serviceName SmithyServiceName Smithy service name.

ignoreGradleWrapperOptional
public readonly ignoreGradleWrapper: boolean;
  • Type: boolean
  • Default: true

Set to false if you would like to check in your gradle wrapper.

Do so if you would like to use a different version of gradle to the one provided by default


ignoreSmithyBuildOutputOptional
public readonly ignoreSmithyBuildOutput: boolean;
  • Type: boolean
  • Default: true

Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.


smithyBuildOptionsOptional
public readonly smithyBuildOptions: SmithyBuildOptions;

Smithy build options.


serviceNameRequired
public readonly serviceName: SmithyServiceName;

Smithy service name.


SmithyModelProjectOptions

Options for the Smithy REST API model.

Initializer

import { SmithyModelProjectOptions } from '@aws/pdk/type-safe-api'

const smithyModelProjectOptions: SmithyModelProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
smithyOptions SmithyModelOptions Smithy engine options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).

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.


smithyOptionsRequired
public readonly smithyOptions: SmithyModelOptions;

Smithy engine options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


SmithyProjectDefinitionOptions

Options for a smithy project definition.

Initializer

import { SmithyProjectDefinitionOptions } from '@aws/pdk/type-safe-api'

const smithyProjectDefinitionOptions: SmithyProjectDefinitionOptions = { ... }

Properties

Name Type Description
ignoreGradleWrapper boolean Set to false if you would like to check in your gradle wrapper.
ignoreSmithyBuildOutput boolean Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.
smithyBuildOptions SmithyBuildOptions Smithy build options.

ignoreGradleWrapperOptional
public readonly ignoreGradleWrapper: boolean;
  • Type: boolean
  • Default: true

Set to false if you would like to check in your gradle wrapper.

Do so if you would like to use a different version of gradle to the one provided by default


ignoreSmithyBuildOutputOptional
public readonly ignoreSmithyBuildOutput: boolean;
  • Type: boolean
  • Default: true

Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.


smithyBuildOptionsOptional
public readonly smithyBuildOptions: SmithyBuildOptions;

Smithy build options.


SmithyProjection

A smithy build projection.

Initializer

import { SmithyProjection } from '@aws/pdk/type-safe-api'

const smithyProjection: SmithyProjection = { ... }

Properties

Name Type Description
imports string[] List of imports.
plugins {[ key: string ]: {[ key: string ]: any}} Plugins keyed by plugin id.
abstract boolean Whether or not the projection is abstract.
transforms SmithyTransform[] Transforms to apply to the projection.

importsOptional
public readonly imports: string[];
  • Type: string[]

List of imports.


pluginsOptional
public readonly plugins: {[ key: string ]: {[ key: string ]: any}};
  • Type: {[ key: string ]: {[ key: string ]: any}}

Plugins keyed by plugin id.


abstractOptional
public readonly abstract: boolean;
  • Type: boolean

Whether or not the projection is abstract.


transformsOptional
public readonly transforms: SmithyTransform[];

Transforms to apply to the projection.


SmithyServiceName

Represents a fully qualified name of a Smithy service.

https://awslabs.github.io/smithy/2.0/spec/service-types.html

Initializer

import { SmithyServiceName } from '@aws/pdk/type-safe-api'

const smithyServiceName: SmithyServiceName = { ... }

Properties

Name Type Description
namespace string The service namespace.
serviceName string The service name.

namespaceRequired
public readonly namespace: string;
  • Type: string

The service namespace.

Nested namespaces are separated by '.', for example com.company

https://awslabs.github.io/smithy/2.0/spec/model.html#shape-id


serviceNameRequired
public readonly serviceName: string;
  • Type: string

The service name.

Should be PascalCase, for example HelloService

https://awslabs.github.io/smithy/2.0/spec/model.html#shape-id


SmithyServiceProjectDefinitionOptions

Options for a smithy service project definition.

Initializer

import { SmithyServiceProjectDefinitionOptions } from '@aws/pdk/type-safe-api'

const smithyServiceProjectDefinitionOptions: SmithyServiceProjectDefinitionOptions = { ... }

Properties

Name Type Description
smithyOptions SmithyModelOptions Smithy engine options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

smithyOptionsRequired
public readonly smithyOptions: SmithyModelOptions;

Smithy engine options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


SmithyShapeLibraryProjectOptions

Options for the Smithy shape library.

Initializer

import { SmithyShapeLibraryProjectOptions } from '@aws/pdk/type-safe-api'

const smithyShapeLibraryProjectOptions: SmithyShapeLibraryProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
ignoreGradleWrapper boolean Set to false if you would like to check in your gradle wrapper.
ignoreSmithyBuildOutput boolean Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.
smithyBuildOptions SmithyBuildOptions Smithy build options.

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.


ignoreGradleWrapperOptional
public readonly ignoreGradleWrapper: boolean;
  • Type: boolean
  • Default: true

Set to false if you would like to check in your gradle wrapper.

Do so if you would like to use a different version of gradle to the one provided by default


ignoreSmithyBuildOutputOptional
public readonly ignoreSmithyBuildOutput: boolean;
  • Type: boolean
  • Default: true

Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.


smithyBuildOptionsOptional
public readonly smithyBuildOptions: SmithyBuildOptions;

Smithy build options.


SmithyTransform

A smithy build transform.

Initializer

import { SmithyTransform } from '@aws/pdk/type-safe-api'

const smithyTransform: SmithyTransform = { ... }

Properties

Name Type Description
args {[ key: string ]: any} Arguments for the transform.
name string Name of the transform.

argsRequired
public readonly args: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Arguments for the transform.


nameRequired
public readonly name: string;
  • Type: string

Name of the transform.


SnapStartFunctionProps

Options for the SnapStartFunction construct.

Initializer

import { SnapStartFunctionProps } from '@aws/pdk/type-safe-api'

const snapStartFunctionProps: SnapStartFunctionProps = { ... }

Properties

Name Type Description
maxEventAge aws-cdk-lib.Duration The maximum age of a request that Lambda sends to a function for processing.
onFailure aws-cdk-lib.aws_lambda.IDestination The destination for failed invocations.
onSuccess aws-cdk-lib.aws_lambda.IDestination The destination for successful invocations.
retryAttempts number The maximum number of times to retry when the function returns an error.
adotInstrumentation aws-cdk-lib.aws_lambda.AdotInstrumentationConfig Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
allowAllIpv6Outbound boolean Whether to allow the Lambda to send all ipv6 network traffic.
allowAllOutbound boolean Whether to allow the Lambda to send all network traffic (except ipv6).
allowPublicSubnet boolean Lambda Functions in a public subnet can NOT access the internet.
applicationLogLevel string Sets the application log level for the function.
applicationLogLevelV2 aws-cdk-lib.aws_lambda.ApplicationLogLevel Sets the application log level for the function.
architecture aws-cdk-lib.aws_lambda.Architecture The system architectures compatible with this lambda function.
codeSigningConfig aws-cdk-lib.aws_lambda.ICodeSigningConfig Code signing config associated with this function.
currentVersionOptions aws-cdk-lib.aws_lambda.VersionOptions Options for the lambda.Version resource automatically created by the fn.currentVersion method.
deadLetterQueue aws-cdk-lib.aws_sqs.IQueue The SQS queue to use if DLQ is enabled.
deadLetterQueueEnabled boolean Enabled DLQ.
deadLetterTopic aws-cdk-lib.aws_sns.ITopic The SNS topic to use as a DLQ.
description string A description of the function.
environment {[ key: string ]: string} Key-value pairs that Lambda caches and makes available for your Lambda functions.
environmentEncryption aws-cdk-lib.aws_kms.IKey The AWS KMS key that's used to encrypt your function's environment variables.
ephemeralStorageSize aws-cdk-lib.Size The size of the function’s /tmp directory in MiB.
events aws-cdk-lib.aws_lambda.IEventSource[] Event sources for this function.
filesystem aws-cdk-lib.aws_lambda.FileSystem The filesystem configuration for the lambda function.
functionName string A name for the function.
initialPolicy aws-cdk-lib.aws_iam.PolicyStatement[] Initial policy statements to add to the created Lambda Role.
insightsVersion aws-cdk-lib.aws_lambda.LambdaInsightsVersion Specify the version of CloudWatch Lambda insights to use for monitoring.
ipv6AllowedForDualStack boolean Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
layers aws-cdk-lib.aws_lambda.ILayerVersion[] A list of layers to add to the function's execution environment.
logFormat string Sets the logFormat for the function.
loggingFormat aws-cdk-lib.aws_lambda.LoggingFormat Sets the loggingFormat for the function.
logGroup aws-cdk-lib.aws_logs.ILogGroup The log group the function sends logs to.
logRetention aws-cdk-lib.aws_logs.RetentionDays The number of days log events are kept in CloudWatch Logs.
logRetentionRetryOptions aws-cdk-lib.aws_lambda.LogRetentionRetryOptions When log retention is specified, a custom resource attempts to create the CloudWatch log group.
logRetentionRole aws-cdk-lib.aws_iam.IRole The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
memorySize number The amount of memory, in MB, that is allocated to your Lambda function.
paramsAndSecrets aws-cdk-lib.aws_lambda.ParamsAndSecretsLayerVersion Specify the configuration of Parameters and Secrets Extension.
profiling boolean Enable profiling.
profilingGroup aws-cdk-lib.aws_codeguruprofiler.IProfilingGroup Profiling Group.
recursiveLoop aws-cdk-lib.aws_lambda.RecursiveLoop Sets the Recursive Loop Protection for Lambda Function.
reservedConcurrentExecutions number The maximum of concurrent executions you want to reserve for the function.
role aws-cdk-lib.aws_iam.IRole Lambda execution role.
runtimeManagementMode aws-cdk-lib.aws_lambda.RuntimeManagementMode Sets the runtime management configuration for a function's version.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] The list of security groups to associate with the Lambda's network interfaces.
snapStart aws-cdk-lib.aws_lambda.SnapStartConf Enable SnapStart for Lambda Function.
systemLogLevel string Sets the system log level for the function.
systemLogLevelV2 aws-cdk-lib.aws_lambda.SystemLogLevel Sets the system log level for the function.
timeout aws-cdk-lib.Duration The function execution time (in seconds) after which Lambda terminates the function.
tracing aws-cdk-lib.aws_lambda.Tracing Enable AWS X-Ray Tracing for Lambda Function.
vpc aws-cdk-lib.aws_ec2.IVpc VPC network to place Lambda network interfaces.
vpcSubnets aws-cdk-lib.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
code aws-cdk-lib.aws_lambda.Code The source code of your Lambda function.
handler string The name of the method within your code that Lambda calls to execute your function.
runtime aws-cdk-lib.aws_lambda.Runtime The runtime environment for the Lambda function that you are uploading.
disableSnapStart boolean When true, disable snap start.

maxEventAgeOptional
public readonly maxEventAge: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.hours(6)

The maximum age of a request that Lambda sends to a function for processing.

Minimum: 60 seconds Maximum: 6 hours


onFailureOptional
public readonly onFailure: IDestination;
  • Type: aws-cdk-lib.aws_lambda.IDestination
  • Default: no destination

The destination for failed invocations.


onSuccessOptional
public readonly onSuccess: IDestination;
  • Type: aws-cdk-lib.aws_lambda.IDestination
  • Default: no destination

The destination for successful invocations.


retryAttemptsOptional
public readonly retryAttempts: number;
  • Type: number
  • Default: 2

The maximum number of times to retry when the function returns an error.

Minimum: 0 Maximum: 2


adotInstrumentationOptional
public readonly adotInstrumentation: AdotInstrumentationConfig;
  • Type: aws-cdk-lib.aws_lambda.AdotInstrumentationConfig
  • Default: No ADOT instrumentation

Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.

https://aws-otel.github.io/docs/getting-started/lambda


allowAllIpv6OutboundOptional
public readonly allowAllIpv6Outbound: boolean;
  • Type: boolean
  • Default: false

Whether to allow the Lambda to send all ipv6 network traffic.

If set to true, there will only be a single egress rule which allows all outbound ipv6 traffic. If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets using ipv6.

Do not specify this property if the securityGroups or securityGroup property is set. Instead, configure allowAllIpv6Outbound directly on the security group.


allowAllOutboundOptional
public readonly allowAllOutbound: boolean;
  • Type: boolean
  • Default: true

Whether to allow the Lambda to send all network traffic (except ipv6).

If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.

Do not specify this property if the securityGroups or securityGroup property is set. Instead, configure allowAllOutbound directly on the security group.


allowPublicSubnetOptional
public readonly allowPublicSubnet: boolean;
  • Type: boolean
  • Default: false

Lambda Functions in a public subnet can NOT access the internet.

Use this property to acknowledge this limitation and still place the function in a public subnet.

https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841


~~applicationLogLevel~~Optional
  • Deprecated: Use applicationLogLevelV2 as a property instead.
public readonly applicationLogLevel: string;
  • Type: string
  • Default: "INFO"

Sets the application log level for the function.


applicationLogLevelV2Optional
public readonly applicationLogLevelV2: ApplicationLogLevel;
  • Type: aws-cdk-lib.aws_lambda.ApplicationLogLevel
  • Default: ApplicationLogLevel.INFO

Sets the application log level for the function.


architectureOptional
public readonly architecture: Architecture;
  • Type: aws-cdk-lib.aws_lambda.Architecture
  • Default: Architecture.X86_64

The system architectures compatible with this lambda function.


codeSigningConfigOptional
public readonly codeSigningConfig: ICodeSigningConfig;
  • Type: aws-cdk-lib.aws_lambda.ICodeSigningConfig
  • Default: Not Sign the Code

Code signing config associated with this function.


currentVersionOptionsOptional
public readonly currentVersionOptions: VersionOptions;
  • Type: aws-cdk-lib.aws_lambda.VersionOptions
  • Default: default options as described in VersionOptions

Options for the lambda.Version resource automatically created by the fn.currentVersion method.


deadLetterQueueOptional
public readonly deadLetterQueue: IQueue;
  • Type: aws-cdk-lib.aws_sqs.IQueue
  • Default: SQS queue with 14 day retention period if deadLetterQueueEnabled is true

The SQS queue to use if DLQ is enabled.

If SNS topic is desired, specify deadLetterTopic property instead.


deadLetterQueueEnabledOptional
public readonly deadLetterQueueEnabled: boolean;
  • Type: boolean
  • Default: false unless deadLetterQueue is set, which implies DLQ is enabled.

Enabled DLQ.

If deadLetterQueue is undefined, an SQS queue with default options will be defined for your Function.


deadLetterTopicOptional
public readonly deadLetterTopic: ITopic;
  • Type: aws-cdk-lib.aws_sns.ITopic
  • Default: no SNS topic

The SNS topic to use as a DLQ.

Note that if deadLetterQueueEnabled is set to true, an SQS queue will be created rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: No description.

A description of the function.


environmentOptional
public readonly environment: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No environment variables.

Key-value pairs that Lambda caches and makes available for your Lambda functions.

Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code.


environmentEncryptionOptional
public readonly environmentEncryption: IKey;
  • Type: aws-cdk-lib.aws_kms.IKey
  • Default: AWS Lambda creates and uses an AWS managed customer master key (CMK).

The AWS KMS key that's used to encrypt your function's environment variables.


ephemeralStorageSizeOptional
public readonly ephemeralStorageSize: Size;
  • Type: aws-cdk-lib.Size
  • Default: 512 MiB

The size of the function’s /tmp directory in MiB.


eventsOptional
public readonly events: IEventSource[];
  • Type: aws-cdk-lib.aws_lambda.IEventSource[]
  • Default: No event sources.

Event sources for this function.

You can also add event sources using addEventSource.


filesystemOptional
public readonly filesystem: FileSystem;
  • Type: aws-cdk-lib.aws_lambda.FileSystem
  • Default: will not mount any filesystem

The filesystem configuration for the lambda function.


functionNameOptional
public readonly functionName: string;
  • Type: string
  • Default: AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.

A name for the function.


initialPolicyOptional
public readonly initialPolicy: PolicyStatement[];
  • Type: aws-cdk-lib.aws_iam.PolicyStatement[]
  • Default: No policy statements are added to the created Lambda role.

Initial policy statements to add to the created Lambda Role.

You can call addToRolePolicy to the created lambda to add statements post creation.


insightsVersionOptional
public readonly insightsVersion: LambdaInsightsVersion;
  • Type: aws-cdk-lib.aws_lambda.LambdaInsightsVersion
  • Default: No Lambda Insights

Specify the version of CloudWatch Lambda insights to use for monitoring.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html


ipv6AllowedForDualStackOptional
public readonly ipv6AllowedForDualStack: boolean;
  • Type: boolean
  • Default: false

Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

Only used if 'vpc' is supplied.


layersOptional
public readonly layers: ILayerVersion[];
  • Type: aws-cdk-lib.aws_lambda.ILayerVersion[]
  • Default: No layers.

A list of layers to add to the function's execution environment.

You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions.


~~logFormat~~Optional
  • Deprecated: Use loggingFormat as a property instead.
public readonly logFormat: string;
  • Type: string
  • Default: "Text"

Sets the logFormat for the function.


loggingFormatOptional
public readonly loggingFormat: LoggingFormat;
  • Type: aws-cdk-lib.aws_lambda.LoggingFormat
  • Default: LoggingFormat.TEXT

Sets the loggingFormat for the function.


logGroupOptional
public readonly logGroup: ILogGroup;
  • Type: aws-cdk-lib.aws_logs.ILogGroup
  • Default: /aws/lambda/${this.functionName} - default log group created by Lambda

The log group the function sends logs to.

By default, Lambda functions send logs to an automatically created default log group named /aws/lambda/\<function name>. However you cannot change the properties of this auto-created log group using the AWS CDK, e.g. you cannot set a different log retention.

Use the logGroup property to create a fully customizable LogGroup ahead of time, and instruct the Lambda function to send logs to it.

Providing a user-controlled log group was rolled out to commercial regions on 2023-11-16. If you are deploying to another type of region, please check regional availability first.


logRetentionOptional
public readonly logRetention: RetentionDays;
  • Type: aws-cdk-lib.aws_logs.RetentionDays
  • Default: logs.RetentionDays.INFINITE

The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.

This is a legacy API and we strongly recommend you move away from it if you can. Instead create a fully customizable log group with logs.LogGroup and use the logGroup property to instruct the Lambda function to send logs to it. Migrating from logRetention to logGroup will cause the name of the log group to change. Users and code and referencing the name verbatim will have to adjust.

In AWS CDK code, you can access the log group name directly from the LogGroup construct:

import * as logs from 'aws-cdk-lib/aws-logs';

declare const myLogGroup: logs.LogGroup;
myLogGroup.logGroupName;


logRetentionRetryOptionsOptional
public readonly logRetentionRetryOptions: LogRetentionRetryOptions;
  • Type: aws-cdk-lib.aws_lambda.LogRetentionRetryOptions
  • Default: Default AWS SDK retry options.

When log retention is specified, a custom resource attempts to create the CloudWatch log group.

These options control the retry policy when interacting with CloudWatch APIs.

This is a legacy API and we strongly recommend you migrate to logGroup if you can. logGroup allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.


logRetentionRoleOptional
public readonly logRetentionRole: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole
  • Default: A new role is created.

The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

This is a legacy API and we strongly recommend you migrate to logGroup if you can. logGroup allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.


memorySizeOptional
public readonly memorySize: number;
  • Type: number
  • Default: 128

The amount of memory, in MB, that is allocated to your Lambda function.

Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide.


paramsAndSecretsOptional
public readonly paramsAndSecrets: ParamsAndSecretsLayerVersion;
  • Type: aws-cdk-lib.aws_lambda.ParamsAndSecretsLayerVersion
  • Default: No Parameters and Secrets Extension

Specify the configuration of Parameters and Secrets Extension.

https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html


profilingOptional
public readonly profiling: boolean;
  • Type: boolean
  • Default: No profiling.

Enable profiling.

https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html


profilingGroupOptional
public readonly profilingGroup: IProfilingGroup;
  • Type: aws-cdk-lib.aws_codeguruprofiler.IProfilingGroup
  • Default: A new profiling group will be created if profiling is set.

Profiling Group.

https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html


recursiveLoopOptional
public readonly recursiveLoop: RecursiveLoop;
  • Type: aws-cdk-lib.aws_lambda.RecursiveLoop
  • Default: RecursiveLoop.Terminate

Sets the Recursive Loop Protection for Lambda Function.

It lets Lambda detect and terminate unintended recusrive loops.


reservedConcurrentExecutionsOptional
public readonly reservedConcurrentExecutions: number;
  • Type: number
  • Default: No specific limit - account limit.

The maximum of concurrent executions you want to reserve for the function.

https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html


roleOptional
public readonly role: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole
  • Default: A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling addToRolePolicy.

Lambda execution role.

This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal.

The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself.

The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole".


runtimeManagementModeOptional
public readonly runtimeManagementMode: RuntimeManagementMode;
  • Type: aws-cdk-lib.aws_lambda.RuntimeManagementMode
  • Default: Auto

Sets the runtime management configuration for a function's version.


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
  • Default: If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.

The list of security groups to associate with the Lambda's network interfaces.

Only used if 'vpc' is supplied.


snapStartOptional
public readonly snapStart: SnapStartConf;
  • Type: aws-cdk-lib.aws_lambda.SnapStartConf
  • Default: No snapstart

Enable SnapStart for Lambda Function.

SnapStart is currently supported only for Java 11, 17 runtime


~~systemLogLevel~~Optional
  • Deprecated: Use systemLogLevelV2 as a property instead.
public readonly systemLogLevel: string;
  • Type: string
  • Default: "INFO"

Sets the system log level for the function.


systemLogLevelV2Optional
public readonly systemLogLevelV2: SystemLogLevel;
  • Type: aws-cdk-lib.aws_lambda.SystemLogLevel
  • Default: SystemLogLevel.INFO

Sets the system log level for the function.


timeoutOptional
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.seconds(3)

The function execution time (in seconds) after which Lambda terminates the function.

Because the execution time affects cost, set this value based on the function's expected execution time.


tracingOptional
public readonly tracing: Tracing;
  • Type: aws-cdk-lib.aws_lambda.Tracing
  • Default: Tracing.Disabled

Enable AWS X-Ray Tracing for Lambda Function.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: Function is not placed within a VPC.

VPC network to place Lambda network interfaces.

Specify this if the Lambda function needs to access resources in a VPC. This is required when vpcSubnets is specified.


vpcSubnetsOptional
public readonly vpcSubnets: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection
  • Default: the Vpc default strategy if not specified

Where to place the network interfaces within the VPC.

This requires vpc to be specified in order for interfaces to actually be placed in the subnets. If vpc is not specify, this will raise an error.

Note: Internet access for Lambda Functions requires a NAT Gateway, so picking public subnets is not allowed (unless allowPublicSubnet is set to true).


codeRequired
public readonly code: Code;
  • Type: aws-cdk-lib.aws_lambda.Code

The source code of your Lambda function.

You can point to a file in an Amazon Simple Storage Service (Amazon S3) bucket or specify your source code as inline text.


handlerRequired
public readonly handler: string;
  • Type: string

The name of the method within your code that Lambda calls to execute your function.

The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html.

Use Handler.FROM_IMAGE when defining a function from a Docker image.

NOTE: If you specify your source code as inline text by specifying the ZipFile property within the Code property, specify index.function_name as the handler.


runtimeRequired
public readonly runtime: Runtime;
  • Type: aws-cdk-lib.aws_lambda.Runtime

The runtime environment for the Lambda function that you are uploading.

For valid values, see the Runtime property in the AWS Lambda Developer Guide.

Use Runtime.FROM_IMAGE when defining a function from a Docker image.


disableSnapStartOptional
public readonly disableSnapStart: boolean;
  • Type: boolean
  • Default: false

When true, disable snap start.


TypeSafeApiAsyncModelBuildOptions

Options for converting OpenAPI to AsyncAPI.

Initializer

import { TypeSafeApiAsyncModelBuildOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiAsyncModelBuildOptions: TypeSafeApiAsyncModelBuildOptions = { ... }

Properties

Name Type Description
asyncApiSpecFile string Path to the generated AsyncAPI specification (relative to the project root).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).

asyncApiSpecFileRequired
public readonly asyncApiSpecFile: string;
  • Type: string

Path to the generated AsyncAPI specification (relative to the project root).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSafeApiAsyncModelBuildOutputOptions

Output of the OpenAPI to AsyncAPI task.

Initializer

import { TypeSafeApiAsyncModelBuildOutputOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiAsyncModelBuildOutputOptions: TypeSafeApiAsyncModelBuildOutputOptions = { ... }

Properties

Name Type Description
asyncApiSpecFile string Path to the generated AsyncAPI specification (relative to the project root).

asyncApiSpecFileRequired
public readonly asyncApiSpecFile: string;
  • Type: string

Path to the generated AsyncAPI specification (relative to the project root).


TypeSafeApiIntegration

Defines an integration for an individual API operation.

Initializer

import { TypeSafeApiIntegration } from '@aws/pdk/type-safe-api'

const typeSafeApiIntegration: TypeSafeApiIntegration = { ... }

Properties

Name Type Description
integration Integration The integration to service the api operation.
authorizer Authorizer The authorizer to use for this api operation (overrides the default).
options TypeSafeApiIntegrationOptions Options for the integration.

integrationRequired
public readonly integration: Integration;

The integration to service the api operation.


authorizerOptional
public readonly authorizer: Authorizer;

The authorizer to use for this api operation (overrides the default).


optionsOptional
public readonly options: TypeSafeApiIntegrationOptions;

Options for the integration.


TypeSafeApiIntegrationOptions

Options for an integration.

Initializer

import { TypeSafeApiIntegrationOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiIntegrationOptions: TypeSafeApiIntegrationOptions = { ... }

Properties

Name Type Description
apiKeyRequired boolean Require an API key to invoke this operation.

apiKeyRequiredOptional
public readonly apiKeyRequired: boolean;
  • Type: boolean
  • Default: false

Require an API key to invoke this operation.

Overrides the default setting if present. This is only applicable when the API key source is HEADER.


TypeSafeApiModelBuildOptions

Options for configuring the OpenAPI parse/bundle task.

Initializer

import { TypeSafeApiModelBuildOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiModelBuildOptions: TypeSafeApiModelBuildOptions = { ... }

Properties

Name Type Description
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).
openApiSpecificationPath string Path to the OpenAPI specification.
smithyJsonModelPath string Optional path to the Smithy JSON model (for Smithy projects only).

parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


openApiSpecificationPathRequired
public readonly openApiSpecificationPath: string;
  • Type: string

Path to the OpenAPI specification.


smithyJsonModelPathOptional
public readonly smithyJsonModelPath: string;
  • Type: string

Optional path to the Smithy JSON model (for Smithy projects only).


TypeSafeApiModelBuildOutputOptions

Output for the OpenAPI parse/bundle task.

Initializer

import { TypeSafeApiModelBuildOutputOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiModelBuildOutputOptions: TypeSafeApiModelBuildOutputOptions = { ... }

Properties

Name Type Description
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).

parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSafeApiModelProjectOptions

Initializer

import { TypeSafeApiModelProjectOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiModelProjectOptions: TypeSafeApiModelProjectOptions = { ... }

Properties

Name Type Description
modelLanguage ModelLanguage Language the model is defined in.
modelOptions ModelOptions Options for the model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

modelLanguageRequired
public readonly modelLanguage: ModelLanguage;

Language the model is defined in.


modelOptionsRequired
public readonly modelOptions: ModelOptions;

Options for the model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


TypeSafeApiOptions

Options required alongside an Open API specification to create API Gateway resources.

Initializer

import { TypeSafeApiOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiOptions: TypeSafeApiOptions = { ... }

Properties

Name Type Description
integrations {[ key: string ]: TypeSafeApiIntegration} A mapping of API operation to its integration.
operationLookup {[ key: string ]: OperationDetails} Details about each operation.
apiKeyOptions ApiKeyOptions Options for API keys.
corsOptions aws-cdk-lib.aws_apigateway.CorsOptions Cross Origin Resource Sharing options for the API.
defaultAuthorizer Authorizer The default authorizer to use for your api.

integrationsRequired
public readonly integrations: {[ key: string ]: TypeSafeApiIntegration};

A mapping of API operation to its integration.


operationLookupRequired
public readonly operationLookup: {[ key: string ]: OperationDetails};

Details about each operation.


apiKeyOptionsOptional
public readonly apiKeyOptions: ApiKeyOptions;

Options for API keys.


corsOptionsOptional
public readonly corsOptions: CorsOptions;
  • Type: aws-cdk-lib.aws_apigateway.CorsOptions

Cross Origin Resource Sharing options for the API.


defaultAuthorizerOptional
public readonly defaultAuthorizer: Authorizer;

The default authorizer to use for your api.

When omitted, no default authorizer is used. Authorizers specified at the integration level will override this for that operation.


TypeSafeApiProjectOptions

Options for the TypeSafeApiProject.

Initializer

import { TypeSafeApiProjectOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiProjectOptions: TypeSafeApiProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
infrastructure InfrastructureConfiguration Configuration for generated infrastructure.
model ModelConfiguration Configuration for the API model.
commitGeneratedCode boolean Whether to commit the code generated by the OpenAPI Generator.
documentation DocumentationConfiguration Configuration for generated documentation.
handlers HandlersConfiguration Configuration for lambda handlers for implementing the API.
library LibraryConfiguration Configuration for generated libraries.
runtime RuntimeConfiguration Configuration for generated runtime projects (containing types, clients and server code).

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.


infrastructureRequired
public readonly infrastructure: InfrastructureConfiguration;

Configuration for generated infrastructure.


modelRequired
public readonly model: ModelConfiguration;

Configuration for the API model.


commitGeneratedCodeOptional
public readonly commitGeneratedCode: boolean;
  • Type: boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


documentationOptional
public readonly documentation: DocumentationConfiguration;

Configuration for generated documentation.


handlersOptional
public readonly handlers: HandlersConfiguration;

Configuration for lambda handlers for implementing the API.


libraryOptional
public readonly library: LibraryConfiguration;

Configuration for generated libraries.

Libraries are projects which are generated from your model, but are not fully-fledged runtimes, for example react hooks or clients in languages that aren't supported as runtimes.


runtimeOptional
public readonly runtime: RuntimeConfiguration;

Configuration for generated runtime projects (containing types, clients and server code).


TypeSafeApiWebAclOptions

Configuration for the Web ACL associated with the API.

Initializer

import { TypeSafeApiWebAclOptions } from '@aws/pdk/type-safe-api'

const typeSafeApiWebAclOptions: TypeSafeApiWebAclOptions = { ... }

Properties

Name Type Description
cidrAllowList CidrAllowList List of cidr ranges to allow.
disable boolean If set to true, no WebACL will be associated with the API.
managedRules ManagedRule[] List of managed rules to apply to the web acl.

cidrAllowListOptional
public readonly cidrAllowList: CidrAllowList;

List of cidr ranges to allow.


disableOptional
public readonly disable: boolean;
  • Type: boolean
  • Default: false

If set to true, no WebACL will be associated with the API.

You can also use this option if you would like to create your own WebACL and associate it yourself.


managedRulesOptional
public readonly managedRules: ManagedRule[];
  • Type: ManagedRule[]
  • Default: [{ vendor: "AWS", name: "AWSManagedRulesCommonRuleSet" }]

List of managed rules to apply to the web acl.


TypeSafeRestApiProps

Configuration for the TypeSafeRestApi construct.

Initializer

import { TypeSafeRestApiProps } from '@aws/pdk/type-safe-api'

const typeSafeRestApiProps: TypeSafeRestApiProps = { ... }

Properties

Name Type Description
cloudWatchRole boolean Automatically configure an AWS CloudWatch role for API Gateway.
cloudWatchRoleRemovalPolicy aws-cdk-lib.RemovalPolicy The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.
deploy boolean Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
deployOptions aws-cdk-lib.aws_apigateway.StageOptions Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.
description string A description of the RestApi construct.
disableExecuteApiEndpoint boolean Specifies whether clients can invoke the API using the default execute-api endpoint.
domainName aws-cdk-lib.aws_apigateway.DomainNameOptions Configure a custom domain name and map it to this API.
endpointExportName string Export name for the CfnOutput containing the API endpoint.
endpointTypes aws-cdk-lib.aws_apigateway.EndpointType[] A list of the endpoint types of the API.
failOnWarnings boolean Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters {[ key: string ]: string} Custom header parameters for the request.
policy aws-cdk-lib.aws_iam.PolicyDocument A policy document that contains the permissions for this RestApi.
restApiName string A name for the API Gateway RestApi resource.
retainDeployments boolean Retains old deployment resources when the API changes.
integrations {[ key: string ]: TypeSafeApiIntegration} A mapping of API operation to its integration.
operationLookup {[ key: string ]: OperationDetails} Details about each operation.
apiKeyOptions ApiKeyOptions Options for API keys.
corsOptions aws-cdk-lib.aws_apigateway.CorsOptions Cross Origin Resource Sharing options for the API.
defaultAuthorizer Authorizer The default authorizer to use for your api.
specPath string Path to the JSON open api spec.
minCompressionSize aws-cdk-lib.Size A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
outputSpecBucket aws-cdk-lib.aws_s3.IBucket By default, the spec is prepared and outputted into the CDK assets bucket.
webAclOptions TypeSafeApiWebAclOptions Options for the AWS WAF v2 WebACL associated with the api.

cloudWatchRoleOptional
public readonly cloudWatchRole: boolean;
  • Type: boolean
  • Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

Automatically configure an AWS CloudWatch role for API Gateway.


cloudWatchRoleRemovalPolicyOptional
public readonly cloudWatchRoleRemovalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.RETAIN

The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.

Requires cloudWatchRole to be enabled.


deployOptional
public readonly deploy: boolean;
  • Type: boolean
  • Default: true

Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.

Since API Gateway deployments are immutable, When this option is enabled (by default), an AWS::ApiGateway::Deployment resource will automatically created with a logical ID that hashes the API model (methods, resources and options). This means that when the model changes, the logical ID of this CloudFormation resource will change, and a new deployment will be created.

If this is set, latestDeployment will refer to the Deployment object and deploymentStage will refer to a Stage that points to this deployment. To customize the stage options, use the deployOptions property.

A CloudFormation Output will also be defined with the root URL endpoint of this REST API.


deployOptionsOptional
public readonly deployOptions: StageOptions;
  • Type: aws-cdk-lib.aws_apigateway.StageOptions
  • Default: Based on defaults of StageOptions.

Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.

If deploy is disabled, this value cannot be set.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: 'Automatically created by the RestApi construct'

A description of the RestApi construct.


disableExecuteApiEndpointOptional
public readonly disableExecuteApiEndpoint: boolean;
  • Type: boolean
  • Default: false

Specifies whether clients can invoke the API using the default execute-api endpoint.

To require that clients use a custom domain name to invoke the API, disable the default endpoint.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html


domainNameOptional
public readonly domainName: DomainNameOptions;
  • Type: aws-cdk-lib.aws_apigateway.DomainNameOptions
  • Default: no domain name is defined, use addDomainName or directly define a DomainName.

Configure a custom domain name and map it to this API.


endpointExportNameOptional
public readonly endpointExportName: string;
  • Type: string
  • Default: when no export name is given, output will be created without export

Export name for the CfnOutput containing the API endpoint.


endpointTypesOptional
public readonly endpointTypes: EndpointType[];
  • Type: aws-cdk-lib.aws_apigateway.EndpointType[]
  • Default: EndpointType.EDGE

A list of the endpoint types of the API.

Use this property when creating an API.


failOnWarningsOptional
public readonly failOnWarnings: boolean;
  • Type: boolean
  • Default: false

Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.


parametersOptional
public readonly parameters: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No parameters.

Custom header parameters for the request.

https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html


policyOptional
public readonly policy: PolicyDocument;
  • Type: aws-cdk-lib.aws_iam.PolicyDocument
  • Default: No policy.

A policy document that contains the permissions for this RestApi.


restApiNameOptional
public readonly restApiName: string;
  • Type: string
  • Default: ID of the RestApi construct.

A name for the API Gateway RestApi resource.


retainDeploymentsOptional
public readonly retainDeployments: boolean;
  • Type: boolean
  • Default: false

Retains old deployment resources when the API changes.

This allows manually reverting stages to point to old deployments via the AWS Console.


integrationsRequired
public readonly integrations: {[ key: string ]: TypeSafeApiIntegration};

A mapping of API operation to its integration.


operationLookupRequired
public readonly operationLookup: {[ key: string ]: OperationDetails};

Details about each operation.


apiKeyOptionsOptional
public readonly apiKeyOptions: ApiKeyOptions;

Options for API keys.


corsOptionsOptional
public readonly corsOptions: CorsOptions;
  • Type: aws-cdk-lib.aws_apigateway.CorsOptions

Cross Origin Resource Sharing options for the API.


defaultAuthorizerOptional
public readonly defaultAuthorizer: Authorizer;

The default authorizer to use for your api.

When omitted, no default authorizer is used. Authorizers specified at the integration level will override this for that operation.


specPathRequired
public readonly specPath: string;
  • Type: string

Path to the JSON open api spec.


minCompressionSizeOptional
public readonly minCompressionSize: Size;
  • Type: aws-cdk-lib.Size
  • Default: Compression is disabled.

A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.


outputSpecBucketOptional
public readonly outputSpecBucket: IBucket;
  • Type: aws-cdk-lib.aws_s3.IBucket

By default, the spec is prepared and outputted into the CDK assets bucket.

If this is undesired, use this option to specify the output bucket.


webAclOptionsOptional
public readonly webAclOptions: TypeSafeApiWebAclOptions;

Options for the AWS WAF v2 WebACL associated with the api.

By default, a Web ACL with the AWS default managed rule set will be associated with the API. These options may disable or override the defaults.


TypeSafeWebsocketApiIntegration

Represents an integration for a route.

Initializer

import { TypeSafeWebsocketApiIntegration } from '@aws/pdk/type-safe-api'

const typeSafeWebsocketApiIntegration: TypeSafeWebsocketApiIntegration = { ... }

Properties

Name Type Description
integration aws-cdk-lib.aws_apigatewayv2.WebSocketRouteIntegration The integration to service the route.

integrationRequired
public readonly integration: WebSocketRouteIntegration;
  • Type: aws-cdk-lib.aws_apigatewayv2.WebSocketRouteIntegration

The integration to service the route.


TypeSafeWebSocketApiModelConfiguration

Initializer

import { TypeSafeWebSocketApiModelConfiguration } from '@aws/pdk/type-safe-api'

const typeSafeWebSocketApiModelConfiguration: TypeSafeWebSocketApiModelConfiguration = { ... }

Properties

Name Type Description
language ModelLanguage The language the API model is defined in.
options ModelOptions Options for the API model.

languageRequired
public readonly language: ModelLanguage;

The language the API model is defined in.


optionsRequired
public readonly options: ModelOptions;

Options for the API model.


TypeSafeWebSocketApiModelProjectOptions

Initializer

import { TypeSafeWebSocketApiModelProjectOptions } from '@aws/pdk/type-safe-api'

const typeSafeWebSocketApiModelProjectOptions: TypeSafeWebSocketApiModelProjectOptions = { ... }

Properties

Name Type Description
modelLanguage ModelLanguage Language the model is defined in.
modelOptions ModelOptions Options for the model.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

modelLanguageRequired
public readonly modelLanguage: ModelLanguage;

Language the model is defined in.


modelOptionsRequired
public readonly modelOptions: ModelOptions;

Options for the model.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


TypeSafeWebSocketApiProjectOptions

Options for the TypeSafeWebSocketApiProject.

Initializer

import { TypeSafeWebSocketApiProjectOptions } from '@aws/pdk/type-safe-api'

const typeSafeWebSocketApiProjectOptions: TypeSafeWebSocketApiProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
infrastructure WebSocketInfrastructureConfiguration Configuration for generated infrastructure.
model TypeSafeWebSocketApiModelConfiguration Configuration for the API model.
documentation WebSocketDocumentationConfiguration Configuration for generated documentation.
handlers WebSocketHandlersConfiguration Configuration for lambda handlers for implementing the API.
library WebSocketLibraryConfiguration Configuration for generated libraries.
runtime WebSocketRuntimeConfiguration Configuration for generated runtime projects (containing types, clients and server code).

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.


infrastructureRequired
public readonly infrastructure: WebSocketInfrastructureConfiguration;

Configuration for generated infrastructure.


modelRequired
public readonly model: TypeSafeWebSocketApiModelConfiguration;

Configuration for the API model.


documentationOptional
public readonly documentation: WebSocketDocumentationConfiguration;

Configuration for generated documentation.


handlersOptional
public readonly handlers: WebSocketHandlersConfiguration;

Configuration for lambda handlers for implementing the API.


libraryOptional
public readonly library: WebSocketLibraryConfiguration;

Configuration for generated libraries.

These include clients for interacting with your websocket API


runtimeOptional
public readonly runtime: WebSocketRuntimeConfiguration;

Configuration for generated runtime projects (containing types, clients and server code).


TypeSafeWebsocketApiProps

Properties for a Type Safe WebSocket API.

Initializer

import { TypeSafeWebsocketApiProps } from '@aws/pdk/type-safe-api'

const typeSafeWebsocketApiProps: TypeSafeWebsocketApiProps = { ... }

Properties

Name Type Description
apiKeySelectionExpression aws-cdk-lib.aws_apigatewayv2.WebSocketApiKeySelectionExpression An API key selection expression.
apiName string Name for the WebSocket API resource.
description string The description of the API.
integrations {[ key: string ]: TypeSafeWebsocketApiIntegration} WebSocket routes and their corresponding integrations.
operationLookup {[ key: string ]: WebsocketOperationDetails} Details about each operation.
specPath string Path to the websocket api specification json file.
authorizer aws-cdk-lib.aws_apigatewayv2.IWebSocketRouteAuthorizer Authorizer to use for the API (applied to the $connect route).
connect TypeSafeWebsocketApiIntegration Integration for the $connect route (invoked when a new client connects).
disableAccessLogging boolean Disable access logging.
disableGrantManagementAccessToLambdas boolean By default, all lambda integrations are granted management API access for the websocket API to send messages, disconnect clients, etc.
disableMockIntegrationResponses boolean By default, all mock integrations will automatically be configured with integration responses such that the integration is considered successful.
disconnect TypeSafeWebsocketApiIntegration Integration for the $disconnect route (invoked when a client disconnects).
stageProps WebSocketStageProps Options for the default stage.

apiKeySelectionExpressionOptional
public readonly apiKeySelectionExpression: WebSocketApiKeySelectionExpression;
  • Type: aws-cdk-lib.aws_apigatewayv2.WebSocketApiKeySelectionExpression
  • Default: Key is not required to access these APIs

An API key selection expression.

Providing this option will require an API Key be provided to access the API.


apiNameOptional
public readonly apiName: string;
  • Type: string
  • Default: id of the WebSocketApi construct.

Name for the WebSocket API resource.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: none

The description of the API.


integrationsRequired
public readonly integrations: {[ key: string ]: TypeSafeWebsocketApiIntegration};

WebSocket routes and their corresponding integrations.


operationLookupRequired
public readonly operationLookup: {[ key: string ]: WebsocketOperationDetails};

Details about each operation.


specPathRequired
public readonly specPath: string;
  • Type: string

Path to the websocket api specification json file.


authorizerOptional
public readonly authorizer: IWebSocketRouteAuthorizer;
  • Type: aws-cdk-lib.aws_apigatewayv2.IWebSocketRouteAuthorizer
  • Default: NONE

Authorizer to use for the API (applied to the $connect route).


connectOptional
public readonly connect: TypeSafeWebsocketApiIntegration;

Integration for the $connect route (invoked when a new client connects).


disableAccessLoggingOptional
public readonly disableAccessLogging: boolean;
  • Type: boolean
  • Default: false

Disable access logging.


disableGrantManagementAccessToLambdasOptional
public readonly disableGrantManagementAccessToLambdas: boolean;
  • Type: boolean
  • Default: false

By default, all lambda integrations are granted management API access for the websocket API to send messages, disconnect clients, etc.

Set to true if you would like to manage these permissions manually.


disableMockIntegrationResponsesOptional
public readonly disableMockIntegrationResponses: boolean;
  • Type: boolean
  • Default: false

By default, all mock integrations will automatically be configured with integration responses such that the integration is considered successful.

Set to true to disable this (mock integrations will respond with errors)


disconnectOptional
public readonly disconnect: TypeSafeWebsocketApiIntegration;

Integration for the $disconnect route (invoked when a client disconnects).


stagePropsOptional
public readonly stageProps: WebSocketStageProps;

Options for the default stage.


TypeScriptProjectOptions

TypeScriptProjectOptions.

Initializer

import { TypeScriptProjectOptions } from '@aws/pdk/type-safe-api'

const typeScriptProjectOptions: TypeScriptProjectOptions = { ... }

Properties

Name Type Description
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
artifactsDirectory string A directory which will contain build artifacts.
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 projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
defaultReleaseBranch string The name of the main release branch.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
minMajorVersion number Minimal Major version to release.
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
name string This is the name of your project.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projectType projen.ProjectType Which type of project this is (library/app).
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflow boolean DEPRECATED: renamed to release.
releaseWorkflowName string The 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.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
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.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
tsJestOptions projen.typescript.TsJestOptions Options for ts-jest.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
vscode boolean Enable VSCode integration.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.

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.


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

A directory which will contain build artifacts.


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.


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

Enable and configure the 'auto approve' workflow.


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.


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.


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.


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.


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.


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

Build workflow triggers.


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.


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.


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

Add a clobber task which resets the repo to origin.


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


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.


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

Whether to commit the managed files by default.


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.


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

The name of the main release branch.


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.


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.


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.


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


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

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


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.


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.


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.


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.


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.


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

Additional entries to .gitignore.


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.


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

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


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.


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

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


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

Keywords to include in package.json.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


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.


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

Configure logging options such as verbosity.


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.


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

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


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


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.


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

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


~~mutableBuild~~Optional
  • 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.


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

This is the name of your project.


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.


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.


~~npmignore~~Optional
  • 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.


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.


~~npmRegistry~~Optional
  • 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.


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.


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


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.


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

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


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.


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


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.


~~projectType~~Optional
  • 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).


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.


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.


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.


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.


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

Options for .projenrc.js.


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.


~~projenTokenSecret~~Optional
  • 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.


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

Version of projen to install.


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.


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.


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

The README setup.


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.


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

Add release management to this project.


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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


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

The release trigger to use.


~~releaseWorkflow~~Optional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


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.


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.


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.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

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


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.


~~scripts~~Optional
  • 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.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


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.


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


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.


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

Enable VSCode integration.

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


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.


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

Container image to use for GitHub workflows.


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.


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.


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

Options for Yarn Berry.


TypeSpecAsyncDefinitionOptions

Options for the TypeSpec async model definition.

Initializer

import { TypeSpecAsyncDefinitionOptions } from '@aws/pdk/type-safe-api'

const typeSpecAsyncDefinitionOptions: TypeSpecAsyncDefinitionOptions = { ... }

Properties

Name Type Description
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

typeSpecOptionsRequired
public readonly typeSpecOptions: TypeSpecModelOptions;

TypeSpec model options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


TypeSpecAsyncModelProjectOptions

Options for the TypeSpec WebSocket API model project.

Initializer

import { TypeSpecAsyncModelProjectOptions } from '@aws/pdk/type-safe-api'

const typeSpecAsyncModelProjectOptions: TypeSpecAsyncModelProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber boolean Add a clobber task which resets the repo to origin.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitpod boolean Add a Gitpod development environment.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
projectType projen.ProjectType Which type of project this is (library/app).
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme projen.SampleReadmeProps The README setup.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode boolean Enable VSCode integration.
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
authorEmail string Author's e-mail.
authorName string Author's name.
authorOrganization boolean Is the author an organization.
authorUrl string Author's URL / Website.
autoDetectBin boolean Automatically 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 string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
bundledDeps string[] List of dependencies to bundle into this module.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps string[] Runtime dependencies of this module.
description string The description is just a string that helps people understand the purpose of the package.
devDeps string[] Build dependencies for this module.
entrypoint string Module entrypoint (main in package.json).
homepage string Package's Homepage / Website.
keywords string[] Keywords to include in package.json.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
repository string The repository is the location where the actual code for your package lives.
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.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
stability string Package's Stability.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
majorVersion number Major version to release from the default branch.
minMajorVersion number Minimal Major version to release.
npmDistTag string The 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 string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
releasableCommits projen.ReleasableCommits Find 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 boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflowName string The 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 string Container image to use for GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
defaultReleaseBranch string The name of the main release branch.
artifactsDirectory string A directory which will contain build artifacts.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore string[] Additional entries to .gitignore.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenVersion string Version of projen to install.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
release boolean Add release management to this project.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseWorkflow boolean DEPRECATED: renamed to release.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).
asyncApiSpecFile string Path to the generated AsyncAPI specification (relative to the project root).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).

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.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


~~projectType~~Optional
  • 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.


~~projenTokenSecret~~Optional
  • 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


~~npmRegistry~~Optional
  • 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.


~~scripts~~Optional
  • 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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


~~buildWorkflowTriggers~~Optional
  • 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.


~~mutableBuild~~Optional
  • 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.


~~npmignore~~Optional
  • 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.


~~releaseWorkflow~~Optional
  • 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.


typeSpecOptionsRequired
public readonly typeSpecOptions: TypeSpecModelOptions;

TypeSpec model options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


asyncApiSpecFileRequired
public readonly asyncApiSpecFile: string;
  • Type: string

Path to the generated AsyncAPI specification (relative to the project root).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSpecDefinitionOptions

Options for the TypeSpec model definition.

Initializer

import { TypeSpecDefinitionOptions } from '@aws/pdk/type-safe-api'

const typeSpecDefinitionOptions: TypeSpecDefinitionOptions = { ... }

Properties

Name Type Description
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

typeSpecOptionsRequired
public readonly typeSpecOptions: TypeSpecModelOptions;

TypeSpec model options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


TypeSpecModelOptions

Options for the TypeSpec model.

Initializer

import { TypeSpecModelOptions } from '@aws/pdk/type-safe-api'

const typeSpecModelOptions: TypeSpecModelOptions = { ... }

Properties

Name Type Description
namespace string The namespace for your API.

namespaceRequired
public readonly namespace: string;
  • Type: string

The namespace for your API.

https://typespec.io/docs/language-basics/namespaces/ eg. MyApi


TypeSpecModelProjectOptions

Options for the TypeSpec model project.

Initializer

import { TypeSpecModelProjectOptions } from '@aws/pdk/type-safe-api'

const typeSpecModelProjectOptions: TypeSpecModelProjectOptions = { ... }

Properties

Name Type Description
name string This is the name of your project.
commitGenerated boolean Whether to commit the managed files by default.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber boolean Add a clobber task which resets the repo to origin.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitpod boolean Add a Gitpod development environment.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
projectType projen.ProjectType Which type of project this is (library/app).
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenTokenSecret string The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme projen.SampleReadmeProps The README setup.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode boolean Enable VSCode integration.
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
authorEmail string Author's e-mail.
authorName string Author's name.
authorOrganization boolean Is the author an organization.
authorUrl string Author's URL / Website.
autoDetectBin boolean Automatically 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 string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
bundledDeps string[] List of dependencies to bundle into this module.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps string[] Runtime dependencies of this module.
description string The description is just a string that helps people understand the purpose of the package.
devDeps string[] Build dependencies for this module.
entrypoint string Module entrypoint (main in package.json).
homepage string Package's Homepage / Website.
keywords string[] Keywords to include in package.json.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
repository string The repository is the location where the actual code for your package lives.
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.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
stability string Package's Stability.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
majorVersion number Major version to release from the default branch.
minMajorVersion number Minimal Major version to release.
npmDistTag string The 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 string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
releasableCommits projen.ReleasableCommits Find 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 boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflowName string The 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 string Container image to use for GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
defaultReleaseBranch string The name of the main release branch.
artifactsDirectory string A directory which will contain build artifacts.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
codeCov boolean 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.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore string[] Additional entries to .gitignore.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenVersion string Version of projen to install.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
release boolean Add release management to this project.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseWorkflow boolean DEPRECATED: renamed to release.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).
parsedSpecFile string Path of the parsed/bundled OpenAPI specification (relative to the project root).

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.


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

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


~~projectType~~Optional
  • 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.


~~projenTokenSecret~~Optional
  • 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


~~npmRegistry~~Optional
  • 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.


~~scripts~~Optional
  • 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.


~~releaseEveryCommit~~Optional
  • 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.


~~releaseSchedule~~Optional
  • 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.


~~buildWorkflowTriggers~~Optional
  • 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.


~~mutableBuild~~Optional
  • 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.


~~npmignore~~Optional
  • 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.


~~releaseWorkflow~~Optional
  • 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.


typeSpecOptionsRequired
public readonly typeSpecOptions: TypeSpecModelOptions;

TypeSpec model options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSpecProjectDefinitionOptions

Options for a TypeSpec model project.

Initializer

import { TypeSpecProjectDefinitionOptions } from '@aws/pdk/type-safe-api'

const typeSpecProjectDefinitionOptions: TypeSpecProjectDefinitionOptions = { ... }

Properties

Name Type Description
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages Language[] The languages users have specified for handler projects (if any).

typeSpecOptionsRequired
public readonly typeSpecOptions: TypeSpecModelOptions;

TypeSpec model options.


handlerLanguagesOptional
public readonly handlerLanguages: Language[];

The languages users have specified for handler projects (if any).


WebSocketApiProps

WebSocketApiProps.

Initializer

import { WebSocketApiProps } from '@aws/pdk/type-safe-api'

const webSocketApiProps: WebSocketApiProps = { ... }

Properties

Name Type Description
apiKeySelectionExpression aws-cdk-lib.aws_apigatewayv2.WebSocketApiKeySelectionExpression An API key selection expression.
apiName string Name for the WebSocket API resource.
description string The description of the API.

apiKeySelectionExpressionOptional
public readonly apiKeySelectionExpression: WebSocketApiKeySelectionExpression;
  • Type: aws-cdk-lib.aws_apigatewayv2.WebSocketApiKeySelectionExpression
  • Default: Key is not required to access these APIs

An API key selection expression.

Providing this option will require an API Key be provided to access the API.


apiNameOptional
public readonly apiName: string;
  • Type: string
  • Default: id of the WebSocketApi construct.

Name for the WebSocket API resource.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: none

The description of the API.


WebSocketDocumentationConfiguration

Configuration for generated documentation.

Initializer

import { WebSocketDocumentationConfiguration } from '@aws/pdk/type-safe-api'

const webSocketDocumentationConfiguration: WebSocketDocumentationConfiguration = { ... }

Properties

Name Type Description
formats WebSocketDocumentationFormat[] Formats for generated documentation.
options GeneratedWebSocketDocumentationOptions Options for the generated documentation projects.

formatsRequired
public readonly formats: WebSocketDocumentationFormat[];

Formats for generated documentation.


optionsOptional
public readonly options: GeneratedWebSocketDocumentationOptions;

Options for the generated documentation projects.

Note that only those provided for the specified formats will apply


WebSocketHandlersConfiguration

Configuration for generated lambda handlers.

Initializer

import { WebSocketHandlersConfiguration } from '@aws/pdk/type-safe-api'

const webSocketHandlersConfiguration: WebSocketHandlersConfiguration = { ... }

Properties

Name Type Description
languages Language[] The languages lambda handlers are written in.
options GeneratedHandlersCodeOptions Options for the infrastructure package.

languagesRequired
public readonly languages: Language[];

The languages lambda handlers are written in.

Specify multiple languages if you wish to implement different operations as AWS Lambda functions in different languages.


optionsOptional
public readonly options: GeneratedHandlersCodeOptions;

Options for the infrastructure package.

Note that only those provided for the specified language will apply.


WebSocketInfrastructureConfiguration

Configuration for generated infrastructure.

Initializer

import { WebSocketInfrastructureConfiguration } from '@aws/pdk/type-safe-api'

const webSocketInfrastructureConfiguration: WebSocketInfrastructureConfiguration = { ... }

Properties

Name Type Description
language Language The language to generate the type-safe CDK infrastructure in.
options GeneratedInfrastructureCodeOptions Options for the infrastructure package.

languageRequired
public readonly language: Language;

The language to generate the type-safe CDK infrastructure in.


optionsOptional
public readonly options: GeneratedInfrastructureCodeOptions;

Options for the infrastructure package.

Note that only those provided for the specified language will apply.


WebSocketLibraryConfiguration

Configuration for generated libraries.

Initializer

import { WebSocketLibraryConfiguration } from '@aws/pdk/type-safe-api'

const webSocketLibraryConfiguration: WebSocketLibraryConfiguration = { ... }

Properties

Name Type Description
libraries WebSocketLibrary[] The libraries to generate.
options GeneratedWebSocketLibraryOptions Options for the generated library package.

librariesRequired
public readonly libraries: WebSocketLibrary[];

The libraries to generate.


optionsOptional
public readonly options: GeneratedWebSocketLibraryOptions;

Options for the generated library package.

Note that only options for the specified libraries will apply


WebSocketModelProject

WebSocket model project references.

Initializer

import { WebSocketModelProject } from '@aws/pdk/type-safe-api'

const webSocketModelProject: WebSocketModelProject = { ... }

Properties

Name Type Description
apiName string Name of the API.
outdir string Directory of the model project.
parsedSpecFile string Name of the bundled OpenAPI specification file.
asyncApiSpecFile string File name of the generated async api specification.
openapi OpenApiAsyncModelProject Reference to the OpenAPI model project.
smithy SmithyAsyncModelProject Reference to the Smithy model project.
typeSpec TypeSpecAsyncModelProject Reference to the TypeSpec model project.

apiNameRequired
public readonly apiName: string;
  • Type: string

Name of the API.


outdirRequired
public readonly outdir: string;
  • Type: string

Directory of the model project.


parsedSpecFileRequired
public readonly parsedSpecFile: string;
  • Type: string

Name of the bundled OpenAPI specification file.


asyncApiSpecFileRequired
public readonly asyncApiSpecFile: string;
  • Type: string

File name of the generated async api specification.


openapiOptional
public readonly openapi: OpenApiAsyncModelProject;

Reference to the OpenAPI model project.

Will be defined if the model language is OpenAPI


smithyOptional
public readonly smithy: SmithyAsyncModelProject;

Reference to the Smithy model project.

Will be defined if the model language is Smithy


typeSpecOptional
public readonly typeSpec: TypeSpecAsyncModelProject;

Reference to the TypeSpec model project.

Will be defined if the model language is TypeSpec


WebsocketOperationDetails

Initializer

import { WebsocketOperationDetails } from '@aws/pdk/type-safe-api'

const websocketOperationDetails: WebsocketOperationDetails = { ... }

Properties

Name Type Description
path string Path in the OpenAPI spec for the operation.

pathRequired
public readonly path: string;
  • Type: string

Path in the OpenAPI spec for the operation.


WebSocketRuntimeConfiguration

Configuration for generated runtime projects.

Initializer

import { WebSocketRuntimeConfiguration } from '@aws/pdk/type-safe-api'

const webSocketRuntimeConfiguration: WebSocketRuntimeConfiguration = { ... }

Properties

Name Type Description
languages Language[] The languages that runtime projects will be generated in.
options GeneratedRuntimeCodeOptions Options for the generated runtimes.

languagesRequired
public readonly languages: Language[];

The languages that runtime projects will be generated in.

These projects can be used to provide type safety for both client and server projects.


optionsOptional
public readonly options: GeneratedRuntimeCodeOptions;

Options for the generated runtimes.

Note that only options provided for the specified languages will apply.


WebSocketStageProps

WebSocketStageProps.

Initializer

import { WebSocketStageProps } from '@aws/pdk/type-safe-api'

const webSocketStageProps: WebSocketStageProps = { ... }

Properties

Name Type Description
autoDeploy boolean Whether updates to an API automatically trigger a new deployment.
description string The description for the API stage.
domainMapping aws-cdk-lib.aws_apigatewayv2.DomainMappingOptions The options for custom domain and api mapping.
stageName string The name of the stage.
throttle aws-cdk-lib.aws_apigatewayv2.ThrottleSettings Throttle settings for the routes of this stage.

autoDeployOptional
public readonly autoDeploy: boolean;
  • Type: boolean
  • Default: false

Whether updates to an API automatically trigger a new deployment.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: no description

The description for the API stage.


domainMappingOptional
public readonly domainMapping: DomainMappingOptions;
  • Type: aws-cdk-lib.aws_apigatewayv2.DomainMappingOptions
  • Default: no custom domain and api mapping configuration

The options for custom domain and api mapping.


stageNameOptional
public readonly stageName: string;
  • Type: string

The name of the stage.


throttleOptional
public readonly throttle: ThrottleSettings;
  • Type: aws-cdk-lib.aws_apigatewayv2.ThrottleSettings
  • Default: no throttling configuration

Throttle settings for the routes of this stage.


Classes

Authorizer

An authorizer for authorizing API requests.

Initializers

import { Authorizer } from '@aws/pdk/type-safe-api'

new Authorizer(props: AuthorizerProps)
Name Type Description
props AuthorizerProps No description.

propsRequired

Properties

Name Type Description
authorizationType aws-cdk-lib.aws_apigateway.AuthorizationType The type of the authorizer.
authorizerId string The unique identifier for the authorizer.
authorizationScopes string[] Scopes for the authorizer, if any.

authorizationTypeRequired
public readonly authorizationType: AuthorizationType;
  • Type: aws-cdk-lib.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

The unique identifier for the authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]

Scopes for the authorizer, if any.


Authorizers

Class used to construct authorizers for use in the OpenApiGatewayLambdaApi construct.

Initializers

import { Authorizers } from '@aws/pdk/type-safe-api'

new Authorizers()
Name Type Description

Static Functions

Name Description
cognito A Cognito User Pools authorizer.
custom A custom authorizer.
iam An IAM authorizer which uses AWS signature version 4 to authorize requests.
none No authorizer.

cognito
import { Authorizers } from '@aws/pdk/type-safe-api'

Authorizers.cognito(props: CognitoAuthorizerProps)

A Cognito User Pools authorizer.

propsRequired

custom
import { Authorizers } from '@aws/pdk/type-safe-api'

Authorizers.custom(props: CustomAuthorizerProps)

A custom authorizer.

propsRequired

iam
import { Authorizers } from '@aws/pdk/type-safe-api'

Authorizers.iam()

An IAM authorizer which uses AWS signature version 4 to authorize requests.

none
import { Authorizers } from '@aws/pdk/type-safe-api'

Authorizers.none()

No authorizer.

CatchAllErrorIntegrationResponseSet

An integration response set that catches all errors and returns a 500.

Initializers

import { CatchAllErrorIntegrationResponseSet } from '@aws/pdk/type-safe-api'

new CatchAllErrorIntegrationResponseSet()
Name Type Description

Methods

Name Description
render Render the integration responses into the Integration.

render
public render(props: IntegrationRenderProps): {[ key: string ]: ApiGatewayIntegrationResponse}

Render the integration responses into the Integration.

propsRequired

CognitoAuthorizer

An authorizer that uses Cognito identity or access tokens.

Initializers

import { CognitoAuthorizer } from '@aws/pdk/type-safe-api'

new CognitoAuthorizer(props: CognitoAuthorizerProps)
Name Type Description
props CognitoAuthorizerProps No description.

propsRequired

Methods

Name Description
withScopes Returns this authorizer with scopes applied, intended for usage in individual operations where scopes may differ on a per-operation basis.

withScopes
public withScopes(authorizationScopes: string): CognitoAuthorizer

Returns this authorizer with scopes applied, intended for usage in individual operations where scopes may differ on a per-operation basis.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html#cfn-apigateway-method-authorizationscopes

authorizationScopesRequired
  • Type: string

the scopes to apply.


Properties

Name Type Description
authorizationType aws-cdk-lib.aws_apigateway.AuthorizationType The type of the authorizer.
authorizerId string The unique identifier for the authorizer.
authorizationScopes string[] Scopes for the authorizer, if any.
userPools aws-cdk-lib.aws_cognito.IUserPool[] The Cognito user pools associated with this authorizer.

authorizationTypeRequired
public readonly authorizationType: AuthorizationType;
  • Type: aws-cdk-lib.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

The unique identifier for the authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]

Scopes for the authorizer, if any.


userPoolsRequired
public readonly userPools: IUserPool[];
  • Type: aws-cdk-lib.aws_cognito.IUserPool[]

The Cognito user pools associated with this authorizer.


CompositeIntegrationResponseSet

An integration response set which combines the provided integration response sets.

Response sets are combined in order, so later responses will override previous ones for overlapping response status patterns.

Initializers

import { CompositeIntegrationResponseSet } from '@aws/pdk/type-safe-api'

new CompositeIntegrationResponseSet(responseSets: IntegrationResponseSet)
Name Type Description
responseSets IntegrationResponseSet No description.

responseSetsRequired

Methods

Name Description
render Render the integration responses into the Integration.

render
public render(props: IntegrationRenderProps): {[ key: string ]: ApiGatewayIntegrationResponse}

Render the integration responses into the Integration.

propsRequired

CustomAuthorizer

An authorizer that uses a lambda function to authorize requests.

Initializers

import { CustomAuthorizer } from '@aws/pdk/type-safe-api'

new CustomAuthorizer(props: CustomAuthorizerProps)
Name Type Description
props CustomAuthorizerProps No description.

propsRequired

Properties

Name Type Description
authorizationType aws-cdk-lib.aws_apigateway.AuthorizationType The type of the authorizer.
authorizerId string The unique identifier for the authorizer.
authorizationScopes string[] Scopes for the authorizer, if any.
authorizerResultTtlInSeconds number The number of seconds during which the authorizer result is cached.
function aws-cdk-lib.aws_lambda.IFunction The lambda function used to authorize requests.
identitySource string The source of the identity in an incoming request.
type CustomAuthorizerType The type of custom authorizer.

authorizationTypeRequired
public readonly authorizationType: AuthorizationType;
  • Type: aws-cdk-lib.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

The unique identifier for the authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]

Scopes for the authorizer, if any.


authorizerResultTtlInSecondsRequired
public readonly authorizerResultTtlInSeconds: number;
  • Type: number

The number of seconds during which the authorizer result is cached.


functionRequired
public readonly function: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The lambda function used to authorize requests.


identitySourceRequired
public readonly identitySource: string;
  • Type: string

The source of the identity in an incoming request.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html#cfn-apigateway-authorizer-identitysource


typeRequired
public readonly type: CustomAuthorizerType;

The type of custom authorizer.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html#cfn-apigateway-authorizer-type


CustomIntegrationResponseSet

A custom integration response set where you can specify the responses as you wish.

Initializers

import { CustomIntegrationResponseSet } from '@aws/pdk/type-safe-api'

new CustomIntegrationResponseSet(props: CustomIntegrationResponseSetProps)
Name Type Description
props CustomIntegrationResponseSetProps No description.

propsRequired

Methods

Name Description
render Render the integration responses into the Integration.

render
public render(props: IntegrationRenderProps): {[ key: string ]: ApiGatewayIntegrationResponse}

Render the integration responses into the Integration.

propsRequired

DefaultPassthroughIntegrationResponseSet

An integration response set which adds a passthrough for the default response.

Initializers

import { DefaultPassthroughIntegrationResponseSet } from '@aws/pdk/type-safe-api'

new DefaultPassthroughIntegrationResponseSet(props?: DefaultPassthroughIntegrationResponseSetProps)
Name Type Description
props DefaultPassthroughIntegrationResponseSetProps No description.

propsOptional

Methods

Name Description
render Render the integration responses into the Integration.

render
public render(props: IntegrationRenderProps): {[ key: string ]: ApiGatewayIntegrationResponse}

Render the integration responses into the Integration.

propsRequired

IamAuthorizer

An IAM authorizer.

Initializers

import { IamAuthorizer } from '@aws/pdk/type-safe-api'

new IamAuthorizer()
Name Type Description

Properties

Name Type Description
authorizationType aws-cdk-lib.aws_apigateway.AuthorizationType The type of the authorizer.
authorizerId string The unique identifier for the authorizer.
authorizationScopes string[] Scopes for the authorizer, if any.

authorizationTypeRequired
public readonly authorizationType: AuthorizationType;
  • Type: aws-cdk-lib.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

The unique identifier for the authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]

Scopes for the authorizer, if any.


Integration

An integration for an API operation.

You can extend this to implement your own integration if you like.

Initializers

import { Integration } from '@aws/pdk/type-safe-api'

new Integration()
Name Type Description

Methods

Name Description
grant Grant permissions for the API to invoke the integration.
render Render the integration into an API Gateway OpenAPI extension.

grant
public grant(_props: IntegrationGrantProps): void

Grant permissions for the API to invoke the integration.

_propsRequired

render
public render(props: IntegrationRenderProps): ApiGatewayIntegration

Render the integration into an API Gateway OpenAPI extension.

propsRequired

IntegrationResponseSet

A set of integration responses.

You can extend this to implement your own integration response set

Initializers

import { IntegrationResponseSet } from '@aws/pdk/type-safe-api'

new IntegrationResponseSet()
Name Type Description

Methods

Name Description
render Render the integration responses into the Integration.

render
public render(props: IntegrationRenderProps): {[ key: string ]: ApiGatewayIntegrationResponse}

Render the integration responses into the Integration.

propsRequired

the integration render props (same used in the Integration).


IntegrationResponseSets

Initializers

import { IntegrationResponseSets } from '@aws/pdk/type-safe-api'

new IntegrationResponseSets()
Name Type Description

Static Functions

Name Description
catchAll An integration response set that catches all 4XX and 5XX errors and returns a 500.
composite Combine the provided integration response sets.
custom A custom integration response set where you can specify the responses as you wish.
defaultPassthrough An integration response set which adds a passthrough for the default response.
s3JsonErrorMessage An integration response set that returns the error message from S3 in a "message" property of a JSON object for 400, 403, 404 and 500 errors.

catchAll
import { IntegrationResponseSets } from '@aws/pdk/type-safe-api'

IntegrationResponseSets.catchAll()

An integration response set that catches all 4XX and 5XX errors and returns a 500.

composite
import { IntegrationResponseSets } from '@aws/pdk/type-safe-api'

IntegrationResponseSets.composite(responseSets: IntegrationResponseSet)

Combine the provided integration response sets.

Response sets are combined in order, so later responses will override previous ones for overlapping response status patterns.

responseSetsRequired

custom
import { IntegrationResponseSets } from '@aws/pdk/type-safe-api'

IntegrationResponseSets.custom(props: CustomIntegrationResponseSetProps)

A custom integration response set where you can specify the responses as you wish.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-integration-settings-integration-response.html

propsRequired

defaultPassthrough
import { IntegrationResponseSets } from '@aws/pdk/type-safe-api'

IntegrationResponseSets.defaultPassthrough(props?: DefaultPassthroughIntegrationResponseSetProps)

An integration response set which adds a passthrough for the default response.

propsOptional

s3JsonErrorMessage
import { IntegrationResponseSets } from '@aws/pdk/type-safe-api'

IntegrationResponseSets.s3JsonErrorMessage()

An integration response set that returns the error message from S3 in a "message" property of a JSON object for 400, 403, 404 and 500 errors.

Integrations

A collection of integrations to connect API operations with a backend to service requests.

Initializers

import { Integrations } from '@aws/pdk/type-safe-api'

new Integrations()
Name Type Description

Static Functions

Name Description
lambda An integration that invokes a lambda function to service the request.
mock An integration that returns a hardcoded response.
s3 An integration that can read/write to an S3 bucket.

lambda
import { Integrations } from '@aws/pdk/type-safe-api'

Integrations.lambda(lambdaFunction: IFunction)

An integration that invokes a lambda function to service the request.

lambdaFunctionRequired
  • Type: aws-cdk-lib.aws_lambda.IFunction

the function to invoke.


mock
import { Integrations } from '@aws/pdk/type-safe-api'

Integrations.mock(response: MockIntegrationResponse)

An integration that returns a hardcoded response.

responseRequired

the response to return.


s3
import { Integrations } from '@aws/pdk/type-safe-api'

Integrations.s3(props: S3IntegrationProps)

An integration that can read/write to an S3 bucket.

https://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html

propsRequired

the integration props.


LambdaIntegration

A lambda integration.

Initializers

import { LambdaIntegration } from '@aws/pdk/type-safe-api'

new LambdaIntegration(lambdaFunction: IFunction)
Name Type Description
lambdaFunction aws-cdk-lib.aws_lambda.IFunction No description.

lambdaFunctionRequired
  • Type: aws-cdk-lib.aws_lambda.IFunction

Methods

Name Description
grant Grant API Gateway permissions to invoke the lambda.
render Render the lambda integration as a snippet of OpenAPI.

grant
public grant(__0: IntegrationGrantProps): void

Grant API Gateway permissions to invoke the lambda.

__0Required

render
public render(_props: IntegrationRenderProps): ApiGatewayIntegration

Render the lambda integration as a snippet of OpenAPI.

_propsRequired

MockIntegration

A mock integration to return a hardcoded response.

https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-mock-integration.html

Initializers

import { MockIntegration } from '@aws/pdk/type-safe-api'

new MockIntegration(props: MockIntegrationResponse)
Name Type Description
props MockIntegrationResponse No description.

propsRequired

Methods

Name Description
grant Grant permissions for the API to invoke the integration.
render Render the integration into an API Gateway OpenAPI extension.

grant
public grant(_props: IntegrationGrantProps): void

Grant permissions for the API to invoke the integration.

_propsRequired

render
public render(props: IntegrationRenderProps): ApiGatewayIntegration

Render the integration into an API Gateway OpenAPI extension.

propsRequired

NoneAuthorizer

No authorizer.

Initializers

import { NoneAuthorizer } from '@aws/pdk/type-safe-api'

new NoneAuthorizer()
Name Type Description

Properties

Name Type Description
authorizationType aws-cdk-lib.aws_apigateway.AuthorizationType The type of the authorizer.
authorizerId string The unique identifier for the authorizer.
authorizationScopes string[] Scopes for the authorizer, if any.

authorizationTypeRequired
public readonly authorizationType: AuthorizationType;
  • Type: aws-cdk-lib.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizerIdRequired
public readonly authorizerId: string;
  • Type: string

The unique identifier for the authorizer.


authorizationScopesOptional
public readonly authorizationScopes: string[];
  • Type: string[]

Scopes for the authorizer, if any.


S3Integration

An S3 integration.

https://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html

Initializers

import { S3Integration } from '@aws/pdk/type-safe-api'

new S3Integration(props: S3IntegrationProps)
Name Type Description
props S3IntegrationProps No description.

propsRequired

Methods

Name Description
grant Grant API Gateway permissions to invoke the S3 bucket.
render Render the S3 integration as a snippet of OpenAPI.

grant
public grant(__0: IntegrationGrantProps): void

Grant API Gateway permissions to invoke the S3 bucket.

__0Required

render
public render(props: IntegrationRenderProps): ApiGatewayIntegration

Render the S3 integration as a snippet of OpenAPI.

propsRequired

S3JsonErrorMessageIntegrationResponseSet

An integration response set for S3 errors, that returns a JSON payload with the S3 error message.

Initializers

import { S3JsonErrorMessageIntegrationResponseSet } from '@aws/pdk/type-safe-api'

new S3JsonErrorMessageIntegrationResponseSet()
Name Type Description

Methods

Name Description
render Render the integration responses into the Integration.

render
public render(props: IntegrationRenderProps): {[ key: string ]: ApiGatewayIntegrationResponse}

Render the integration responses into the Integration.

propsRequired

Enums

Architecture

Represents an instruction set architecture.

Members

Name Description
X86_64 64-bit x86 architecture.
ARM_64 64-bit ARM architecture.

X86_64

64-bit x86 architecture.


ARM_64

64-bit ARM architecture.


CustomAuthorizerType

The type of custom authorizer.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html#cfn-apigateway-authorizer-type

Members

Name Description
TOKEN A custom authorizer that uses a Lambda function.
REQUEST An authorizer that uses a Lambda function using incoming request parameters.

TOKEN

A custom authorizer that uses a Lambda function.


REQUEST

An authorizer that uses a Lambda function using incoming request parameters.


DocumentationFormat

Formats for documentation generation.

Members

Name Description
HTML_REDOC HTML Documentation generated by redoc.
MARKDOWN Markdown documentation.
PLANTUML PlantUML schema diagrams.

HTML_REDOC

HTML Documentation generated by redoc.

Redocly/redoc


MARKDOWN

Markdown documentation.


PLANTUML

PlantUML schema diagrams.


JavaVersion

Versions of java.

Members

Name Description
JAVA_8 No description.
JAVA_11 No description.
JAVA_17 No description.
JAVA_21 No description.

JAVA_8

JAVA_11

JAVA_17

JAVA_21

Language

Supported languages for runtimes and infrastructure.

Members

Name Description
TYPESCRIPT No description.
PYTHON No description.
JAVA No description.

TYPESCRIPT

PYTHON

JAVA

Library

Supported libraries for code generation.

Members

Name Description
TYPESCRIPT_REACT_QUERY_HOOKS No description.

TYPESCRIPT_REACT_QUERY_HOOKS

ModelLanguage

The model definition language.

Members

Name Description
SMITHY Smithy.
OPENAPI OpenAPI.
TYPESPEC TypeSpec.

SMITHY

Smithy.

https://smithy.io/2.0/


OPENAPI

OpenAPI.

https://www.openapis.org/


TYPESPEC

TypeSpec.

https://typespec.io/


NodeVersion

Versions of node.

Members

Name Description
NODE_18 No description.
NODE_20 No description.

NODE_18

NODE_20

PythonVersion

Versions of python.

Members

Name Description
PYTHON_3_11 No description.
PYTHON_3_12 No description.

PYTHON_3_11

PYTHON_3_12

WebSocketDocumentationFormat

Formats for WebSocket documentation generation.

Members

Name Description
HTML HTML Documentation generated by AsyncAPI's HTML Template.
MARKDOWN Markdown Documentation generated by AsyncAPI's Markdown Template.

HTML

HTML Documentation generated by AsyncAPI's HTML Template.

asyncapi/html-template


MARKDOWN

Markdown Documentation generated by AsyncAPI's Markdown Template.

asyncapi/markdown-template


WebSocketLibrary

Members

Name Description
TYPESCRIPT_WEBSOCKET_CLIENT No description.
TYPESCRIPT_WEBSOCKET_HOOKS No description.

TYPESCRIPT_WEBSOCKET_CLIENT

TYPESCRIPT_WEBSOCKET_HOOKS


Last update: 2024-10-30