Skip to content

API Reference

Constructs

OpenApiAsyncDefinition

The OpenAPI Spec.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncDefinition(
  project: Project,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.Project No description.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.Project

open_api_optionsRequired

Options for the openapi model.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

Path to the root OpenAPI specification file.


OpenApiAsyncModelProject

Project for defining an OpenAPI model for a WebSocket API.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncModelProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str,
  async_api_spec_file: str
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


open_api_optionsRequired

Options for the openapi model.


handler_languagesOptional

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


async_api_spec_fileRequired
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncModelProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncModelProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
api_name str Name of the API.
definition OpenApiAsyncDefinition OpenAPI specification component.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


api_nameRequired
api_name: str
  • Type: str

Name of the API.


definitionRequired
definition: OpenApiAsyncDefinition

OpenAPI specification component.


Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiDefinition(
  project: Project,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.Project No description.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.Project

open_api_optionsRequired

Options for the openapi model.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

Path to the root OpenAPI specification file.


OpenApiModelProject

Project for defining an OpenAPI model for a REST API.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiModelProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


open_api_optionsRequired

Options for the openapi model.


handler_languagesOptional

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiModelProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiModelProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
api_name str Name of the API.
definition OpenApiDefinition OpenAPI specification component.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


api_nameRequired
api_name: str
  • Type: str

Name of the API.


definitionRequired
definition: OpenApiDefinition

OpenAPI specification component.


Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiProjectDefinition(
  project: Project,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.Project No description.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.Project

open_api_optionsRequired

Options for the openapi model.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiProjectDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiProjectDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

Path to the root OpenAPI specification file.


SmithyAsyncModelProject

Smithy model project for a WebSocket API.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyAsyncModelProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  smithy_options: SmithyModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str,
  async_api_spec_file: str
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
smithy_options SmithyModelOptions Smithy engine options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


smithy_optionsRequired

Smithy engine options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


async_api_spec_fileRequired
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.
add_smithy_deps Add a dependency on other smithy projects.
smithy_project_definition Returns the smithy project definition.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


add_smithy_deps
def add_smithy_deps(
  deps: SmithyBaseProject
) -> None

Add a dependency on other smithy projects.

depsRequired

smithy_project_definition
def smithy_project_definition() -> SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyAsyncModelProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyAsyncModelProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
api_name str Name of the API.
definition SmithyServiceProjectDefinition Smithy model and build settings.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


api_nameRequired
api_name: str
  • Type: str

Name of the API.


definitionRequired
definition: SmithyServiceProjectDefinition

Smithy model and build settings.


Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyBaseProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.
add_smithy_deps Add a dependency on other smithy projects.
smithy_project_definition Returns the smithy project definition.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


add_smithy_deps
def add_smithy_deps(
  deps: SmithyBaseProject
) -> None

Add a dependency on other smithy projects.

depsRequired

smithy_project_definition
def smithy_project_definition() -> SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyBaseProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyBaseProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyModelProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  smithy_options: SmithyModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
smithy_options SmithyModelOptions Smithy engine options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


smithy_optionsRequired

Smithy engine options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.
add_smithy_deps Add a dependency on other smithy projects.
smithy_project_definition Returns the smithy project definition.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


add_smithy_deps
def add_smithy_deps(
  deps: SmithyBaseProject
) -> None

Add a dependency on other smithy projects.

depsRequired

smithy_project_definition
def smithy_project_definition() -> SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyModelProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyModelProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
api_name str Name of the API.
definition SmithyServiceProjectDefinition Smithy model and build settings.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


api_nameRequired
api_name: str
  • Type: str

Name of the API.


definitionRequired
definition: SmithyServiceProjectDefinition

Smithy model and build settings.


Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyProjectDefinition(
  project: Project,
  ignore_gradle_wrapper: bool = None,
  ignore_smithy_build_output: bool = None,
  smithy_build_options: SmithyBuildOptions = None
)
Name Type Description
project projen.Project No description.
ignore_gradle_wrapper bool Set to false if you would like to check in your gradle wrapper.
ignore_smithy_build_output bool 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.
smithy_build_options SmithyBuildOptions Smithy build options.

projectRequired
  • Type: projen.Project

ignore_gradle_wrapperOptional
  • Type: bool
  • 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


ignore_smithy_build_outputOptional
  • Type: bool
  • 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.


smithy_build_optionsOptional

Smithy build options.


Methods

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

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

add_deps
def add_deps(
  deps: str
) -> None

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

depsRequired
  • Type: str

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


add_smithy_deps
def add_smithy_deps(
  deps: SmithyProjectDefinition
) -> None

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

depsRequired

smithy definitions to depend on.


add_sources
def add_sources(
  sources: str
) -> None

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: str

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyProjectDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyProjectDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
gradle_project_name str Name of the gradle project.
model_dir str Directory of model source code.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

gradle_project_nameRequired
gradle_project_name: str
  • Type: str

Name of the gradle project.


model_dirRequired
model_dir: str
  • Type: str

Directory of model source code.


SmithyServiceProjectDefinition

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

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyServiceProjectDefinition(
  project: Project,
  smithy_options: SmithyModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.Project No description.
smithy_options SmithyModelOptions Smithy engine options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.Project

smithy_optionsRequired

Smithy engine options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

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

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

add_deps
def add_deps(
  deps: str
) -> None

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

depsRequired
  • Type: str

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


add_smithy_deps
def add_smithy_deps(
  deps: SmithyProjectDefinition
) -> None

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

depsRequired

smithy definitions to depend on.


add_sources
def add_sources(
  sources: str
) -> None

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: str

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyServiceProjectDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyServiceProjectDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

Name Type Description
node constructs.Node The tree node.
project projen.Project No description.
gradle_project_name str Name of the gradle project.
model_dir str Directory of model source code.
generated_model_dir str Directory of generated model source code.
open_api_specification_path str Path to the generated OpenAPI specification, relative to the project outdir.
smithy_json_model_path str Path to the json Smithy model, relative to the project outdir.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

gradle_project_nameRequired
gradle_project_name: str
  • Type: str

Name of the gradle project.


model_dirRequired
model_dir: str
  • Type: str

Directory of model source code.


generated_model_dirRequired
generated_model_dir: str
  • Type: str

Directory of generated model source code.


open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

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


smithy_json_model_pathRequired
smithy_json_model_path: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyShapeLibraryProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  ignore_gradle_wrapper: bool = None,
  ignore_smithy_build_output: bool = None,
  smithy_build_options: SmithyBuildOptions = None
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
ignore_gradle_wrapper bool Set to false if you would like to check in your gradle wrapper.
ignore_smithy_build_output bool 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.
smithy_build_options SmithyBuildOptions Smithy build options.

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


ignore_gradle_wrapperOptional
  • Type: bool
  • 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


ignore_smithy_build_outputOptional
  • Type: bool
  • 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.


smithy_build_optionsOptional

Smithy build options.


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.
add_smithy_deps Add a dependency on other smithy projects.
smithy_project_definition Returns the smithy project definition.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


add_smithy_deps
def add_smithy_deps(
  deps: SmithyBaseProject
) -> None

Add a dependency on other smithy projects.

depsRequired

smithy_project_definition
def smithy_project_definition() -> SmithyProjectDefinition

Returns the smithy project definition.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyShapeLibraryProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyShapeLibraryProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project 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
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


definitionRequired
definition: SmithyProjectDefinition

Smithy model and build settings.


Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction(
  scope: Construct,
  id: str,
  max_event_age: Duration = None,
  on_failure: IDestination = None,
  on_success: IDestination = None,
  retry_attempts: typing.Union[int, float] = None,
  adot_instrumentation: AdotInstrumentationConfig = None,
  allow_all_ipv6_outbound: bool = None,
  allow_all_outbound: bool = None,
  allow_public_subnet: bool = None,
  application_log_level: str = None,
  application_log_level_v2: ApplicationLogLevel = None,
  architecture: Architecture = None,
  code_signing_config: ICodeSigningConfig = None,
  current_version_options: VersionOptions = None,
  dead_letter_queue: IQueue = None,
  dead_letter_queue_enabled: bool = None,
  dead_letter_topic: ITopic = None,
  description: str = None,
  environment: typing.Mapping[str] = None,
  environment_encryption: IKey = None,
  ephemeral_storage_size: Size = None,
  events: typing.List[IEventSource] = None,
  filesystem: FileSystem = None,
  function_name: str = None,
  initial_policy: typing.List[PolicyStatement] = None,
  insights_version: LambdaInsightsVersion = None,
  ipv6_allowed_for_dual_stack: bool = None,
  layers: typing.List[ILayerVersion] = None,
  log_format: str = None,
  logging_format: LoggingFormat = None,
  log_group: ILogGroup = None,
  log_retention: RetentionDays = None,
  log_retention_retry_options: LogRetentionRetryOptions = None,
  log_retention_role: IRole = None,
  memory_size: typing.Union[int, float] = None,
  params_and_secrets: ParamsAndSecretsLayerVersion = None,
  profiling: bool = None,
  profiling_group: IProfilingGroup = None,
  recursive_loop: RecursiveLoop = None,
  reserved_concurrent_executions: typing.Union[int, float] = None,
  role: IRole = None,
  runtime_management_mode: RuntimeManagementMode = None,
  security_groups: typing.List[ISecurityGroup] = None,
  snap_start: SnapStartConf = None,
  system_log_level: str = None,
  system_log_level_v2: SystemLogLevel = None,
  timeout: Duration = None,
  tracing: Tracing = None,
  vpc: IVpc = None,
  vpc_subnets: SubnetSelection = None,
  code: Code,
  handler: str,
  runtime: Runtime,
  disable_snap_start: bool = None
)
Name Type Description
scope constructs.Construct No description.
id str No description.
max_event_age aws_cdk.Duration The maximum age of a request that Lambda sends to a function for processing.
on_failure aws_cdk.aws_lambda.IDestination The destination for failed invocations.
on_success aws_cdk.aws_lambda.IDestination The destination for successful invocations.
retry_attempts typing.Union[int, float] The maximum number of times to retry when the function returns an error.
adot_instrumentation aws_cdk.aws_lambda.AdotInstrumentationConfig Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
allow_all_ipv6_outbound bool Whether to allow the Lambda to send all ipv6 network traffic.
allow_all_outbound bool Whether to allow the Lambda to send all network traffic (except ipv6).
allow_public_subnet bool Lambda Functions in a public subnet can NOT access the internet.
application_log_level str Sets the application log level for the function.
application_log_level_v2 aws_cdk.aws_lambda.ApplicationLogLevel Sets the application log level for the function.
architecture aws_cdk.aws_lambda.Architecture The system architectures compatible with this lambda function.
code_signing_config aws_cdk.aws_lambda.ICodeSigningConfig Code signing config associated with this function.
current_version_options aws_cdk.aws_lambda.VersionOptions Options for the lambda.Version resource automatically created by the fn.currentVersion method.
dead_letter_queue aws_cdk.aws_sqs.IQueue The SQS queue to use if DLQ is enabled.
dead_letter_queue_enabled bool Enabled DLQ.
dead_letter_topic aws_cdk.aws_sns.ITopic The SNS topic to use as a DLQ.
description str A description of the function.
environment typing.Mapping[str] Key-value pairs that Lambda caches and makes available for your Lambda functions.
environment_encryption aws_cdk.aws_kms.IKey The AWS KMS key that's used to encrypt your function's environment variables.
ephemeral_storage_size aws_cdk.Size The size of the function’s /tmp directory in MiB.
events typing.List[aws_cdk.aws_lambda.IEventSource] Event sources for this function.
filesystem aws_cdk.aws_lambda.FileSystem The filesystem configuration for the lambda function.
function_name str A name for the function.
initial_policy typing.List[aws_cdk.aws_iam.PolicyStatement] Initial policy statements to add to the created Lambda Role.
insights_version aws_cdk.aws_lambda.LambdaInsightsVersion Specify the version of CloudWatch Lambda insights to use for monitoring.
ipv6_allowed_for_dual_stack bool Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
layers typing.List[aws_cdk.aws_lambda.ILayerVersion] A list of layers to add to the function's execution environment.
log_format str Sets the logFormat for the function.
logging_format aws_cdk.aws_lambda.LoggingFormat Sets the loggingFormat for the function.
log_group aws_cdk.aws_logs.ILogGroup The log group the function sends logs to.
log_retention aws_cdk.aws_logs.RetentionDays The number of days log events are kept in CloudWatch Logs.
log_retention_retry_options aws_cdk.aws_lambda.LogRetentionRetryOptions When log retention is specified, a custom resource attempts to create the CloudWatch log group.
log_retention_role aws_cdk.aws_iam.IRole The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
memory_size typing.Union[int, float] The amount of memory, in MB, that is allocated to your Lambda function.
params_and_secrets aws_cdk.aws_lambda.ParamsAndSecretsLayerVersion Specify the configuration of Parameters and Secrets Extension.
profiling bool Enable profiling.
profiling_group aws_cdk.aws_codeguruprofiler.IProfilingGroup Profiling Group.
recursive_loop aws_cdk.aws_lambda.RecursiveLoop Sets the Recursive Loop Protection for Lambda Function.
reserved_concurrent_executions typing.Union[int, float] The maximum of concurrent executions you want to reserve for the function.
role aws_cdk.aws_iam.IRole Lambda execution role.
runtime_management_mode aws_cdk.aws_lambda.RuntimeManagementMode Sets the runtime management configuration for a function's version.
security_groups typing.List[aws_cdk.aws_ec2.ISecurityGroup] The list of security groups to associate with the Lambda's network interfaces.
snap_start aws_cdk.aws_lambda.SnapStartConf Enable SnapStart for Lambda Function.
system_log_level str Sets the system log level for the function.
system_log_level_v2 aws_cdk.aws_lambda.SystemLogLevel Sets the system log level for the function.
timeout aws_cdk.Duration The function execution time (in seconds) after which Lambda terminates the function.
tracing aws_cdk.aws_lambda.Tracing Enable AWS X-Ray Tracing for Lambda Function.
vpc aws_cdk.aws_ec2.IVpc VPC network to place Lambda network interfaces.
vpc_subnets aws_cdk.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
code aws_cdk.aws_lambda.Code The source code of your Lambda function.
handler str The name of the method within your code that Lambda calls to execute your function.
runtime aws_cdk.aws_lambda.Runtime The runtime environment for the Lambda function that you are uploading.
disable_snap_start bool When true, disable snap start.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: str

max_event_ageOptional
  • Type: aws_cdk.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


on_failureOptional
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for failed invocations.


on_successOptional
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for successful invocations.


retry_attemptsOptional
  • Type: typing.Union[int, float]
  • Default: 2

The maximum number of times to retry when the function returns an error.

Minimum: 0 Maximum: 2


adot_instrumentationOptional
  • Type: aws_cdk.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


allow_all_ipv6_outboundOptional
  • Type: bool
  • 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.


allow_all_outboundOptional
  • Type: bool
  • 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.


allow_public_subnetOptional
  • Type: bool
  • 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


~~application_log_level~~Optional
  • Deprecated: Use applicationLogLevelV2 as a property instead.

  • Type: str

  • Default: "INFO"

Sets the application log level for the function.


application_log_level_v2Optional
  • Type: aws_cdk.aws_lambda.ApplicationLogLevel
  • Default: ApplicationLogLevel.INFO

Sets the application log level for the function.


architectureOptional
  • Type: aws_cdk.aws_lambda.Architecture
  • Default: Architecture.X86_64

The system architectures compatible with this lambda function.


code_signing_configOptional
  • Type: aws_cdk.aws_lambda.ICodeSigningConfig
  • Default: Not Sign the Code

Code signing config associated with this function.


current_version_optionsOptional
  • Type: aws_cdk.aws_lambda.VersionOptions
  • Default: default options as described in VersionOptions

Options for the lambda.Version resource automatically created by the fn.currentVersion method.


dead_letter_queueOptional
  • Type: aws_cdk.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.


dead_letter_queue_enabledOptional
  • Type: bool
  • 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.


dead_letter_topicOptional
  • Type: aws_cdk.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
  • Type: str
  • Default: No description.

A description of the function.


environmentOptional
  • Type: typing.Mapping[str]
  • 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.


environment_encryptionOptional
  • Type: aws_cdk.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.


ephemeral_storage_sizeOptional
  • Type: aws_cdk.Size
  • Default: 512 MiB

The size of the function’s /tmp directory in MiB.


eventsOptional
  • Type: typing.List[aws_cdk.aws_lambda.IEventSource]
  • Default: No event sources.

Event sources for this function.

You can also add event sources using addEventSource.


filesystemOptional
  • Type: aws_cdk.aws_lambda.FileSystem
  • Default: will not mount any filesystem

The filesystem configuration for the lambda function.


function_nameOptional
  • Type: str
  • 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.


initial_policyOptional
  • Type: typing.List[aws_cdk.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.


insights_versionOptional
  • Type: aws_cdk.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


ipv6_allowed_for_dual_stackOptional
  • Type: bool
  • Default: false

Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

Only used if 'vpc' is supplied.


layersOptional
  • Type: typing.List[aws_cdk.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.


~~log_format~~Optional
  • Deprecated: Use loggingFormat as a property instead.

  • Type: str

  • Default: "Text"

Sets the logFormat for the function.


logging_formatOptional
  • Type: aws_cdk.aws_lambda.LoggingFormat
  • Default: LoggingFormat.TEXT

Sets the loggingFormat for the function.


log_groupOptional
  • Type: aws_cdk.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.


log_retentionOptional
  • Type: aws_cdk.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;


log_retention_retry_optionsOptional
  • Type: aws_cdk.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.


log_retention_roleOptional
  • Type: aws_cdk.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.


memory_sizeOptional
  • Type: typing.Union[int, float]
  • 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.


params_and_secretsOptional
  • Type: aws_cdk.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
  • Type: bool
  • Default: No profiling.

Enable profiling.

https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html


profiling_groupOptional
  • Type: aws_cdk.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


recursive_loopOptional
  • Type: aws_cdk.aws_lambda.RecursiveLoop
  • Default: RecursiveLoop.Terminate

Sets the Recursive Loop Protection for Lambda Function.

It lets Lambda detect and terminate unintended recusrive loops.


reserved_concurrent_executionsOptional
  • Type: typing.Union[int, float]
  • 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
  • Type: aws_cdk.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".


runtime_management_modeOptional
  • Type: aws_cdk.aws_lambda.RuntimeManagementMode
  • Default: Auto

Sets the runtime management configuration for a function's version.


security_groupsOptional
  • Type: typing.List[aws_cdk.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.


snap_startOptional
  • Type: aws_cdk.aws_lambda.SnapStartConf
  • Default: No snapstart

Enable SnapStart for Lambda Function.

SnapStart is currently supported only for Java 11, 17 runtime


~~system_log_level~~Optional
  • Deprecated: Use systemLogLevelV2 as a property instead.

  • Type: str

  • Default: "INFO"

Sets the system log level for the function.


system_log_level_v2Optional
  • Type: aws_cdk.aws_lambda.SystemLogLevel
  • Default: SystemLogLevel.INFO

Sets the system log level for the function.


timeoutOptional
  • Type: aws_cdk.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
  • Type: aws_cdk.aws_lambda.Tracing
  • Default: Tracing.Disabled

Enable AWS X-Ray Tracing for Lambda Function.


vpcOptional
  • Type: aws_cdk.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.


vpc_subnetsOptional
  • Type: aws_cdk.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
  • Type: aws_cdk.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
  • Type: str

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
  • Type: aws_cdk.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.


disable_snap_startOptional
  • Type: bool
  • Default: false

When true, disable snap start.


Methods

Name Description
to_string Returns a string representation of this construct.
apply_removal_policy Apply the given removal policy to this resource.
add_event_source Adds an event source to this function.
add_event_source_mapping Adds an event source that maps to this AWS Lambda function.
add_function_url Adds a url to this lambda function.
add_permission Adds a permission to the Lambda resource policy.
add_to_role_policy Adds a statement to the IAM role assumed by the instance.
configure_async_invoke Configures options for asynchronous invocation.
consider_warning_on_invoke_function_permissions A warning will be added to functions under the following conditions: - permissions that include lambda:InvokeFunction are added to the unqualified function.
grant_invoke Grant the given identity permissions to invoke this Lambda.
grant_invoke_composite_principal Grant multiple principals the ability to invoke this Lambda via CompositePrincipal.
grant_invoke_latest_version Grant the given identity permissions to invoke the $LATEST version or unqualified version of this Lambda.
grant_invoke_url Grant the given identity permissions to invoke this Lambda Function URL.
grant_invoke_version Grant the given identity permissions to invoke the given version of this Lambda.
metric Return the given named metric for this Function.
metric_duration How long execution of this Lambda takes.
metric_errors How many invocations of this Lambda fail.
metric_invocations How often this Lambda is invoked.
metric_throttles How often this Lambda is throttled.
add_alias Defines an alias for this function.
add_environment Adds an environment variable to this Lambda function.
add_layers Adds one or more Lambda Layers to this Lambda function.
invalidate_version_based_on Mix additional information into the hash of the Version object.

to_string
def to_string() -> str

Returns a string representation of this construct.

apply_removal_policy
def apply_removal_policy(
  policy: RemovalPolicy
) -> None

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

add_event_source
def add_event_source(
  source: IEventSource
) -> None

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.aws_lambda.IEventSource

add_event_source_mapping
def add_event_source_mapping(
  id: str,
  batch_size: typing.Union[int, float] = None,
  bisect_batch_on_error: bool = None,
  enabled: bool = None,
  event_source_arn: str = None,
  filter_encryption: IKey = None,
  filters: typing.List[typing.Mapping[typing.Any]] = None,
  kafka_bootstrap_servers: typing.List[str] = None,
  kafka_consumer_group_id: str = None,
  kafka_topic: str = None,
  max_batching_window: Duration = None,
  max_concurrency: typing.Union[int, float] = None,
  max_record_age: Duration = None,
  on_failure: IEventSourceDlq = None,
  parallelization_factor: typing.Union[int, float] = None,
  report_batch_item_failures: bool = None,
  retry_attempts: typing.Union[int, float] = None,
  source_access_configurations: typing.List[SourceAccessConfiguration] = None,
  starting_position: StartingPosition = None,
  starting_position_timestamp: typing.Union[int, float] = None,
  support_s3_on_failure_destination: bool = None,
  tumbling_window: Duration = None
) -> EventSourceMapping

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

idRequired
  • Type: str

batch_sizeOptional
  • Type: typing.Union[int, float]
  • Default: Amazon Kinesis, Amazon DynamoDB, and Amazon MSK is 100 records. The default for Amazon SQS is 10 messages. For standard SQS queues, the maximum is 10,000. For FIFO SQS queues, the maximum is 10.

The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.

Your function receives an event with all the retrieved records.

Valid Range: Minimum value of 1. Maximum value of 10000.


bisect_batch_on_errorOptional
  • Type: bool
  • Default: false

If the function returns an error, split the batch in two and retry.


enabledOptional
  • Type: bool
  • Default: true

Set to false to disable the event source upon creation.


event_source_arnOptional
  • Type: str
  • Default: not set if using a self managed Kafka cluster, throws an error otherwise

The Amazon Resource Name (ARN) of the event source.

Any record added to this stream can invoke the Lambda function.


filter_encryptionOptional
  • Type: aws_cdk.aws_kms.IKey
  • Default: none

Add Customer managed KMS key to encrypt Filter Criteria.

https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk


filtersOptional
  • Type: typing.List[typing.Mapping[typing.Any]]
  • Default: none

Add filter criteria to Event Source.

https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html


kafka_bootstrap_serversOptional
  • Type: typing.List[str]
  • Default: none

A list of host and port pairs that are the addresses of the Kafka brokers in a self managed "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself.

They are in the format abc.example.com:9096.


kafka_consumer_group_idOptional
  • Type: str
  • Default: none

The identifier for the Kafka consumer group to join.

The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-\/:_+=.@-]'. For more information, see Customizable consumer group ID.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedkafkaeventsourceconfig.html


kafka_topicOptional
  • Type: str
  • Default: no topic

The name of the Kafka topic.


max_batching_windowOptional
  • Type: aws_cdk.Duration
  • Default: Duration.seconds(0)

The maximum amount of time to gather records before invoking the function.

Maximum of Duration.minutes(5)


max_concurrencyOptional
  • Type: typing.Union[int, float]
  • Default: No specific limit.

The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.

[https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency

Valid Range: Minimum value of 2. Maximum value of 1000.](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency

Valid Range: Minimum value of 2. Maximum value of 1000.)


max_record_ageOptional
  • Type: aws_cdk.Duration
  • Default: infinite or until the record expires.

The maximum age of a record that Lambda sends to a function for processing.

Valid Range: * Minimum value of 60 seconds * Maximum value of 7 days


on_failureOptional
  • Type: aws_cdk.aws_lambda.IEventSourceDlq
  • Default: discarded records are ignored

An Amazon SQS queue or Amazon SNS topic destination for discarded records.


parallelization_factorOptional
  • Type: typing.Union[int, float]
  • Default: 1

The number of batches to process from each shard concurrently.

Valid Range: * Minimum value of 1 * Maximum value of 10


report_batch_item_failuresOptional
  • Type: bool
  • Default: false

Allow functions to return partially successful responses for a batch of records.

https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting


retry_attemptsOptional
  • Type: typing.Union[int, float]
  • Default: infinite or until the record expires.

The maximum number of times to retry when the function returns an error.

Set to undefined if you want lambda to keep retrying infinitely or until the record expires.

Valid Range: * Minimum value of 0 * Maximum value of 10000


source_access_configurationsOptional
  • Type: typing.List[aws_cdk.aws_lambda.SourceAccessConfiguration]
  • Default: none

Specific settings like the authentication protocol or the VPC components to secure access to your event source.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html


starting_positionOptional
  • Type: aws_cdk.aws_lambda.StartingPosition
  • Default: no starting position

The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.

https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType


starting_position_timestampOptional
  • Type: typing.Union[int, float]
  • Default: no timestamp

The time from which to start reading, in Unix time seconds.


support_s3_on_failure_destinationOptional
  • Type: bool
  • Default: false

Check if support S3 onfailure destination(ODF).

Currently only MSK and self managed kafka event support S3 ODF


tumbling_windowOptional
  • Type: aws_cdk.Duration
  • Default: None

The size of the tumbling windows to group records sent to DynamoDB or Kinesis.

[https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows

Valid Range: 0 - 15 minutes](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-windows

Valid Range: 0 - 15 minutes)


add_function_url
def add_function_url(
  auth_type: FunctionUrlAuthType = None,
  cors: FunctionUrlCorsOptions = None,
  invoke_mode: InvokeMode = None
) -> FunctionUrl

Adds a url to this lambda function.

auth_typeOptional
  • Type: aws_cdk.aws_lambda.FunctionUrlAuthType
  • Default: FunctionUrlAuthType.AWS_IAM

The type of authentication that your function URL uses.


corsOptional
  • Type: aws_cdk.aws_lambda.FunctionUrlCorsOptions
  • Default: No CORS configuration.

The cross-origin resource sharing (CORS) settings for your function URL.


invoke_modeOptional
  • Type: aws_cdk.aws_lambda.InvokeMode
  • Default: InvokeMode.BUFFERED

The type of invocation mode that your Lambda function uses.


add_permission
def add_permission(
  id: str,
  principal: IPrincipal,
  action: str = None,
  event_source_token: str = None,
  function_url_auth_type: FunctionUrlAuthType = None,
  organization_id: str = None,
  scope: Construct = None,
  source_account: str = None,
  source_arn: str = None
) -> None

Adds a permission to the Lambda resource policy.

Permission for details.

idRequired
  • Type: str

The id for the permission construct.


principalRequired
  • Type: aws_cdk.aws_iam.IPrincipal

The entity for which you are granting permission to invoke the Lambda function.

This entity can be any of the following:

  • a valid AWS service principal, such as s3.amazonaws.com or sns.amazonaws.com
  • an AWS account ID for cross-account permissions. For example, you might want to allow a custom application in another AWS account to push events to Lambda by invoking your function.
  • an AWS organization principal to grant permissions to an entire organization.

The principal can be an AccountPrincipal, an ArnPrincipal, a ServicePrincipal, or an OrganizationPrincipal.


actionOptional
  • Type: str
  • Default: 'lambda:InvokeFunction'

The Lambda actions that you want to allow in this statement.

For example, you can specify lambda:CreateFunction to specify a certain action, or use a wildcard (lambda:*) to grant permission to all Lambda actions. For a list of actions, see Actions and Condition Context Keys for AWS Lambda in the IAM User Guide.


event_source_tokenOptional
  • Type: str
  • Default: The caller would not need to present a token.

A unique token that must be supplied by the principal invoking the function.


function_url_auth_typeOptional
  • Type: aws_cdk.aws_lambda.FunctionUrlAuthType
  • Default: No functionUrlAuthType

The authType for the function URL that you are granting permissions for.


organization_idOptional
  • Type: str
  • Default: No organizationId

The organization you want to grant permissions to.

Use this ONLY if you need to grant permissions to a subset of the organization. If you want to grant permissions to the entire organization, sending the organization principal through the principal property will suffice.

You can use this property to ensure that all source principals are owned by a specific organization.


scopeOptional
  • Type: constructs.Construct
  • Default: The instance of lambda.IFunction

The scope to which the permission constructs be attached.

The default is the Lambda function construct itself, but this would need to be different in cases such as cross-stack references where the Permissions would need to sit closer to the consumer of this permission (i.e., the caller).


source_accountOptional
  • Type: str

The AWS account ID (without hyphens) of the source owner.

For example, if you specify an S3 bucket in the SourceArn property, this value is the bucket owner's account ID. You can use this property to ensure that all source principals are owned by a specific account.


source_arnOptional
  • Type: str

The ARN of a resource that is invoking your function.

When granting Amazon Simple Storage Service (Amazon S3) permission to invoke your function, specify this property with the bucket ARN as its value. This ensures that events generated only from the specified bucket, not just any bucket from any AWS account that creates a mapping to your function, can invoke the function.


add_to_role_policy
def add_to_role_policy(
  statement: PolicyStatement
) -> None

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

statementRequired
  • Type: aws_cdk.aws_iam.PolicyStatement

configure_async_invoke
def configure_async_invoke(
  max_event_age: Duration = None,
  on_failure: IDestination = None,
  on_success: IDestination = None,
  retry_attempts: typing.Union[int, float] = None
) -> None

Configures options for asynchronous invocation.

max_event_ageOptional
  • Type: aws_cdk.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


on_failureOptional
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for failed invocations.


on_successOptional
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for successful invocations.


retry_attemptsOptional
  • Type: typing.Union[int, float]
  • Default: 2

The maximum number of times to retry when the function returns an error.

Minimum: 0 Maximum: 2


consider_warning_on_invoke_function_permissions
def consider_warning_on_invoke_function_permissions(
  scope: Construct,
  action: str
) -> None

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: str

grant_invoke
def grant_invoke(
  grantee: IGrantable
) -> Grant

Grant the given identity permissions to invoke this Lambda.

granteeRequired
  • Type: aws_cdk.aws_iam.IGrantable

grant_invoke_composite_principal
def grant_invoke_composite_principal(
  composite_principal: CompositePrincipal
) -> typing.List[Grant]

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

composite_principalRequired
  • Type: aws_cdk.aws_iam.CompositePrincipal

grant_invoke_latest_version
def grant_invoke_latest_version(
  grantee: IGrantable
) -> Grant

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

granteeRequired
  • Type: aws_cdk.aws_iam.IGrantable

grant_invoke_url
def grant_invoke_url(
  grantee: IGrantable
) -> Grant

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

granteeRequired
  • Type: aws_cdk.aws_iam.IGrantable

grant_invoke_version
def grant_invoke_version(
  grantee: IGrantable,
  version: IVersion
) -> Grant

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

granteeRequired
  • Type: aws_cdk.aws_iam.IGrantable

versionRequired
  • Type: aws_cdk.aws_lambda.IVersion

metric
def metric(
  metric_name: str,
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
) -> Metric

Return the given named metric for this Function.

metric_nameRequired
  • Type: str

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_duration
def metric_duration(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
) -> Metric

How long execution of this Lambda takes.

Average over 5 minutes

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_errors
def metric_errors(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
) -> Metric

How many invocations of this Lambda fail.

Sum over 5 minutes

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_invocations
def metric_invocations(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
) -> Metric

How often this Lambda is invoked.

Sum over 5 minutes

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_throttles
def metric_throttles(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
) -> Metric

How often this Lambda is throttled.

Sum over 5 minutes

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


add_alias
def add_alias(
  alias_name: str,
  max_event_age: Duration = None,
  on_failure: IDestination = None,
  on_success: IDestination = None,
  retry_attempts: typing.Union[int, float] = None,
  additional_versions: typing.List[VersionWeight] = None,
  description: str = None,
  provisioned_concurrent_executions: typing.Union[int, float] = None
) -> 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,
});
alias_nameRequired
  • Type: str

The name of the alias.


max_event_ageOptional
  • Type: aws_cdk.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


on_failureOptional
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for failed invocations.


on_successOptional
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for successful invocations.


retry_attemptsOptional
  • Type: typing.Union[int, float]
  • Default: 2

The maximum number of times to retry when the function returns an error.

Minimum: 0 Maximum: 2


additional_versionsOptional
  • Type: typing.List[aws_cdk.aws_lambda.VersionWeight]
  • Default: No additional versions

Additional versions with individual weights this alias points to.

Individual additional version weights specified here should add up to (less than) one. All remaining weight is routed to the default version.

For example, the config is

version: "1" additionalVersions: [{ version: "2", weight: 0.05 }]

Then 5% of traffic will be routed to function version 2, while the remaining 95% of traffic will be routed to function version 1.


descriptionOptional
  • Type: str
  • Default: No description

Description for the alias.


provisioned_concurrent_executionsOptional
  • Type: typing.Union[int, float]
  • Default: No provisioned concurrency

Specifies a provisioned concurrency configuration for a function's alias.


add_environment
def add_environment(
  key: str,
  value: str,
  remove_in_edge: bool = None
) -> 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: str

The environment variable key.


valueRequired
  • Type: str

The environment variable's value.


remove_in_edgeOptional
  • Type: bool
  • Default: false - using the function in Lambda@Edge will throw

When used in Lambda@Edge via edgeArn() API, these environment variables will be removed.

If not set, an error will be thrown.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html#lambda-requirements-lambda-function-configuration


add_layers
def add_layers(
  layers: ILayerVersion
) -> None

Adds one or more Lambda Layers to this Lambda function.

layersRequired
  • Type: aws_cdk.aws_lambda.ILayerVersion

the layers to be added.


invalidate_version_based_on
def invalidate_version_based_on(
  x: str
) -> None

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: str

Static Functions

Name Description
is_construct Checks if x is a construct.
is_owned_resource Returns true if the construct was created by CDK, and false otherwise.
is_resource Check whether the given construct is a Resource.
classify_version_property Record whether specific properties in the AWS::Lambda::Function resource should also be associated to the Version resource.
from_function_arn Import a lambda function into the CDK using its ARN.
from_function_attributes Creates a Lambda function object which represents a function not defined within this stack.
from_function_name Import a lambda function into the CDK using its name.
metric_all Return the given named metric for this Lambda.
metric_all_concurrent_executions Metric for the number of concurrent executions across all Lambdas.
metric_all_duration Metric for the Duration executing all Lambdas.
metric_all_errors Metric for the number of Errors executing all Lambdas.
metric_all_invocations Metric for the number of invocations of all Lambdas.
metric_all_throttles Metric for the number of throttled invocations of all Lambdas.
metric_all_unreserved_concurrent_executions Metric for the number of unreserved concurrent executions across all Lambdas.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.is_construct(
  x: typing.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: typing.Any

Any object.


is_owned_resource
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.is_owned_resource(
  construct: IConstruct
)

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

constructRequired
  • Type: constructs.IConstruct

is_resource
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.is_resource(
  construct: IConstruct
)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

classify_version_property
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.classify_version_property(
  property_name: str,
  locked: bool
)

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.

property_nameRequired
  • Type: str

The property to classify.


lockedRequired
  • Type: bool

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


from_function_arn
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.from_function_arn(
  scope: Construct,
  id: str,
  function_arn: str
)

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: str

function_arnRequired
  • Type: str

from_function_attributes
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.from_function_attributes(
  scope: Construct,
  id: str,
  function_arn: str,
  architecture: Architecture = None,
  role: IRole = None,
  same_environment: bool = None,
  security_group: ISecurityGroup = None,
  skip_permissions: bool = None
)

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: str

The name of the lambda construct.


function_arnRequired
  • Type: str

The ARN of the Lambda function.

Format: arn::lambda:::function:


architectureOptional
  • Type: aws_cdk.aws_lambda.Architecture
  • Default: Architecture.X86_64

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


roleOptional
  • Type: aws_cdk.aws_iam.IRole

The IAM execution role associated with this function.

If the role is not specified, any role-related operations will no-op.


same_environmentOptional
  • Type: bool
  • Default: depends: true, if the Stack is configured with an explicit env (account and region) and the account is the same as this function. For environment-agnostic stacks this will default to false.

Setting this property informs the CDK that the imported function is in the same environment as the stack.

This affects certain behaviours such as, whether this function's permission can be modified. When not configured, the CDK attempts to auto-determine this. For environment agnostic stacks, i.e., stacks where the account is not specified with the env property, this is determined to be false.

Set this to property ONLY IF the imported function is in the same account as the stack it's imported in.


security_groupOptional
  • Type: aws_cdk.aws_ec2.ISecurityGroup

The security group of this Lambda, if in a VPC.

This needs to be given in order to support allowing connections to this Lambda.


skip_permissionsOptional
  • Type: bool
  • Default: false

Setting this property informs the CDK that the imported function ALREADY HAS the necessary permissions for what you are trying to do.

When not configured, the CDK attempts to auto-determine whether or not additional permissions are necessary on the function when grant APIs are used. If the CDK tried to add permissions on an imported lambda, it will fail.

Set this property ONLY IF you are committing to manage the imported function's permissions outside of CDK. You are acknowledging that your CDK code alone will have insufficient permissions to access the imported function.


from_function_name
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.from_function_name(
  scope: Construct,
  id: str,
  function_name: str
)

Import a lambda function into the CDK using its name.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: str

function_nameRequired
  • Type: str

metric_all
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all(
  metric_name: str,
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

Return the given named metric for this Lambda.

metric_nameRequired
  • Type: str

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_all_concurrent_executions
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all_concurrent_executions(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

Metric for the number of concurrent executions across all Lambdas.

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_all_duration
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all_duration(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

Metric for the Duration executing all Lambdas.

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_all_errors
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all_errors(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

Metric for the number of Errors executing all Lambdas.

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_all_invocations
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all_invocations(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

Metric for the number of invocations of all Lambdas.

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_all_throttles
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all_throttles(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

Metric for the number of throttled invocations of all Lambdas.

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


metric_all_unreserved_concurrent_executions
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunction.metric_all_unreserved_concurrent_executions(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  statistic: str = None,
  unit: Unit = None
)

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

accountOptional
  • Type: str
  • Default: Deployment account.

Account which this metric comes from.


colorOptional
  • Type: str
  • Default: Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.


dimensions_mapOptional
  • Type: typing.Mapping[str]
  • Default: No dimensions.

Dimensions of the metric.


labelOptional
  • Type: str
  • Default: No label

Label for this metric when added to a Graph in a Dashboard.

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.


periodOptional
  • Type: aws_cdk.Duration
  • Default: Duration.minutes(5)

The period over which the specified statistic is applied.


regionOptional
  • Type: str
  • Default: Deployment region.

Region which this metric comes from.


statisticOptional
  • Type: str
  • Default: Average

What function to use for aggregating.

Use the aws_cloudwatch.Stats helper class to construct valid input strings.

Can be one of the following:

  • "Minimum" | "min"
  • "Maximum" | "max"
  • "Average" | "avg"
  • "Sum" | "sum"
  • "SampleCount | "n"
  • "pNN.NN"
  • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  • "iqm"
  • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

unitOptional
  • Type: aws_cdk.aws_cloudwatch.Unit
  • Default: All metric datums in the given metric stream

Unit used to filter the metric stream.

Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.


Properties

Name Type Description
node constructs.Node The tree node.
env aws_cdk.ResourceEnvironment The environment this resource belongs to.
stack aws_cdk.Stack The stack in which this resource is defined.
architecture aws_cdk.aws_lambda.Architecture The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
connections aws_cdk.aws_ec2.Connections Access the Connections object.
function_arn str ARN of this function.
function_name str Name of this function.
grant_principal aws_cdk.aws_iam.IPrincipal The principal this Lambda Function is running as.
is_bound_to_vpc bool Whether or not this Lambda function was bound to a VPC.
latest_version aws_cdk.aws_lambda.IVersion The $LATEST version of this function.
permissions_node constructs.Node The construct node where permissions are attached.
resource_arns_for_grant_invoke typing.List[str] The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
role aws_cdk.aws_iam.IRole Execution role associated with this function.
current_version aws_cdk.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.
log_group aws_cdk.aws_logs.ILogGroup The LogGroup where the Lambda function's logs are made available.
runtime aws_cdk.aws_lambda.Runtime The runtime configured for this lambda.
dead_letter_queue aws_cdk.aws_sqs.IQueue The DLQ (as queue) associated with this Lambda Function (this is an optional attribute).
dead_letter_topic aws_cdk.aws_sns.ITopic The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).
timeout aws_cdk.Duration The timeout configured for this lambda.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


envRequired
env: ResourceEnvironment
  • Type: aws_cdk.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
stack: Stack
  • Type: aws_cdk.Stack

The stack in which this resource is defined.


architectureRequired
architecture: Architecture
  • Type: aws_cdk.aws_lambda.Architecture

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


connectionsRequired
connections: Connections
  • Type: aws_cdk.aws_ec2.Connections

Access the Connections object.

Will fail if not a VPC-enabled Lambda Function


function_arnRequired
function_arn: str
  • Type: str

ARN of this function.


function_nameRequired
function_name: str
  • Type: str

Name of this function.


grant_principalRequired
grant_principal: IPrincipal
  • Type: aws_cdk.aws_iam.IPrincipal

The principal this Lambda Function is running as.


is_bound_to_vpcRequired
is_bound_to_vpc: bool
  • Type: bool

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

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


latest_versionRequired
latest_version: IVersion
  • Type: aws_cdk.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.


permissions_nodeRequired
permissions_node: Node
  • Type: constructs.Node

The construct node where permissions are attached.


resource_arns_for_grant_invokeRequired
resource_arns_for_grant_invoke: typing.List[str]
  • Type: typing.List[str]

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


roleOptional
role: IRole
  • Type: aws_cdk.aws_iam.IRole

Execution role associated with this function.


current_versionRequired
current_version: Version
  • Type: aws_cdk.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.


log_groupRequired
log_group: ILogGroup
  • Type: aws_cdk.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
runtime: Runtime
  • Type: aws_cdk.aws_lambda.Runtime

The runtime configured for this lambda.


dead_letter_queueOptional
dead_letter_queue: IQueue
  • Type: aws_cdk.aws_sqs.IQueue

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


dead_letter_topicOptional
dead_letter_topic: ITopic
  • Type: aws_cdk.aws_sns.ITopic

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


timeoutOptional
timeout: Duration
  • Type: aws_cdk.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuild(
  project: Project,
  async_api_spec_file: str,
  parsed_spec_file: str
)
Name Type Description
project projen.Project No description.
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

projectRequired
  • Type: projen.Project

async_api_spec_fileRequired
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuild.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuild.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiModelBuild(
  project: Project,
  parsed_spec_file: str,
  open_api_specification_path: str,
  smithy_json_model_path: str = None
)
Name Type Description
project projen.Project No description.
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).
open_api_specification_path str Path to the OpenAPI specification.
smithy_json_model_path str Optional path to the Smithy JSON model (for Smithy projects only).

projectRequired
  • Type: projen.Project

parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


open_api_specification_pathRequired
  • Type: str

Path to the OpenAPI specification.


smithy_json_model_pathOptional
  • Type: str

Optional path to the Smithy JSON model (for Smithy projects only).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiModelBuild.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiModelBuild.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  infrastructure: InfrastructureConfiguration,
  model: ModelConfiguration,
  commit_generated_code: bool = None,
  documentation: DocumentationConfiguration = None,
  handlers: HandlersConfiguration = None,
  library: LibraryConfiguration = None,
  runtime: RuntimeConfiguration = None
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
infrastructure InfrastructureConfiguration Configuration for generated infrastructure.
model ModelConfiguration Configuration for the API model.
commit_generated_code bool 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
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


infrastructureRequired

Configuration for generated infrastructure.


modelRequired

Configuration for the API model.


commit_generated_codeOptional
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


documentationOptional

Configuration for generated documentation.


handlersOptional

Configuration for lambda handlers for implementing the API.


libraryOptional

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

Configuration for generated runtime projects (containing types, clients and server code).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project 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
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


allRequired
all: ProjectCollections

Collections of all sub-projects managed by this project.


documentationRequired
documentation: GeneratedDocumentationProjects

Generated documentation projects.

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


handlersRequired
handlers: GeneratedCodeProjects

Lambda handlers projects.

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


infrastructureRequired
infrastructure: GeneratedCodeProjects

Generated infrastructure projects.

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


libraryRequired
library: GeneratedLibraryProjects

Generated library projects.

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


modelRequired
model: ModelProject

Project for the api model.


runtimeRequired
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 str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeRestApi(
  scope: Construct,
  id: str,
  cloud_watch_role: bool = None,
  cloud_watch_role_removal_policy: RemovalPolicy = None,
  deploy: bool = None,
  deploy_options: StageOptions = None,
  description: str = None,
  disable_execute_api_endpoint: bool = None,
  domain_name: DomainNameOptions = None,
  endpoint_export_name: str = None,
  endpoint_types: typing.List[EndpointType] = None,
  fail_on_warnings: bool = None,
  parameters: typing.Mapping[str] = None,
  policy: PolicyDocument = None,
  rest_api_name: str = None,
  retain_deployments: bool = None,
  integrations: typing.Mapping[TypeSafeApiIntegration],
  operation_lookup: typing.Mapping[OperationDetails],
  api_key_options: ApiKeyOptions = None,
  cors_options: CorsOptions = None,
  default_authorizer: Authorizer = None,
  spec_path: str,
  min_compression_size: Size = None,
  output_spec_bucket: IBucket = None,
  web_acl_options: TypeSafeApiWebAclOptions = None
)
Name Type Description
scope constructs.Construct No description.
id str No description.
cloud_watch_role bool Automatically configure an AWS CloudWatch role for API Gateway.
cloud_watch_role_removal_policy aws_cdk.RemovalPolicy The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.
deploy bool Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
deploy_options aws_cdk.aws_apigateway.StageOptions Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.
description str A description of the RestApi construct.
disable_execute_api_endpoint bool Specifies whether clients can invoke the API using the default execute-api endpoint.
domain_name aws_cdk.aws_apigateway.DomainNameOptions Configure a custom domain name and map it to this API.
endpoint_export_name str Export name for the CfnOutput containing the API endpoint.
endpoint_types typing.List[aws_cdk.aws_apigateway.EndpointType] A list of the endpoint types of the API.
fail_on_warnings bool Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters typing.Mapping[str] Custom header parameters for the request.
policy aws_cdk.aws_iam.PolicyDocument A policy document that contains the permissions for this RestApi.
rest_api_name str A name for the API Gateway RestApi resource.
retain_deployments bool Retains old deployment resources when the API changes.
integrations typing.Mapping[TypeSafeApiIntegration] A mapping of API operation to its integration.
operation_lookup typing.Mapping[OperationDetails] Details about each operation.
api_key_options ApiKeyOptions Options for API keys.
cors_options aws_cdk.aws_apigateway.CorsOptions Cross Origin Resource Sharing options for the API.
default_authorizer Authorizer The default authorizer to use for your api.
spec_path str Path to the JSON open api spec.
min_compression_size aws_cdk.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.
output_spec_bucket aws_cdk.aws_s3.IBucket By default, the spec is prepared and outputted into the CDK assets bucket.
web_acl_options TypeSafeApiWebAclOptions Options for the AWS WAF v2 WebACL associated with the api.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: str

cloud_watch_roleOptional
  • Type: bool
  • Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

Automatically configure an AWS CloudWatch role for API Gateway.


cloud_watch_role_removal_policyOptional
  • Type: aws_cdk.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
  • Type: bool
  • 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.


deploy_optionsOptional
  • Type: aws_cdk.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
  • Type: str
  • Default: 'Automatically created by the RestApi construct'

A description of the RestApi construct.


disable_execute_api_endpointOptional
  • Type: bool
  • 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


domain_nameOptional
  • Type: aws_cdk.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.


endpoint_export_nameOptional
  • Type: str
  • Default: when no export name is given, output will be created without export

Export name for the CfnOutput containing the API endpoint.


endpoint_typesOptional
  • Type: typing.List[aws_cdk.aws_apigateway.EndpointType]
  • Default: EndpointType.EDGE

A list of the endpoint types of the API.

Use this property when creating an API.


fail_on_warningsOptional
  • Type: bool
  • Default: false

Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.


parametersOptional
  • Type: typing.Mapping[str]
  • Default: No parameters.

Custom header parameters for the request.

https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html


policyOptional
  • Type: aws_cdk.aws_iam.PolicyDocument
  • Default: No policy.

A policy document that contains the permissions for this RestApi.


rest_api_nameOptional
  • Type: str
  • Default: ID of the RestApi construct.

A name for the API Gateway RestApi resource.


retain_deploymentsOptional
  • Type: bool
  • 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

A mapping of API operation to its integration.


operation_lookupRequired

Details about each operation.


api_key_optionsOptional

Options for API keys.


cors_optionsOptional
  • Type: aws_cdk.aws_apigateway.CorsOptions

Cross Origin Resource Sharing options for the API.


default_authorizerOptional

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.


spec_pathRequired
  • Type: str

Path to the JSON open api spec.


min_compression_sizeOptional
  • Type: aws_cdk.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.


output_spec_bucketOptional
  • Type: aws_cdk.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.


web_acl_optionsOptional

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.


Methods

Name Description
to_string Returns a string representation of this construct.

to_string
def to_string() -> str

Returns a string representation of this construct.

Static Functions

Name Description
is_construct Checks if x is a construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeRestApi.is_construct(
  x: typing.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: typing.Any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
api aws_cdk.aws_apigateway.SpecRestApi Underlying API Gateway API construct.
extended_api_specification typing.Any The OpenAPI specification with applied API gateway extensions.
ip_set aws_cdk.aws_wafv2.CfnIPSet Reference to the IP set if created.
web_acl aws_cdk.aws_wafv2.CfnWebACL Reference to the webacl, if created.
web_acl_association aws_cdk.aws_wafv2.CfnWebACLAssociation Reference to the web acl association if created.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


apiRequired
api: SpecRestApi
  • Type: aws_cdk.aws_apigateway.SpecRestApi

Underlying API Gateway API construct.


extended_api_specificationRequired
extended_api_specification: typing.Any
  • Type: typing.Any

The OpenAPI specification with applied API gateway extensions.


ip_setOptional
ip_set: CfnIPSet
  • Type: aws_cdk.aws_wafv2.CfnIPSet

Reference to the IP set if created.


web_aclOptional
web_acl: CfnWebACL
  • Type: aws_cdk.aws_wafv2.CfnWebACL

Reference to the webacl, if created.


web_acl_associationOptional
web_acl_association: CfnWebACLAssociation
  • Type: aws_cdk.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebsocketApi(
  scope: Construct,
  id: str,
  api_key_selection_expression: WebSocketApiKeySelectionExpression = None,
  api_name: str = None,
  description: str = None,
  integrations: typing.Mapping[TypeSafeWebsocketApiIntegration],
  operation_lookup: typing.Mapping[WebsocketOperationDetails],
  spec_path: str,
  authorizer: IWebSocketRouteAuthorizer = None,
  connect: TypeSafeWebsocketApiIntegration = None,
  disable_access_logging: bool = None,
  disable_grant_management_access_to_lambdas: bool = None,
  disable_mock_integration_responses: bool = None,
  disconnect: TypeSafeWebsocketApiIntegration = None,
  stage_props: WebSocketStageProps = None
)
Name Type Description
scope constructs.Construct No description.
id str No description.
api_key_selection_expression aws_cdk.aws_apigatewayv2.WebSocketApiKeySelectionExpression An API key selection expression.
api_name str Name for the WebSocket API resource.
description str The description of the API.
integrations typing.Mapping[TypeSafeWebsocketApiIntegration] WebSocket routes and their corresponding integrations.
operation_lookup typing.Mapping[WebsocketOperationDetails] Details about each operation.
spec_path str Path to the websocket api specification json file.
authorizer aws_cdk.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).
disable_access_logging bool Disable access logging.
disable_grant_management_access_to_lambdas bool By default, all lambda integrations are granted management API access for the websocket API to send messages, disconnect clients, etc.
disable_mock_integration_responses bool 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).
stage_props WebSocketStageProps Options for the default stage.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: str

api_key_selection_expressionOptional
  • Type: aws_cdk.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.


api_nameOptional
  • Type: str
  • Default: id of the WebSocketApi construct.

Name for the WebSocket API resource.


descriptionOptional
  • Type: str
  • Default: none

The description of the API.


integrationsRequired

WebSocket routes and their corresponding integrations.


operation_lookupRequired

Details about each operation.


spec_pathRequired
  • Type: str

Path to the websocket api specification json file.


authorizerOptional
  • Type: aws_cdk.aws_apigatewayv2.IWebSocketRouteAuthorizer
  • Default: NONE

Authorizer to use for the API (applied to the $connect route).


connectOptional

Integration for the $connect route (invoked when a new client connects).


disable_access_loggingOptional
  • Type: bool
  • Default: false

Disable access logging.


disable_grant_management_access_to_lambdasOptional
  • Type: bool
  • 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.


disable_mock_integration_responsesOptional
  • Type: bool
  • 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

Integration for the $disconnect route (invoked when a client disconnects).


stage_propsOptional

Options for the default stage.


Methods

Name Description
to_string Returns a string representation of this construct.

to_string
def to_string() -> str

Returns a string representation of this construct.

Static Functions

Name Description
is_construct Checks if x is a construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebsocketApi.is_construct(
  x: typing.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: typing.Any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
api aws_cdk.aws_apigatewayv2.WebSocketApi Reference to the websocket API.
default_stage aws_cdk.aws_apigatewayv2.WebSocketStage Reference to the default deploy stage.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


apiRequired
api: WebSocketApi
  • Type: aws_cdk.aws_apigatewayv2.WebSocketApi

Reference to the websocket API.


default_stageRequired
default_stage: WebSocketStage
  • Type: aws_cdk.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebSocketApiProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  infrastructure: WebSocketInfrastructureConfiguration,
  model: TypeSafeWebSocketApiModelConfiguration,
  documentation: WebSocketDocumentationConfiguration = None,
  handlers: WebSocketHandlersConfiguration = None,
  library: WebSocketLibraryConfiguration = None,
  runtime: WebSocketRuntimeConfiguration = None
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options 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
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


infrastructureRequired

Configuration for generated infrastructure.


modelRequired

Configuration for the API model.


documentationOptional

Configuration for generated documentation.


handlersOptional

Configuration for lambda handlers for implementing the API.


libraryOptional

Configuration for generated libraries.

These include clients for interacting with your websocket API


runtimeOptional

Configuration for generated runtime projects (containing types, clients and server code).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Exclude these files from the bundled package.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Consider a set of files as "generated".
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  _pattern: str
) -> None

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: str

The glob pattern to exclude.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  _glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebSocketApiProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebSocketApiProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project 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
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


allRequired
all: ProjectCollections

Collections of all sub-projects managed by this project.


documentationRequired
documentation: GeneratedWebSocketDocumentationProjects

Generated documentation projects.

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


handlersRequired
handlers: GeneratedCodeProjects

Lambda handlers projects.

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


infrastructureRequired
infrastructure: GeneratedCodeProjects

Generated infrastructure projects.

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


libraryRequired
library: GeneratedWebSocketLibraryProjects

Generated library projects.

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


modelRequired
model: WebSocketModelProject

Project for the api model.


runtimeRequired
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 str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncDefinition(
  project: NodeProject,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.javascript.NodeProject No description.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.javascript.NodeProject

type_spec_optionsRequired

TypeSpec model options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

Path to the generated OpenAPI specification.


TypeSpecAsyncModelProject

Model project for defining a WebSocket API in TypeSpec.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncModelProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  dev_container: bool = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitpod: bool = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  project_type: ProjectType = None,
  projen_credentials: GithubCredentials = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  vscode: bool = None,
  allow_library_dependencies: bool = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_detect_bin: bool = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  bundled_deps: typing.List[str] = None,
  code_artifact_options: CodeArtifactOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_deps: typing.List[str] = None,
  entrypoint: str = None,
  homepage: str = None,
  keywords: typing.List[str] = None,
  license: str = None,
  licensed: bool = None,
  max_node_version: str = None,
  min_node_version: str = None,
  npm_access: NpmAccess = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  repository: str = None,
  repository_directory: str = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  stability: str = None,
  yarn_berry_options: YarnBerryOptions = None,
  jsii_release_version: str = None,
  major_version: typing.Union[int, float] = None,
  min_major_version: typing.Union[int, float] = None,
  npm_dist_tag: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  releasable_commits: ReleasableCommits = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  workflow_container_image: str = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  default_release_branch: str,
  artifacts_directory: str = None,
  auto_approve_upgrades: bool = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  gitignore: typing.List[str] = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  mutable_build: bool = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  package: bool = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_js_options: ProjenrcOptions = None,
  projen_version: str = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  release: bool = None,
  release_to_npm: bool = None,
  release_workflow: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None,
  async_api_spec_file: str,
  parsed_spec_file: str
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitpod bool Add a Gitpod development environment.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
project_type projen.ProjectType Which type of project this is (library/app).
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_token_secret str 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 bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode bool Enable VSCode integration.
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps typing.List[str] Runtime dependencies of this module.
description str The description is just a string that helps people understand the purpose of the package.
dev_deps typing.List[str] Build dependencies for this module.
entrypoint str Module entrypoint (main in package.json).
homepage str Package's Homepage / Website.
keywords typing.List[str] Keywords to include in package.json.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
max_node_version str Minimum node.js version to require via engines (inclusive).
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
stability str Package's Stability.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
major_version typing.Union[int, float] Major version to release from the default branch.
min_major_version typing.Union[int, float] Minimal Major version to release.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
workflow_container_image str Container image to use for GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
default_release_branch str The name of the main release branch.
artifacts_directory str A directory which will contain build artifacts.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore typing.List[str] Additional entries to .gitignore.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
mutable_build bool Automatically update files modified during builds to pull-request branches.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projen_version str Version of projen to install.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
release bool Add release management to this project.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_workflow bool DEPRECATED: renamed to release.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


auto_approve_optionsOptional
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
  • 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
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


dev_containerOptional
  • Type: bool
  • Default: false

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


githubOptional
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
  • Type: bool
  • Default: false

Add a Gitpod development environment.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead

  • Type: bool

  • Default: true

Whether mergify should be enabled on this repository or not.


~~mergify_options~~Optional
  • Deprecated: use githubOptions.mergifyOptions instead

  • Type: projen.github.MergifyOptions

  • Default: default options

Options for mergify.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level

  • Type: projen.ProjectType

  • Default: ProjectType.UNKNOWN

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


projen_credentialsOptional
  • 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.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials

  • Type: str

  • 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
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
  • Type: bool
  • Default: true

Enable VSCode integration.

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


allow_library_dependenciesOptional
  • Type: bool
  • 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.


author_emailOptional
  • Type: str

Author's e-mail.


author_nameOptional
  • Type: str

Author's name.


author_organizationOptional
  • Type: bool

Is the author an organization.


author_urlOptional
  • Type: str

Author's URL / Website.


auto_detect_binOptional
  • Type: bool
  • Default: true

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


binOptional
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
  • Type: str

The url to your project's issue tracker.


bundled_depsOptional
  • Type: typing.List[str]

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.


code_artifact_optionsOptional
  • 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
  • Type: typing.List[str]
  • 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
  • Type: str

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


dev_depsOptional
  • Type: typing.List[str]
  • 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
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

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


homepageOptional
  • Type: str

Package's Homepage / Website.


keywordsOptional
  • Type: typing.List[str]

Keywords to include in package.json.


licenseOptional
  • Type: str
  • 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
  • Type: bool
  • Default: true

Indicates if a license should be added.


max_node_versionOptional
  • Type: str
  • Default: no max

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


min_node_versionOptional
  • Type: str
  • Default: no "engines" specified

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


npm_accessOptional
  • 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.


npm_provenanceOptional
  • Type: bool
  • 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


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead

  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional

The base URL of the npm package registry.

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


npm_token_secretOptional
  • Type: str
  • Default: "NPM_TOKEN"

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


package_managerOptional
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


peer_dependency_optionsOptional
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
  • Type: str
  • Default: "7"

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


repositoryOptional
  • Type: str

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

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


repository_directoryOptional
  • Type: str

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.


scoped_packages_optionsOptional
  • Type: typing.List[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()

  • Type: typing.Mapping[str]

  • 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
  • Type: str

Package's Stability.


yarn_berry_optionsOptional
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsii_release_versionOptional
  • Type: str
  • Default: "latest"

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


major_versionOptional
  • Type: typing.Union[int, float]
  • 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.


min_major_versionOptional
  • Type: typing.Union[int, float]
  • 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.


npm_dist_tagOptional
  • Type: str
  • 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.


post_build_stepsOptional
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
  • Type: str
  • Default: normal semantic versions

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


publish_dry_runOptional
  • Type: bool
  • Default: false

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


publish_tasksOptional
  • Type: bool
  • 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.


releasable_commitsOptional
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


release_branchesOptional
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead

  • Type: bool

  • Default: true

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


release_failure_issueOptional
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead

  • Type: str

  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
  • Type: str
  • 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.


release_triggerOptional
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


release_workflow_nameOptional
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
  • Type: typing.List[projen.github.workflows.JobStep]

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


versionrc_optionsOptional
  • Type: typing.Mapping[typing.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.


workflow_container_imageOptional
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_runs_onOptional
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


default_release_branchRequired
  • Type: str
  • Default: "main"

The name of the main release branch.


artifacts_directoryOptional
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


auto_approve_upgradesOptional
  • Type: bool
  • 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.


build_workflowOptional
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


~~build_workflow_triggers~~Optional
  • Deprecated: - Use buildWorkflowOptions.workflowTriggers

  • Type: projen.github.workflows.Triggers

  • Default: "{ pullRequest: {}, workflowDispatch: {} }"

Build workflow triggers.


bundler_optionsOptional
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
  • 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.


code_covOptional
  • Type: bool
  • 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.


code_cov_token_secretOptional
  • Type: str
  • 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.


  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


deps_upgradeOptional
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
  • Type: typing.List[str]

Additional entries to .gitignore.


jestOptional
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild

  • Type: bool

  • 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

  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
  • Type: bool
  • Default: true

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


prettierOptional
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projen_dev_dependencyOptional
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_js_optionsOptional
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projen_versionOptional
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


pull_request_templateOptional
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


releaseOptional
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_to_npmOptional
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


~~release_workflow~~Optional
  • Deprecated: see release.

  • Type: bool

  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflow_bootstrap_stepsOptional
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_git_identityOptional
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


type_spec_optionsRequired

TypeSpec model options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


async_api_spec_fileRequired
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Adds patterns to be ignored by npm.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Marks the provided file(s) as being generated.
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.
add_bins No description.
add_bundled_deps Defines bundled dependencies.
add_compile_command DEPRECATED.
add_deps Defines normal dependencies.
add_dev_deps Defines development/test dependencies.
add_fields Directly set fields in package.json.
add_keywords Adds keywords to package.json (deduplicated).
add_peer_deps Defines peer dependencies.
add_scripts Replaces the contents of multiple npm package.json scripts.
add_test_command DEPRECATED.
has_script Indicates if a script by the name name is defined.
remove_script Removes the npm script (always successful).
render_workflow_setup Returns the set of workflow steps which should be executed to bootstrap a workflow.
set_script Replaces the contents of an npm package.json script.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  pattern: str
) -> None

Adds patterns to be ignored by npm.

patternRequired
  • Type: str

The pattern to ignore.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


add_bins
def add_bins(
  bins: typing.Mapping[str]
) -> None
binsRequired
  • Type: typing.Mapping[str]

add_bundled_deps
def add_bundled_deps(
  deps: str
) -> None

Defines bundled dependencies.

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

depsRequired
  • Type: str

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.


~~add_compile_command~~
def add_compile_command(
  commands: str
) -> None

DEPRECATED.

commandsRequired
  • Type: str

add_deps
def add_deps(
  deps: str
) -> None

Defines normal dependencies.

depsRequired
  • Type: str

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.


add_dev_deps
def add_dev_deps(
  deps: str
) -> None

Defines development/test dependencies.

depsRequired
  • Type: str

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.


add_fields
def add_fields(
  fields: typing.Mapping[typing.Any]
) -> None

Directly set fields in package.json.

fieldsRequired
  • Type: typing.Mapping[typing.Any]

The fields to set.


add_keywords
def add_keywords(
  keywords: str
) -> None

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: str

The keywords to add.


add_peer_deps
def add_peer_deps(
  deps: str
) -> None

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: str

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.


add_scripts
def add_scripts(
  scripts: typing.Mapping[str]
) -> None

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: typing.Mapping[str]

The scripts to set.


~~add_test_command~~
def add_test_command(
  commands: str
) -> None

DEPRECATED.

commandsRequired
  • Type: str

~~has_script~~
def has_script(
  name: str
) -> bool

Indicates if a script by the name name is defined.

nameRequired
  • Type: str

The name of the script.


remove_script
def remove_script(
  name: str
) -> None

Removes the npm script (always successful).

nameRequired
  • Type: str

The name of the script.


render_workflow_setup
def render_workflow_setup(
  install_step_configuration: JobStepConfiguration = None,
  mutable: bool = None
) -> typing.List[JobStep]

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

install_step_configurationOptional
  • Type: projen.github.workflows.JobStepConfiguration
  • Default: { name: "Install dependencies" }

Configure the install step in the workflow setup.


Example

- { env: { NPM_TOKEN: "token" }} for installing from private npm registry.
mutableOptional
  • Type: bool
  • Default: false

Should the package lockfile be updated?


set_script
def set_script(
  name: str,
  command: str
) -> None

Replaces the contents of an npm package.json script.

nameRequired
  • Type: str

The script name.


commandRequired
  • Type: str

The command to execute.


Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncModelProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncModelProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
project_type projen.ProjectType No description.
auto_approve projen.github.AutoApprove Auto approve set up for this project.
dev_container 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.
allow_library_dependencies bool No description.
artifacts_directory str The build output directory.
artifacts_javascript_directory str The location of the npm tarball after build (${artifactsDirectory}/js).
bundler projen.javascript.Bundler No description.
entrypoint str No description.
manifest typing.Any No description.
npmrc projen.javascript.NpmConfig The .npmrc file.
package projen.javascript.NodePackage API for managing the node package.
package_manager projen.javascript.NodePackageManager The package manager to use.
run_script_command str The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
auto_merge projen.github.AutoMerge Component that sets up mergify for merging approved pull requests.
build_workflow projen.build.BuildWorkflow The PR build GitHub workflow.
build_workflow_job_id str The job ID of the build workflow.
jest projen.javascript.Jest The Jest configuration (if enabled).
max_node_version str Maximum node version required by this package.
min_node_version str 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.
upgrade_workflow projen.javascript.UpgradeDependencies The upgrade workflow.
api_name str No description.
definition TypeSpecAsyncDefinition No description.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


project_typeRequired
project_type: ProjectType
  • Type: projen.ProjectType

auto_approveOptional
auto_approve: AutoApprove
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


dev_containerOptional
dev_container: DevContainer
  • Type: projen.vscode.DevContainer

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

This will be undefined if devContainer boolean is false


githubOptional
github: GitHub
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
gitpod: Gitpod
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
vscode: VsCode
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


~~allow_library_dependencies~~Required
  • Deprecated: use package.allowLibraryDependencies
allow_library_dependencies: bool
  • Type: bool

artifacts_directoryRequired
artifacts_directory: str
  • Type: str

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.


artifacts_javascript_directoryRequired
artifacts_javascript_directory: str
  • Type: str

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


bundlerRequired
bundler: Bundler
  • Type: projen.javascript.Bundler

~~entrypoint~~Required
  • Deprecated: use package.entrypoint
entrypoint: str
  • Type: str

~~manifest~~Required
  • Deprecated: use package.addField(x, y)
manifest: typing.Any
  • Type: typing.Any

npmrcRequired
npmrc: NpmConfig
  • Type: projen.javascript.NpmConfig

The .npmrc file.


packageRequired
package: NodePackage
  • Type: projen.javascript.NodePackage

API for managing the node package.


~~package_manager~~Required
  • Deprecated: use package.packageManager
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager

The package manager to use.


run_script_commandRequired
run_script_command: str
  • Type: str

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


auto_mergeOptional
auto_merge: AutoMerge
  • Type: projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


build_workflowOptional
build_workflow: BuildWorkflow
  • Type: projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


build_workflow_job_idOptional
build_workflow_job_id: str
  • Type: str

The job ID of the build workflow.


jestOptional
jest: Jest
  • Type: projen.javascript.Jest

The Jest configuration (if enabled).


max_node_versionOptional
max_node_version: str
  • Type: str

Maximum node version required by this package.


min_node_versionOptional
min_node_version: str
  • Type: str

Minimum node.js version required by this package.


npmignoreOptional
npmignore: IgnoreFile
  • Type: projen.IgnoreFile

The .npmignore file.


prettierOptional
prettier: Prettier
  • Type: projen.javascript.Prettier

~~publisher~~Optional
  • Deprecated: use release.publisher.
publisher: Publisher
  • Type: projen.release.Publisher

Package publisher.

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


releaseOptional
release: Release
  • Type: projen.release.Release

Release management.


upgrade_workflowOptional
upgrade_workflow: UpgradeDependencies
  • Type: projen.javascript.UpgradeDependencies

The upgrade workflow.


api_nameRequired
api_name: str
  • Type: str

definitionRequired
definition: TypeSpecAsyncDefinition

Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecDefinition(
  project: NodeProject,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.javascript.NodeProject No description.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.javascript.NodeProject

type_spec_optionsRequired

TypeSpec model options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

Path to the generated OpenAPI specification.


TypeSpecModelProject

Model project for defining a REST API in TypeSpec.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecModelProject(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  dev_container: bool = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitpod: bool = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  project_type: ProjectType = None,
  projen_credentials: GithubCredentials = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  vscode: bool = None,
  allow_library_dependencies: bool = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_detect_bin: bool = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  bundled_deps: typing.List[str] = None,
  code_artifact_options: CodeArtifactOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_deps: typing.List[str] = None,
  entrypoint: str = None,
  homepage: str = None,
  keywords: typing.List[str] = None,
  license: str = None,
  licensed: bool = None,
  max_node_version: str = None,
  min_node_version: str = None,
  npm_access: NpmAccess = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  repository: str = None,
  repository_directory: str = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  stability: str = None,
  yarn_berry_options: YarnBerryOptions = None,
  jsii_release_version: str = None,
  major_version: typing.Union[int, float] = None,
  min_major_version: typing.Union[int, float] = None,
  npm_dist_tag: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  releasable_commits: ReleasableCommits = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  workflow_container_image: str = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  default_release_branch: str,
  artifacts_directory: str = None,
  auto_approve_upgrades: bool = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  gitignore: typing.List[str] = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  mutable_build: bool = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  package: bool = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_js_options: ProjenrcOptions = None,
  projen_version: str = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  release: bool = None,
  release_to_npm: bool = None,
  release_workflow: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str
)
Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitpod bool Add a Gitpod development environment.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
project_type projen.ProjectType Which type of project this is (library/app).
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_token_secret str 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 bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode bool Enable VSCode integration.
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps typing.List[str] Runtime dependencies of this module.
description str The description is just a string that helps people understand the purpose of the package.
dev_deps typing.List[str] Build dependencies for this module.
entrypoint str Module entrypoint (main in package.json).
homepage str Package's Homepage / Website.
keywords typing.List[str] Keywords to include in package.json.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
max_node_version str Minimum node.js version to require via engines (inclusive).
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
stability str Package's Stability.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
major_version typing.Union[int, float] Major version to release from the default branch.
min_major_version typing.Union[int, float] Minimal Major version to release.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
workflow_container_image str Container image to use for GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
default_release_branch str The name of the main release branch.
artifacts_directory str A directory which will contain build artifacts.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore typing.List[str] Additional entries to .gitignore.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
mutable_build bool Automatically update files modified during builds to pull-request branches.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projen_version str Version of projen to install.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
release bool Add release management to this project.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_workflow bool DEPRECATED: renamed to release.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: str
  • 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
  • Type: projen.Project

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


projen_commandOptional
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


auto_approve_optionsOptional
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
  • 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
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


dev_containerOptional
  • Type: bool
  • Default: false

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


githubOptional
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
  • Type: bool
  • Default: false

Add a Gitpod development environment.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead

  • Type: bool

  • Default: true

Whether mergify should be enabled on this repository or not.


~~mergify_options~~Optional
  • Deprecated: use githubOptions.mergifyOptions instead

  • Type: projen.github.MergifyOptions

  • Default: default options

Options for mergify.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level

  • Type: projen.ProjectType

  • Default: ProjectType.UNKNOWN

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


projen_credentialsOptional
  • 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.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials

  • Type: str

  • 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
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
  • Type: bool
  • Default: true

Enable VSCode integration.

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


allow_library_dependenciesOptional
  • Type: bool
  • 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.


author_emailOptional
  • Type: str

Author's e-mail.


author_nameOptional
  • Type: str

Author's name.


author_organizationOptional
  • Type: bool

Is the author an organization.


author_urlOptional
  • Type: str

Author's URL / Website.


auto_detect_binOptional
  • Type: bool
  • Default: true

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


binOptional
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
  • Type: str

The url to your project's issue tracker.


bundled_depsOptional
  • Type: typing.List[str]

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.


code_artifact_optionsOptional
  • 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
  • Type: typing.List[str]
  • 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
  • Type: str

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


dev_depsOptional
  • Type: typing.List[str]
  • 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
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

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


homepageOptional
  • Type: str

Package's Homepage / Website.


keywordsOptional
  • Type: typing.List[str]

Keywords to include in package.json.


licenseOptional
  • Type: str
  • 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
  • Type: bool
  • Default: true

Indicates if a license should be added.


max_node_versionOptional
  • Type: str
  • Default: no max

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


min_node_versionOptional
  • Type: str
  • Default: no "engines" specified

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


npm_accessOptional
  • 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.


npm_provenanceOptional
  • Type: bool
  • 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


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead

  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional

The base URL of the npm package registry.

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


npm_token_secretOptional
  • Type: str
  • Default: "NPM_TOKEN"

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


package_managerOptional
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


peer_dependency_optionsOptional
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
  • Type: str
  • Default: "7"

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


repositoryOptional
  • Type: str

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

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


repository_directoryOptional
  • Type: str

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.


scoped_packages_optionsOptional
  • Type: typing.List[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()

  • Type: typing.Mapping[str]

  • 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
  • Type: str

Package's Stability.


yarn_berry_optionsOptional
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsii_release_versionOptional
  • Type: str
  • Default: "latest"

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


major_versionOptional
  • Type: typing.Union[int, float]
  • 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.


min_major_versionOptional
  • Type: typing.Union[int, float]
  • 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.


npm_dist_tagOptional
  • Type: str
  • 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.


post_build_stepsOptional
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
  • Type: str
  • Default: normal semantic versions

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


publish_dry_runOptional
  • Type: bool
  • Default: false

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


publish_tasksOptional
  • Type: bool
  • 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.


releasable_commitsOptional
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


release_branchesOptional
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead

  • Type: bool

  • Default: true

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


release_failure_issueOptional
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead

  • Type: str

  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
  • Type: str
  • 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.


release_triggerOptional
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


release_workflow_nameOptional
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
  • Type: typing.List[projen.github.workflows.JobStep]

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


versionrc_optionsOptional
  • Type: typing.Mapping[typing.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.


workflow_container_imageOptional
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_runs_onOptional
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


default_release_branchRequired
  • Type: str
  • Default: "main"

The name of the main release branch.


artifacts_directoryOptional
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


auto_approve_upgradesOptional
  • Type: bool
  • 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.


build_workflowOptional
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


~~build_workflow_triggers~~Optional
  • Deprecated: - Use buildWorkflowOptions.workflowTriggers

  • Type: projen.github.workflows.Triggers

  • Default: "{ pullRequest: {}, workflowDispatch: {} }"

Build workflow triggers.


bundler_optionsOptional
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
  • 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.


code_covOptional
  • Type: bool
  • 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.


code_cov_token_secretOptional
  • Type: str
  • 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.


  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


deps_upgradeOptional
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
  • Type: typing.List[str]

Additional entries to .gitignore.


jestOptional
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild

  • Type: bool

  • 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

  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
  • Type: bool
  • Default: true

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


prettierOptional
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projen_dev_dependencyOptional
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_js_optionsOptional
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projen_versionOptional
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


pull_request_templateOptional
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


releaseOptional
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_to_npmOptional
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


~~release_workflow~~Optional
  • Deprecated: see release.

  • Type: bool

  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflow_bootstrap_stepsOptional
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_git_identityOptional
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


type_spec_optionsRequired

TypeSpec model options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


Methods

Name Description
to_string Returns a string representation of this construct.
add_exclude_from_cleanup Exclude the matching files from pre-synth cleanup.
add_git_ignore Adds a .gitignore pattern.
add_package_ignore Adds patterns to be ignored by npm.
add_task Adds a new task to this project.
add_tip Prints a "tip" message during synthesis.
annotate_generated Marks the provided file(s) as being generated.
post_synthesize Called after all components are synthesized.
pre_synthesize Called before all components are synthesized.
remove_task Removes a task from a project.
run_task_command Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
try_find_file Finds a file at the specified relative path within this project and all its subprojects.
try_find_json_file Finds a json file by name.
try_find_object_file Finds an object file (like JsonFile, YamlFile, etc.) by name.
try_remove_file Finds a file at the specified relative path within this project and removes it.
add_bins No description.
add_bundled_deps Defines bundled dependencies.
add_compile_command DEPRECATED.
add_deps Defines normal dependencies.
add_dev_deps Defines development/test dependencies.
add_fields Directly set fields in package.json.
add_keywords Adds keywords to package.json (deduplicated).
add_peer_deps Defines peer dependencies.
add_scripts Replaces the contents of multiple npm package.json scripts.
add_test_command DEPRECATED.
has_script Indicates if a script by the name name is defined.
remove_script Removes the npm script (always successful).
render_workflow_setup Returns the set of workflow steps which should be executed to bootstrap a workflow.
set_script Replaces the contents of an npm package.json script.

to_string
def to_string() -> str

Returns a string representation of this construct.

add_exclude_from_cleanup
def add_exclude_from_cleanup(
  globs: str
) -> None

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: str

The glob patterns to match.


add_git_ignore
def add_git_ignore(
  pattern: str
) -> None

Adds a .gitignore pattern.

patternRequired
  • Type: str

The glob pattern to ignore.


add_package_ignore
def add_package_ignore(
  pattern: str
) -> None

Adds patterns to be ignored by npm.

patternRequired
  • Type: str

The pattern to ignore.


add_task
def add_task(
  name: str,
  condition: str = None,
  cwd: str = None,
  description: str = None,
  env: typing.Mapping[str] = None,
  required_env: typing.List[str] = None,
  args: typing.List[str] = None,
  exec: str = None,
  receive_args: bool = None,
  steps: typing.List[TaskStep] = None
) -> Task

Adds a new task to this project.

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

nameRequired
  • Type: str

The task name to add.


conditionOptional
  • Type: str

A shell command which determines if the this task should be executed.

If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.


cwdOptional
  • Type: str
  • Default: process.cwd()

The working directory for all steps in this task (unless overridden by the step).


descriptionOptional
  • Type: str
  • Default: the task name

The description of this build command.


envOptional
  • Type: typing.Mapping[str]
  • Default: {}

Defines environment variables for the execution of this task.

Values in this map will be evaluated in a shell, so you can do stuff like $(echo "foo").


required_envOptional
  • Type: typing.List[str]

A set of environment variables that must be defined in order to execute this task.

Task execution will fail if one of these is not defined.


argsOptional
  • Type: typing.List[str]
  • Default: no arguments are passed to the step

Should the provided exec shell command receive fixed args.

{@link TaskStepOptions.args }


execOptional
  • Type: str
  • Default: add steps using task.exec(command) or task.spawn(subtask)

Shell command to execute as the first command of the task.


receive_argsOptional
  • Type: bool
  • Default: false

Should the provided exec shell command receive args passed to the task.

{@link TaskStepOptions.receiveArgs }


stepsOptional
  • Type: typing.List[projen.TaskStep]

List of task steps to run.


~~add_tip~~
def add_tip(
  message: str
) -> None

Prints a "tip" message during synthesis.

messageRequired
  • Type: str

The message.


annotate_generated
def annotate_generated(
  glob: str
) -> None

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: str

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


post_synthesize
def post_synthesize() -> None

Called after all components are synthesized.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before all components are synthesized.

remove_task
def remove_task(
  name: str
) -> Task

Removes a task from a project.

nameRequired
  • Type: str

The name of the task to remove.


run_task_command
def run_task_command(
  task: Task
) -> str

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
def synth() -> None

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()"
try_find_file
def try_find_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


~~try_find_json_file~~
def try_find_json_file(
  file_path: str
) -> JsonFile

Finds a json file by name.

file_pathRequired
  • Type: str

The file path.


try_find_object_file
def try_find_object_file(
  file_path: str
) -> ObjectFile

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

file_pathRequired
  • Type: str

The file path.


try_remove_file
def try_remove_file(
  file_path: str
) -> FileBase

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

file_pathRequired
  • Type: str

The file path.

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


add_bins
def add_bins(
  bins: typing.Mapping[str]
) -> None
binsRequired
  • Type: typing.Mapping[str]

add_bundled_deps
def add_bundled_deps(
  deps: str
) -> None

Defines bundled dependencies.

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

depsRequired
  • Type: str

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.


~~add_compile_command~~
def add_compile_command(
  commands: str
) -> None

DEPRECATED.

commandsRequired
  • Type: str

add_deps
def add_deps(
  deps: str
) -> None

Defines normal dependencies.

depsRequired
  • Type: str

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.


add_dev_deps
def add_dev_deps(
  deps: str
) -> None

Defines development/test dependencies.

depsRequired
  • Type: str

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.


add_fields
def add_fields(
  fields: typing.Mapping[typing.Any]
) -> None

Directly set fields in package.json.

fieldsRequired
  • Type: typing.Mapping[typing.Any]

The fields to set.


add_keywords
def add_keywords(
  keywords: str
) -> None

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: str

The keywords to add.


add_peer_deps
def add_peer_deps(
  deps: str
) -> None

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: str

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.


add_scripts
def add_scripts(
  scripts: typing.Mapping[str]
) -> None

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: typing.Mapping[str]

The scripts to set.


~~add_test_command~~
def add_test_command(
  commands: str
) -> None

DEPRECATED.

commandsRequired
  • Type: str

~~has_script~~
def has_script(
  name: str
) -> bool

Indicates if a script by the name name is defined.

nameRequired
  • Type: str

The name of the script.


remove_script
def remove_script(
  name: str
) -> None

Removes the npm script (always successful).

nameRequired
  • Type: str

The name of the script.


render_workflow_setup
def render_workflow_setup(
  install_step_configuration: JobStepConfiguration = None,
  mutable: bool = None
) -> typing.List[JobStep]

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

install_step_configurationOptional
  • Type: projen.github.workflows.JobStepConfiguration
  • Default: { name: "Install dependencies" }

Configure the install step in the workflow setup.


Example

- { env: { NPM_TOKEN: "token" }} for installing from private npm registry.
mutableOptional
  • Type: bool
  • Default: false

Should the package lockfile be updated?


set_script
def set_script(
  name: str,
  command: str
) -> None

Replaces the contents of an npm package.json script.

nameRequired
  • Type: str

The script name.


commandRequired
  • Type: str

The command to execute.


Static Functions

Name Description
is_construct Checks if x is a construct.
is_project Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecModelProject.is_construct(
  x: typing.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: typing.Any

Any object.


is_project
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecModelProject.is_project(
  x: typing.Any
)

Test whether the given construct is a project.

xRequired
  • Type: typing.Any

of
import aws.pdk.type_safe_api

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.
build_task projen.Task No description.
commit_generated bool Whether to commit the managed files by default.
compile_task projen.Task No description.
components typing.List[projen.Component] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected bool Whether or not the project is being ejected.
files typing.List[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 str Project name.
outdir str Absolute output directory of this project.
package_task projen.Task No description.
post_compile_task projen.Task No description.
pre_compile_task projen.Task No description.
project_build projen.ProjectBuild Manages the build process of the project.
projen_command str The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects typing.List[projen.Project] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
test_task projen.Task No description.
default_task projen.Task This is the "default" task, the one that executes "projen".
init_project projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
project_type projen.ProjectType No description.
auto_approve projen.github.AutoApprove Auto approve set up for this project.
dev_container 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.
allow_library_dependencies bool No description.
artifacts_directory str The build output directory.
artifacts_javascript_directory str The location of the npm tarball after build (${artifactsDirectory}/js).
bundler projen.javascript.Bundler No description.
entrypoint str No description.
manifest typing.Any No description.
npmrc projen.javascript.NpmConfig The .npmrc file.
package projen.javascript.NodePackage API for managing the node package.
package_manager projen.javascript.NodePackageManager The package manager to use.
run_script_command str The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
auto_merge projen.github.AutoMerge Component that sets up mergify for merging approved pull requests.
build_workflow projen.build.BuildWorkflow The PR build GitHub workflow.
build_workflow_job_id str The job ID of the build workflow.
jest projen.javascript.Jest The Jest configuration (if enabled).
max_node_version str Maximum node version required by this package.
min_node_version str 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.
upgrade_workflow projen.javascript.UpgradeDependencies The upgrade workflow.
api_name str No description.
definition TypeSpecDefinition No description.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


build_taskRequired
build_task: Task
  • Type: projen.Task

commit_generatedRequired
commit_generated: bool
  • Type: bool

Whether to commit the managed files by default.


compile_taskRequired
compile_task: Task
  • Type: projen.Task

componentsRequired
components: typing.List[Component]
  • Type: typing.List[projen.Component]

Returns all the components within this project.


depsRequired
deps: Dependencies
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
ejected: bool
  • Type: bool

Whether or not the project is being ejected.


filesRequired
files: typing.List[FileBase]
  • Type: typing.List[projen.FileBase]

All files in this project.


gitattributesRequired
gitattributes: GitAttributesFile
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
gitignore: IgnoreFile
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
logger: Logger
  • Type: projen.Logger

Logging utilities.


nameRequired
name: str
  • Type: str

Project name.


outdirRequired
outdir: str
  • Type: str

Absolute output directory of this project.


package_taskRequired
package_task: Task
  • Type: projen.Task

post_compile_taskRequired
post_compile_task: Task
  • Type: projen.Task

pre_compile_taskRequired
pre_compile_task: Task
  • Type: projen.Task

project_buildRequired
project_build: ProjectBuild
  • Type: projen.ProjectBuild

Manages the build process of the project.


projen_commandRequired
projen_command: str
  • Type: str

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


rootRequired
root: Project
  • Type: projen.Project

The root project.


subprojectsRequired
subprojects: typing.List[Project]
  • Type: typing.List[projen.Project]

Returns all the subprojects within this project.


tasksRequired
tasks: Tasks
  • Type: projen.Tasks

Project tasks.


test_taskRequired
test_task: Task
  • Type: projen.Task

default_taskOptional
default_task: Task
  • Type: projen.Task

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

Undefined if the project is being ejected.


init_projectOptional
init_project: 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
parent: Project
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


project_typeRequired
project_type: ProjectType
  • Type: projen.ProjectType

auto_approveOptional
auto_approve: AutoApprove
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


dev_containerOptional
dev_container: DevContainer
  • Type: projen.vscode.DevContainer

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

This will be undefined if devContainer boolean is false


githubOptional
github: GitHub
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
gitpod: Gitpod
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
vscode: VsCode
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


~~allow_library_dependencies~~Required
  • Deprecated: use package.allowLibraryDependencies
allow_library_dependencies: bool
  • Type: bool

artifacts_directoryRequired
artifacts_directory: str
  • Type: str

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.


artifacts_javascript_directoryRequired
artifacts_javascript_directory: str
  • Type: str

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


bundlerRequired
bundler: Bundler
  • Type: projen.javascript.Bundler

~~entrypoint~~Required
  • Deprecated: use package.entrypoint
entrypoint: str
  • Type: str

~~manifest~~Required
  • Deprecated: use package.addField(x, y)
manifest: typing.Any
  • Type: typing.Any

npmrcRequired
npmrc: NpmConfig
  • Type: projen.javascript.NpmConfig

The .npmrc file.


packageRequired
package: NodePackage
  • Type: projen.javascript.NodePackage

API for managing the node package.


~~package_manager~~Required
  • Deprecated: use package.packageManager
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager

The package manager to use.


run_script_commandRequired
run_script_command: str
  • Type: str

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


auto_mergeOptional
auto_merge: AutoMerge
  • Type: projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


build_workflowOptional
build_workflow: BuildWorkflow
  • Type: projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


build_workflow_job_idOptional
build_workflow_job_id: str
  • Type: str

The job ID of the build workflow.


jestOptional
jest: Jest
  • Type: projen.javascript.Jest

The Jest configuration (if enabled).


max_node_versionOptional
max_node_version: str
  • Type: str

Maximum node version required by this package.


min_node_versionOptional
min_node_version: str
  • Type: str

Minimum node.js version required by this package.


npmignoreOptional
npmignore: IgnoreFile
  • Type: projen.IgnoreFile

The .npmignore file.


prettierOptional
prettier: Prettier
  • Type: projen.javascript.Prettier

~~publisher~~Optional
  • Deprecated: use release.publisher.
publisher: Publisher
  • Type: projen.release.Publisher

Package publisher.

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


releaseOptional
release: Release
  • Type: projen.release.Release

Release management.


upgrade_workflowOptional
upgrade_workflow: UpgradeDependencies
  • Type: projen.javascript.UpgradeDependencies

The upgrade workflow.


api_nameRequired
api_name: str
  • Type: str

definitionRequired
definition: TypeSpecDefinition

Constants

Name Type Description
DEFAULT_TASK str The name of the default task (the task executed when projen is run without arguments).

DEFAULT_TASKRequired
DEFAULT_TASK: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecProjectDefinition(
  project: NodeProject,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None
)
Name Type Description
project projen.javascript.NodeProject No description.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

projectRequired
  • Type: projen.javascript.NodeProject

type_spec_optionsRequired

TypeSpec model options.


handler_languagesOptional

The languages users have specified for handler projects (if any).


Methods

Name Description
to_string Returns a string representation of this construct.
post_synthesize Called after synthesis.
pre_synthesize Called before synthesis.
synthesize Synthesizes files to the project output directory.

to_string
def to_string() -> str

Returns a string representation of this construct.

post_synthesize
def post_synthesize() -> None

Called after synthesis.

Order is not guaranteed.

pre_synthesize
def pre_synthesize() -> None

Called before synthesis.

synthesize
def synthesize() -> None

Synthesizes files to the project output directory.

Static Functions

Name Description
is_construct Checks if x is a construct.
is_component Test whether the given construct is a component.

is_construct
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecProjectDefinition.is_construct(
  x: typing.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: typing.Any

Any object.


is_component
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecProjectDefinition.is_component(
  x: typing.Any
)

Test whether the given construct is a component.

xRequired
  • Type: typing.Any

Properties

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

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


projectRequired
project: Project
  • Type: projen.Project

open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.ApiGatewayIntegration(
  cache_key_parameters: typing.List[str] = None,
  cache_namespace: str = None,
  connection_id: str = None,
  connection_type: str = None,
  content_handling: str = None,
  credentials: str = None,
  http_method: str = None,
  passthrough_behavior: str = None,
  request_parameters: typing.Mapping[str] = None,
  request_templates: typing.Mapping[str] = None,
  responses: typing.Mapping[ApiGatewayIntegrationResponse] = None,
  timeout_in_millis: typing.Union[int, float] = None,
  tls_config: ApiGatewayIntegrationTlsConfig = None,
  type: str = None,
  uri: str = None
)

Properties

Name Type Description
cache_key_parameters typing.List[str] A list of request parameters whose values are to be cached.
cache_namespace str An API-specific tag group of related cached parameters.
connection_id str The ID of a VpcLink for the private integration.
connection_type str The integration connection type.
content_handling str Request payload encoding conversion types.
credentials str For AWS IAM role-based credentials, specify the ARN of an appropriate IAM role.
http_method str The HTTP method used in the integration request.
passthrough_behavior str Specifies how a request payload of unmapped content type is passed through the integration request without modification.
request_parameters typing.Mapping[str] Specifies mappings from method request parameters to integration request parameters.
request_templates typing.Mapping[str] Mapping templates for a request payload of specified MIME types.
responses typing.Mapping[ApiGatewayIntegrationResponse] Defines the method's responses and specifies desired parameter mappings or payload mappings from integration responses to method responses.
timeout_in_millis typing.Union[int, float] Custom timeout between 50 and 29,000 milliseconds.
tls_config ApiGatewayIntegrationTlsConfig Specifies the TLS configuration for an integration.
type str The type of integration with the specified backend.
uri str The endpoint URI of the backend.

cache_key_parametersOptional
cache_key_parameters: typing.List[str]
  • Type: typing.List[str]

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


cache_namespaceOptional
cache_namespace: str
  • Type: str

An API-specific tag group of related cached parameters.


connection_idOptional
connection_id: str
  • Type: str

The ID of a VpcLink for the private integration.

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


connection_typeOptional
connection_type: str
  • Type: str

The integration connection type.

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


content_handlingOptional
content_handling: str
  • Type: str

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
credentials: str
  • Type: str

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.


http_methodOptional
http_method: str
  • Type: str

The HTTP method used in the integration request.

For Lambda function invocations, the value must be POST.


passthrough_behaviorOptional
passthrough_behavior: str
  • Type: str

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


request_parametersOptional
request_parameters: typing.Mapping[str]
  • Type: typing.Mapping[str]

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


request_templatesOptional
request_templates: typing.Mapping[str]
  • Type: typing.Mapping[str]

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
responses: typing.Mapping[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


timeout_in_millisOptional
timeout_in_millis: typing.Union[int, float]
  • Type: typing.Union[int, float]

Custom timeout between 50 and 29,000 milliseconds.

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


tls_configOptional
tls_config: ApiGatewayIntegrationTlsConfig

Specifies the TLS configuration for an integration.

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


typeOptional
type: str
  • Type: str

The type of integration with the specified backend.

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


uriOptional
uri: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.ApiGatewayIntegrationResponse(
  response_parameters: typing.Mapping[str],
  response_templates: typing.Mapping[str],
  status_code: str,
  content_handling: str = None
)

Properties

Name Type Description
response_parameters typing.Mapping[str] Specifies parameter mappings for the response.
response_templates typing.Mapping[str] Specifies MIME type-specific mapping templates for the response’s payload.
status_code str HTTP status code for the method response.
content_handling str Response payload encoding conversion types.

response_parametersRequired
response_parameters: typing.Mapping[str]
  • Type: typing.Mapping[str]

Specifies parameter mappings for the response.


response_templatesRequired
response_templates: typing.Mapping[str]
  • Type: typing.Mapping[str]

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


status_codeRequired
status_code: str
  • Type: str

HTTP status code for the method response.


content_handlingOptional
content_handling: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.ApiGatewayIntegrationTlsConfig(
  insecure_skip_verification: bool = None
)

Properties

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

insecure_skip_verificationOptional
insecure_skip_verification: bool
  • Type: bool

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.ApiKeyOptions(
  source: ApiKeySourceType,
  required_by_default: bool = None
)

Properties

Name Type Description
source aws_cdk.aws_apigateway.ApiKeySourceType Source type for an API key.
required_by_default bool Set to true to require an API key on all operations by default.

sourceRequired
source: ApiKeySourceType
  • Type: aws_cdk.aws_apigateway.ApiKeySourceType

Source type for an API key.


required_by_defaultOptional
required_by_default: bool
  • Type: bool

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.AuthorizerProps(
  authorization_type: AuthorizationType,
  authorizer_id: str,
  authorization_scopes: typing.List[str] = None
)

Properties

Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.

authorization_typeRequired
authorization_type: AuthorizationType
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
authorizer_id: str
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]

Scopes for the authorizer, if any.


CidrAllowList

Representation of a CIDR range.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.CidrAllowList(
  cidr_ranges: typing.List[str],
  cidr_type: str
)

Properties

Name Type Description
cidr_ranges typing.List[str] Specify an IPv4 address by using CIDR notation.
cidr_type str Type of CIDR range.

cidr_rangesRequired
cidr_ranges: typing.List[str]
  • Type: typing.List[str]

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 .


cidr_typeRequired
cidr_type: str
  • Type: str

Type of CIDR range.


CodeGenerationSourceOptions

Options for the source files used for code generation.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.CodeGenerationSourceOptions(
  spec_path: str
)

Properties

Name Type Description
spec_path str Path to the OpenAPI specification.

spec_pathRequired
spec_path: str
  • Type: str

Path to the OpenAPI specification.


CognitoAuthorizerProps

Properties used to configure a cognito authorizer.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.CognitoAuthorizerProps(
  authorizer_id: str,
  user_pools: typing.List[IUserPool],
  authorization_scopes: typing.List[str] = None
)

Properties

Name Type Description
authorizer_id str Unique identifier for this authorizer.
user_pools typing.List[aws_cdk.aws_cognito.IUserPool] The Cognito user pools associated with this authorizer.
authorization_scopes typing.List[str] A list of authorization scopes configured on the method.

authorizer_idRequired
authorizer_id: str
  • Type: str

Unique identifier for this authorizer.


user_poolsRequired
user_pools: typing.List[IUserPool]
  • Type: typing.List[aws_cdk.aws_cognito.IUserPool]

The Cognito user pools associated with this authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]
  • 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.CustomAuthorizerProps(
  authorizer_id: str,
  function: IFunction,
  authorizer_result_ttl_in_seconds: typing.Union[int, float] = None,
  identity_source: str = None,
  type: CustomAuthorizerType = None
)

Properties

Name Type Description
authorizer_id str Unique identifier for this authorizer.
function aws_cdk.aws_lambda.IFunction The lambda function used to authorize requests.
authorizer_result_ttl_in_seconds typing.Union[int, float] The number of seconds during which the authorizer result is cached.
identity_source str The source of the identity in an incoming request.
type CustomAuthorizerType The type of custom authorizer.

authorizer_idRequired
authorizer_id: str
  • Type: str

Unique identifier for this authorizer.


functionRequired
function: IFunction
  • Type: aws_cdk.aws_lambda.IFunction

The lambda function used to authorize requests.


authorizer_result_ttl_in_secondsOptional
authorizer_result_ttl_in_seconds: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • Default: 300

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


identity_sourceOptional
identity_source: str
  • Type: str
  • 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
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.CustomIntegrationResponseSetProps(
  responses: typing.Mapping[ApiGatewayIntegrationResponse] = None
)

Properties

Name Type Description
responses typing.Mapping[ApiGatewayIntegrationResponse] The responses to add to the integration response.

responsesOptional
responses: typing.Mapping[ApiGatewayIntegrationResponse]

The responses to add to the integration response.


DefaultPassthroughIntegrationResponseSetProps

Options for the DefaultPassthroughIntegrationResponseSet.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.DefaultPassthroughIntegrationResponseSetProps(
  status_code: typing.Union[int, float] = None
)

Properties

Name Type Description
status_code typing.Union[int, float] Override the status code returned by the default integration response.

status_codeOptional
status_code: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • Default: 200

Override the status code returned by the default integration response.


DocumentationConfiguration

Configuration for generated documentation.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.DocumentationConfiguration(
  formats: typing.List[DocumentationFormat],
  options: GeneratedDocumentationOptions = None
)

Properties

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

formatsRequired
formats: typing.List[DocumentationFormat]

Formats for generated documentation.


optionsOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedAsyncApiHtmlDocumentationOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedAsyncApiMarkdownDocumentationOptions

Options for the async api markdown documentation project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedAsyncApiMarkdownDocumentationOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedCodeProjects

Generated code projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedCodeProjects(
  java: JavaProject = None,
  python: PythonProject = None,
  typescript: TypeScriptProject = None
)

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
java: JavaProject
  • Type: projen.java.JavaProject

Generated java project.


pythonOptional
python: PythonProject
  • Type: projen.python.PythonProject

Generated python project.


typescriptOptional
typescript: TypeScriptProject
  • Type: projen.typescript.TypeScriptProject

Generated typescript project.


GeneratedDocumentationOptions

Options for generated documentation projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedDocumentationOptions(
  html_redoc: GeneratedHtmlRedocDocumentationOptions = None,
  markdown: GeneratedMarkdownDocumentationOptions = None,
  plantuml: GeneratedPlantumlDocumentationOptions = None
)

Properties

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

html_redocOptional
html_redoc: GeneratedHtmlRedocDocumentationOptions

Generated html redoc documentation project options.


markdownOptional
markdown: GeneratedMarkdownDocumentationOptions

Generated markdown documentation project options.


plantumlOptional
plantuml: GeneratedPlantumlDocumentationOptions

Generated plantuml documentation project options.


GeneratedDocumentationProjects

Generated documentation project references.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedDocumentationProjects(
  html_redoc: Project = None,
  markdown: Project = None,
  plantuml: Project = None
)

Properties

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

html_redocOptional
html_redoc: Project
  • Type: projen.Project

Generated html redoc documentation project.


markdownOptional
markdown: Project
  • Type: projen.Project

Generated markdown documentation project.


plantumlOptional
plantuml: Project
  • Type: projen.Project

Generated plantuml documentation project.


GeneratedHandlersCodeOptions

Options for lambda handler projects for implementing API operations.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedHandlersCodeOptions(
  java: GeneratedJavaHandlersOptions = None,
  python: GeneratedPythonHandlersOptions = None,
  typescript: GeneratedTypeScriptHandlersOptions = None
)

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
java: GeneratedJavaHandlersOptions

Options for the java handlers project.

These override the default inferred options.


pythonOptional
python: GeneratedPythonHandlersOptions

Options for the python handlers project.

These override the default inferred options.


typescriptOptional
typescript: GeneratedTypeScriptHandlersOptions

Options for the typescript handlers project.

These override the default inferred options.


GeneratedHtml2DocumentationOptions

Options for the html2 documentation project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedHtml2DocumentationOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedHtmlRedocDocumentationOptions

Options for the html redoc documentation project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedHtmlRedocDocumentationOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedInfrastructureCodeOptions

Options for generated infrastructure.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedInfrastructureCodeOptions(
  java: GeneratedJavaInfrastructureOptions = None,
  python: GeneratedPythonInfrastructureOptions = None,
  typescript: GeneratedTypeScriptInfrastructureOptions = None
)

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
java: GeneratedJavaInfrastructureOptions

Options for the generated java infrastructure project.

These override the default inferred options.


pythonOptional
python: GeneratedPythonInfrastructureOptions

Options for the generated python infrastructure project.

These override the default inferred options.


typescriptOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedJavaHandlersOptions(
  artifact_id: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  commit_generated: bool = None,
  compile_options: MavenCompileOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  distdir: str = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  group_id: str = None,
  junit: bool = None,
  junit_options: JunitOptions = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  name: str = None,
  outdir: str = None,
  packaging: str = None,
  packaging_options: MavenPackagingOptions = None,
  parent: Project = None,
  parent_pom: ParentPom = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_java: bool = None,
  projenrc_java_options: ProjenrcOptions = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  sample_java_package: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  test_deps: typing.List[str] = None,
  url: str = None,
  version: str = None,
  vscode: bool = None,
  commit_generated_code: bool = None,
  runtime_version: JavaVersion = None
)

Properties

Name Type Description
artifact_id str The artifactId is generally the name that the project is known by.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
compile_options projen.java.MavenCompileOptions Compile options.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description str Description of a project is always good.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
distdir str Final artifact output directory.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
group_id str This is generally unique amongst an organization or a project.
junit bool Include junit tests.
junit_options projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
packaging str Project packaging format.
packaging_options projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parent_pom 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.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_java bool Use projenrc in java.
projenrc_java_options projen.java.ProjenrcOptions Options related to projenrc in java.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projen_token_secret str 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 bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
sample_java_package str The java package to use for the code sample.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
test_deps typing.List[str] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url str The URL, like the name, is not required.
version str This is the last piece of the naming puzzle.
vscode bool Enable VSCode integration.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.
runtime_version JavaVersion Runtime version to target for the handlers.

artifact_idOptional
artifact_id: str
  • Type: str
  • 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.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


compile_optionsOptional
compile_options: MavenCompileOptions
  • Type: projen.java.MavenCompileOptions
  • Default: defaults

Compile options.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str
  • 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.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


distdirOptional
distdir: str
  • Type: str
  • Default: "dist/java"

Final artifact output directory.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


group_idOptional
group_id: str
  • Type: str
  • 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
junit: bool
  • Type: bool
  • Default: true

Include junit tests.


junit_optionsOptional
junit_options: JunitOptions
  • Type: projen.java.JunitOptions
  • Default: defaults

junit options.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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
packaging: str
  • Type: str
  • Default: "jar"

Project packaging format.


packaging_optionsOptional
packaging_options: MavenPackagingOptions
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


parentOptional
parent: Project
  • Type: projen.Project

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


parent_pomOptional
parent_pom: 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.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_javaOptional
projenrc_java: bool
  • Type: bool
  • 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.


projenrc_java_optionsOptional
projenrc_java_options: ProjenrcOptions
  • Type: projen.java.ProjenrcOptions
  • Default: default options

Options related to projenrc in java.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
readme: SampleReadmeProps
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


sample_java_packageOptional
sample_java_package: str
  • Type: str
  • Default: "org.acme"

The java package to use for the code sample.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


test_depsOptional
test_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addTestDependency().


urlOptional
url: str
  • Type: str
  • 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
version: str
  • Type: str
  • 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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


runtime_versionOptional
runtime_version: JavaVersion

Runtime version to target for the handlers.


GeneratedJavaInfrastructureOptions

Options for configuring a generated java infrastructure project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedJavaInfrastructureOptions(
  artifact_id: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  commit_generated: bool = None,
  compile_options: MavenCompileOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  distdir: str = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  group_id: str = None,
  junit: bool = None,
  junit_options: JunitOptions = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  name: str = None,
  outdir: str = None,
  packaging: str = None,
  packaging_options: MavenPackagingOptions = None,
  parent: Project = None,
  parent_pom: ParentPom = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_java: bool = None,
  projenrc_java_options: ProjenrcOptions = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  sample_java_package: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  test_deps: typing.List[str] = None,
  url: str = None,
  version: str = None,
  vscode: bool = None,
  commit_generated_code: bool = None,
  mock_data_options: MockResponseDataGenerationOptions = None
)

Properties

Name Type Description
artifact_id str The artifactId is generally the name that the project is known by.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
compile_options projen.java.MavenCompileOptions Compile options.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description str Description of a project is always good.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
distdir str Final artifact output directory.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
group_id str This is generally unique amongst an organization or a project.
junit bool Include junit tests.
junit_options projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
packaging str Project packaging format.
packaging_options projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parent_pom 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.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_java bool Use projenrc in java.
projenrc_java_options projen.java.ProjenrcOptions Options related to projenrc in java.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projen_token_secret str 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 bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
sample_java_package str The java package to use for the code sample.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
test_deps typing.List[str] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url str The URL, like the name, is not required.
version str This is the last piece of the naming puzzle.
vscode bool Enable VSCode integration.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.
mock_data_options MockResponseDataGenerationOptions Options for the generated mock response data.

artifact_idOptional
artifact_id: str
  • Type: str
  • 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.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


compile_optionsOptional
compile_options: MavenCompileOptions
  • Type: projen.java.MavenCompileOptions
  • Default: defaults

Compile options.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str
  • 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.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


distdirOptional
distdir: str
  • Type: str
  • Default: "dist/java"

Final artifact output directory.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


group_idOptional
group_id: str
  • Type: str
  • 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
junit: bool
  • Type: bool
  • Default: true

Include junit tests.


junit_optionsOptional
junit_options: JunitOptions
  • Type: projen.java.JunitOptions
  • Default: defaults

junit options.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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
packaging: str
  • Type: str
  • Default: "jar"

Project packaging format.


packaging_optionsOptional
packaging_options: MavenPackagingOptions
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


parentOptional
parent: Project
  • Type: projen.Project

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


parent_pomOptional
parent_pom: 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.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_javaOptional
projenrc_java: bool
  • Type: bool
  • 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.


projenrc_java_optionsOptional
projenrc_java_options: ProjenrcOptions
  • Type: projen.java.ProjenrcOptions
  • Default: default options

Options related to projenrc in java.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
readme: SampleReadmeProps
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


sample_java_packageOptional
sample_java_package: str
  • Type: str
  • Default: "org.acme"

The java package to use for the code sample.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


test_depsOptional
test_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addTestDependency().


urlOptional
url: str
  • Type: str
  • 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
version: str
  • Type: str
  • 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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


mock_data_optionsOptional
mock_data_options: MockResponseDataGenerationOptions

Options for the generated mock response data.


GeneratedJavaRuntimeOptions

Options for configuring a generated java runtime project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedJavaRuntimeOptions(
  artifact_id: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  commit_generated: bool = None,
  compile_options: MavenCompileOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  distdir: str = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  group_id: str = None,
  junit: bool = None,
  junit_options: JunitOptions = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  name: str = None,
  outdir: str = None,
  packaging: str = None,
  packaging_options: MavenPackagingOptions = None,
  parent: Project = None,
  parent_pom: ParentPom = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_java: bool = None,
  projenrc_java_options: ProjenrcOptions = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  sample_java_package: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  test_deps: typing.List[str] = None,
  url: str = None,
  version: str = None,
  vscode: bool = None,
  commit_generated_code: bool = None
)

Properties

Name Type Description
artifact_id str The artifactId is generally the name that the project is known by.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
compile_options projen.java.MavenCompileOptions Compile options.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description str Description of a project is always good.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
distdir str Final artifact output directory.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
group_id str This is generally unique amongst an organization or a project.
junit bool Include junit tests.
junit_options projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
packaging str Project packaging format.
packaging_options projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parent_pom 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.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_java bool Use projenrc in java.
projenrc_java_options projen.java.ProjenrcOptions Options related to projenrc in java.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projen_token_secret str 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 bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
sample_java_package str The java package to use for the code sample.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
test_deps typing.List[str] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url str The URL, like the name, is not required.
version str This is the last piece of the naming puzzle.
vscode bool Enable VSCode integration.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

artifact_idOptional
artifact_id: str
  • Type: str
  • 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.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


compile_optionsOptional
compile_options: MavenCompileOptions
  • Type: projen.java.MavenCompileOptions
  • Default: defaults

Compile options.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str
  • 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.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


distdirOptional
distdir: str
  • Type: str
  • Default: "dist/java"

Final artifact output directory.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


group_idOptional
group_id: str
  • Type: str
  • 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
junit: bool
  • Type: bool
  • Default: true

Include junit tests.


junit_optionsOptional
junit_options: JunitOptions
  • Type: projen.java.JunitOptions
  • Default: defaults

junit options.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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
packaging: str
  • Type: str
  • Default: "jar"

Project packaging format.


packaging_optionsOptional
packaging_options: MavenPackagingOptions
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


parentOptional
parent: Project
  • Type: projen.Project

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


parent_pomOptional
parent_pom: 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.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_javaOptional
projenrc_java: bool
  • Type: bool
  • 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.


projenrc_java_optionsOptional
projenrc_java_options: ProjenrcOptions
  • Type: projen.java.ProjenrcOptions
  • Default: default options

Options related to projenrc in java.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
readme: SampleReadmeProps
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


sample_java_packageOptional
sample_java_package: str
  • Type: str
  • Default: "org.acme"

The java package to use for the code sample.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


test_depsOptional
test_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addTestDependency().


urlOptional
url: str
  • Type: str
  • 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
version: str
  • Type: str
  • 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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedLibraryOptions

Options for generated libraries.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedLibraryOptions(
  typescript_react_query_hooks: GeneratedTypeScriptReactQueryHooksOptions = None
)

Properties

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

typescript_react_query_hooksOptional
typescript_react_query_hooks: GeneratedTypeScriptReactQueryHooksOptions

Options for the generated typescript react-query hooks library.

These override the default inferred options.


GeneratedLibraryProjects

Generated library projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedLibraryProjects(
  typescript_react_query_hooks: TypeScriptProject = None
)

Properties

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

typescript_react_query_hooksOptional
typescript_react_query_hooks: TypeScriptProject
  • Type: projen.typescript.TypeScriptProject

Generated typescript react-query hooks project.


GeneratedMarkdownDocumentationOptions

Options for the markdown documentation project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedMarkdownDocumentationOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedPlantumlDocumentationOptions

Options for the plantuml documentation project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedPlantumlDocumentationOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedProjectOptions

Options for a code project generated with OpenAPI Generator.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedProjectOptions(
  commit_generated_code: bool = None
)

Properties

Name Type Description
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedPythonHandlersOptions

Options for configuring a generated python handlers project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedPythonHandlersOptions(
  author_email: str = None,
  author_name: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  classifiers: typing.List[str] = None,
  clobber: bool = None,
  commit_generated: bool = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  license: str = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  module_name: str = None,
  name: str = None,
  outdir: str = None,
  package_name: str = None,
  parent: Project = None,
  poetry_options: PoetryPyprojectOptionsWithoutDeps = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_python_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  pytest: bool = None,
  pytest_options: PytestOptions = None,
  python_exec: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  setup_config: typing.Mapping[typing.Any] = None,
  setuptools: bool = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  version: str = None,
  vscode: bool = None,
  commit_generated_code: bool = None,
  architecture: Architecture = None,
  runtime_version: PythonVersion = None
)

Properties

Name Type Description
author_email str Author's e-mail.
author_name str Author's name.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers typing.List[str] A list of PyPI trove classifiers that describe the project.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description str A short description of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str A URL to the website of the project.
license str License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
module_name str Name of the python package as used in imports and filenames.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package_name str Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetry_options projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_python_options projen.python.ProjenrcOptions Options related to projenrc in python.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest bool Include pytest tests.
pytest_options projen.python.PytestOptions pytest options.
python_exec str Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
setup_config typing.Mapping[typing.Any] Additional fields to pass in the setup() function if using setuptools.
setuptools bool Use setuptools with a setup.py script for packaging and publishing.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
version str Version of the package.
vscode bool Enable VSCode integration.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.
architecture Architecture The architecture to target for python handlers.
runtime_version PythonVersion Runtime version to target for the handlers.

author_emailOptional
author_email: str
  • Type: str
  • Default: $GIT_USER_EMAIL

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str
  • Default: $GIT_USER_NAME

Author's name.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
classifiers: typing.List[str]
  • Type: typing.List[str]

A list of PyPI trove classifiers that describe the project.


clobberOptional
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str

A short description of the package.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDevDependency().


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

A URL to the website of the project.


licenseOptional
license: str
  • Type: str

License of this package as an SPDX identifier.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


module_nameOptional
module_name: str
  • Type: str
  • Default: $PYTHON_MODULE_NAME

Name of the python package as used in imports and filenames.

Must only consist of alphanumeric characters and underscores.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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.


package_nameOptional
package_name: str
  • Type: str

Package name.


parentOptional
parent: Project
  • Type: projen.Project

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


poetry_optionsOptional
poetry_options: PoetryPyprojectOptionsWithoutDeps
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_python_optionsOptional
projenrc_python_options: ProjenrcOptions
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
pytest: bool
  • Type: bool
  • Default: true

Include pytest tests.


pytest_optionsOptional
pytest_options: PytestOptions
  • Type: projen.python.PytestOptions
  • Default: defaults

pytest options.


python_execOptional
python_exec: str
  • Type: str
  • Default: "python"

Path to the python executable to use.


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

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


setup_configOptional
setup_config: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

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


setuptoolsOptional
setuptools: bool
  • Type: bool
  • Default: true, unless poetry is true, then false

Use setuptools with a setup.py script for packaging and publishing.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


versionOptional
version: str
  • Type: str
  • Default: "0.1.0"

Version of the package.


vscodeOptional
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


architectureOptional
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


runtime_versionOptional
runtime_version: PythonVersion

Runtime version to target for the handlers.


GeneratedPythonInfrastructureOptions

Options for configuring a generated python infrastructure project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedPythonInfrastructureOptions(
  author_email: str = None,
  author_name: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  classifiers: typing.List[str] = None,
  clobber: bool = None,
  commit_generated: bool = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  license: str = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  module_name: str = None,
  name: str = None,
  outdir: str = None,
  package_name: str = None,
  parent: Project = None,
  poetry_options: PoetryPyprojectOptionsWithoutDeps = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_python_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  pytest: bool = None,
  pytest_options: PytestOptions = None,
  python_exec: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  setup_config: typing.Mapping[typing.Any] = None,
  setuptools: bool = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  version: str = None,
  vscode: bool = None,
  commit_generated_code: bool = None,
  mock_data_options: MockResponseDataGenerationOptions = None
)

Properties

Name Type Description
author_email str Author's e-mail.
author_name str Author's name.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers typing.List[str] A list of PyPI trove classifiers that describe the project.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description str A short description of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str A URL to the website of the project.
license str License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
module_name str Name of the python package as used in imports and filenames.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package_name str Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetry_options projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_python_options projen.python.ProjenrcOptions Options related to projenrc in python.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest bool Include pytest tests.
pytest_options projen.python.PytestOptions pytest options.
python_exec str Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
setup_config typing.Mapping[typing.Any] Additional fields to pass in the setup() function if using setuptools.
setuptools bool Use setuptools with a setup.py script for packaging and publishing.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
version str Version of the package.
vscode bool Enable VSCode integration.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.
mock_data_options MockResponseDataGenerationOptions Options for the generated mock response data.

author_emailOptional
author_email: str
  • Type: str
  • Default: $GIT_USER_EMAIL

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str
  • Default: $GIT_USER_NAME

Author's name.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
classifiers: typing.List[str]
  • Type: typing.List[str]

A list of PyPI trove classifiers that describe the project.


clobberOptional
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str

A short description of the package.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDevDependency().


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

A URL to the website of the project.


licenseOptional
license: str
  • Type: str

License of this package as an SPDX identifier.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


module_nameOptional
module_name: str
  • Type: str
  • Default: $PYTHON_MODULE_NAME

Name of the python package as used in imports and filenames.

Must only consist of alphanumeric characters and underscores.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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.


package_nameOptional
package_name: str
  • Type: str

Package name.


parentOptional
parent: Project
  • Type: projen.Project

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


poetry_optionsOptional
poetry_options: PoetryPyprojectOptionsWithoutDeps
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_python_optionsOptional
projenrc_python_options: ProjenrcOptions
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
pytest: bool
  • Type: bool
  • Default: true

Include pytest tests.


pytest_optionsOptional
pytest_options: PytestOptions
  • Type: projen.python.PytestOptions
  • Default: defaults

pytest options.


python_execOptional
python_exec: str
  • Type: str
  • Default: "python"

Path to the python executable to use.


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

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


setup_configOptional
setup_config: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

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


setuptoolsOptional
setuptools: bool
  • Type: bool
  • Default: true, unless poetry is true, then false

Use setuptools with a setup.py script for packaging and publishing.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


versionOptional
version: str
  • Type: str
  • Default: "0.1.0"

Version of the package.


vscodeOptional
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


mock_data_optionsOptional
mock_data_options: MockResponseDataGenerationOptions

Options for the generated mock response data.


GeneratedPythonRuntimeOptions

Options for configuring a generated python runtime project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedPythonRuntimeOptions(
  author_email: str = None,
  author_name: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  classifiers: typing.List[str] = None,
  clobber: bool = None,
  commit_generated: bool = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  license: str = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  module_name: str = None,
  name: str = None,
  outdir: str = None,
  package_name: str = None,
  parent: Project = None,
  poetry_options: PoetryPyprojectOptionsWithoutDeps = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_python_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  pytest: bool = None,
  pytest_options: PytestOptions = None,
  python_exec: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  setup_config: typing.Mapping[typing.Any] = None,
  setuptools: bool = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  version: str = None,
  vscode: bool = None,
  commit_generated_code: bool = None
)

Properties

Name Type Description
author_email str Author's e-mail.
author_name str Author's name.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers typing.List[str] A list of PyPI trove classifiers that describe the project.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description str A short description of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str A URL to the website of the project.
license str License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
module_name str Name of the python package as used in imports and filenames.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package_name str Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetry_options projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_python_options projen.python.ProjenrcOptions Options related to projenrc in python.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest bool Include pytest tests.
pytest_options projen.python.PytestOptions pytest options.
python_exec str Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
setup_config typing.Mapping[typing.Any] Additional fields to pass in the setup() function if using setuptools.
setuptools bool Use setuptools with a setup.py script for packaging and publishing.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
version str Version of the package.
vscode bool Enable VSCode integration.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

author_emailOptional
author_email: str
  • Type: str
  • Default: $GIT_USER_EMAIL

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str
  • Default: $GIT_USER_NAME

Author's name.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
classifiers: typing.List[str]
  • Type: typing.List[str]

A list of PyPI trove classifiers that describe the project.


clobberOptional
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str

A short description of the package.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDevDependency().


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

A URL to the website of the project.


licenseOptional
license: str
  • Type: str

License of this package as an SPDX identifier.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


module_nameOptional
module_name: str
  • Type: str
  • Default: $PYTHON_MODULE_NAME

Name of the python package as used in imports and filenames.

Must only consist of alphanumeric characters and underscores.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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.


package_nameOptional
package_name: str
  • Type: str

Package name.


parentOptional
parent: Project
  • Type: projen.Project

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


poetry_optionsOptional
poetry_options: PoetryPyprojectOptionsWithoutDeps
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_python_optionsOptional
projenrc_python_options: ProjenrcOptions
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
pytest: bool
  • Type: bool
  • Default: true

Include pytest tests.


pytest_optionsOptional
pytest_options: PytestOptions
  • Type: projen.python.PytestOptions
  • Default: defaults

pytest options.


python_execOptional
python_exec: str
  • Type: str
  • Default: "python"

Path to the python executable to use.


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

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


setup_configOptional
setup_config: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

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


setuptoolsOptional
setuptools: bool
  • Type: bool
  • Default: true, unless poetry is true, then false

Use setuptools with a setup.py script for packaging and publishing.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


versionOptional
version: str
  • Type: str
  • Default: "0.1.0"

Version of the package.


vscodeOptional
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedRuntimeCodeOptions

Options for generated runtimes.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedRuntimeCodeOptions(
  java: GeneratedJavaRuntimeOptions = None,
  python: GeneratedPythonRuntimeOptions = None,
  typescript: GeneratedTypeScriptRuntimeOptions = None
)

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
java: GeneratedJavaRuntimeOptions

Options for a generated java project.

These override the default inferred options.


pythonOptional
python: GeneratedPythonRuntimeOptions

Options for a generated python project.

These override the default inferred options.


typescriptOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedTypeScriptHandlersOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None,
  commit_generated_code: bool = None,
  handler_entry_points: typing.List[str] = None,
  runtime_version: NodeVersion = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.
handler_entry_points typing.List[str] Globs for lambda handler entry points, used by esbuild.
runtime_version NodeVersion Runtime version to target for the handlers.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


handler_entry_pointsOptional
handler_entry_points: typing.List[str]
  • Type: typing.List[str]
  • Default: src/*.ts - all files directly under the src directory

Globs for lambda handler entry points, used by esbuild.


runtime_versionOptional
runtime_version: NodeVersion

Runtime version to target for the handlers.


GeneratedTypeScriptInfrastructureOptions

Options for configuring a generated typescript infrastructure project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedTypeScriptInfrastructureOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None,
  commit_generated_code: bool = None,
  mock_data_options: MockResponseDataGenerationOptions = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.
mock_data_options MockResponseDataGenerationOptions Options for the generated mock response data.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


mock_data_optionsOptional
mock_data_options: MockResponseDataGenerationOptions

Options for the generated mock response data.


GeneratedTypeScriptReactQueryHooksOptions

Options for configuring a generated typescript hooks library project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedTypeScriptReactQueryHooksOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None,
  commit_generated_code: bool = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedTypeScriptRuntimeOptions

Options for configuring a generated typescript runtime project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedTypeScriptRuntimeOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None,
  commit_generated_code: bool = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedTypeScriptWebSocketClientOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None,
  commit_generated_code: bool = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedTypeScriptWebSocketHooksOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None,
  commit_generated_code: bool = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
commit_generated_code bool Whether to commit the code generated by the OpenAPI Generator.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


GeneratedWebSocketDocumentationOptions

Options for generated websocket documentation projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedWebSocketDocumentationOptions(
  html: GeneratedAsyncApiHtmlDocumentationOptions = None,
  markdown: GeneratedAsyncApiMarkdownDocumentationOptions = None
)

Properties

Name Type Description
html GeneratedAsyncApiHtmlDocumentationOptions Generated AsyncAPI html documentation project options.
markdown GeneratedAsyncApiMarkdownDocumentationOptions Generated AsyncAPI markdown documentation project options.

htmlOptional
html: GeneratedAsyncApiHtmlDocumentationOptions

Generated AsyncAPI html documentation project options.


markdownOptional
markdown: GeneratedAsyncApiMarkdownDocumentationOptions

Generated AsyncAPI markdown documentation project options.


GeneratedWebSocketDocumentationProjects

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedWebSocketDocumentationProjects(
  html: Project = None,
  markdown: Project = None
)

Properties

Name Type Description
html projen.Project Generated AsyncAPI html documentation project.
markdown projen.Project Generated AsyncAPI markdown documentation project.

htmlOptional
html: Project
  • Type: projen.Project

Generated AsyncAPI html documentation project.


markdownOptional
markdown: Project
  • Type: projen.Project

Generated AsyncAPI markdown documentation project.


GeneratedWebSocketLibraryOptions

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedWebSocketLibraryOptions(
  typescript_web_socket_client: GeneratedTypeScriptWebSocketClientOptions = None,
  typescript_web_socket_hooks: GeneratedTypeScriptWebSocketHooksOptions = None
)

Properties

Name Type Description
typescript_web_socket_client GeneratedTypeScriptWebSocketClientOptions Options for the generated typescript websocket client library.
typescript_web_socket_hooks GeneratedTypeScriptWebSocketHooksOptions Options for the generated typescript websocket hooks library.

typescript_web_socket_clientOptional
typescript_web_socket_client: GeneratedTypeScriptWebSocketClientOptions

Options for the generated typescript websocket client library.

These override the default inferred options.


typescript_web_socket_hooksOptional
typescript_web_socket_hooks: GeneratedTypeScriptWebSocketHooksOptions

Options for the generated typescript websocket hooks library.

These override the default inferred options.


GeneratedWebSocketLibraryProjects

Generated websocket library projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.GeneratedWebSocketLibraryProjects(
  typescript_web_socket_client: TypeScriptProject = None,
  typescript_web_socket_hooks: TypeScriptProject = None
)

Properties

Name Type Description
typescript_web_socket_client projen.typescript.TypeScriptProject Generated typescript websocket client project.
typescript_web_socket_hooks projen.typescript.TypeScriptProject Generated typescript websocket hooks project.

typescript_web_socket_clientOptional
typescript_web_socket_client: TypeScriptProject
  • Type: projen.typescript.TypeScriptProject

Generated typescript websocket client project.


typescript_web_socket_hooksOptional
typescript_web_socket_hooks: TypeScriptProject
  • Type: projen.typescript.TypeScriptProject

Generated typescript websocket hooks project.


HandlersConfiguration

Configuration for generated lambda handlers.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.HandlersConfiguration(
  languages: typing.List[Language],
  options: GeneratedHandlersCodeOptions = None
)

Properties

Name Type Description
languages typing.List[Language] The languages lambda handlers are written in.
options GeneratedHandlersCodeOptions Options for the infrastructure package.

languagesRequired
languages: typing.List[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
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.InfrastructureConfiguration(
  language: Language,
  options: GeneratedInfrastructureCodeOptions = None
)

Properties

Name Type Description
language Language The language to generate the type-safe CDK infrastructure in.
options GeneratedInfrastructureCodeOptions Options for the infrastructure package.

languageRequired
language: Language

The language to generate the type-safe CDK infrastructure in.


optionsOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationGrantProps(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  api: SpecRestApi,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct
)

Properties

Name Type Description
method str The http method of this operation.
path str The path of this operation in the api.
content_types typing.List[str] Content types accepted by this operation.
api aws_cdk.aws_apigateway.SpecRestApi The api to grant permissions for.
operation_id str The ID of the operation for which permissions are being granted.
operation_lookup typing.Mapping[OperationDetails] Details about all operations in the API.
scope constructs.Construct The scope in which permission resources can be created.

methodRequired
method: str
  • Type: str

The http method of this operation.


pathRequired
path: str
  • Type: str

The path of this operation in the api.


content_typesOptional
content_types: typing.List[str]
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


apiRequired
api: SpecRestApi
  • Type: aws_cdk.aws_apigateway.SpecRestApi

The api to grant permissions for.


operation_idRequired
operation_id: str
  • Type: str

The ID of the operation for which permissions are being granted.


operation_lookupRequired
operation_lookup: typing.Mapping[OperationDetails]

Details about all operations in the API.


scopeRequired
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationRenderProps(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
)

Properties

Name Type Description
method str The http method of this operation.
path str The path of this operation in the api.
content_types typing.List[str] Content types accepted by this operation.
operation_id str The ID of the operation being rendered.
operation_lookup typing.Mapping[OperationDetails] Details about all operations in the API.
scope constructs.Construct The scope in which the integration is being rendered.
cors_options SerializedCorsOptions Cross Origin Resource Sharing options for the API.

methodRequired
method: str
  • Type: str

The http method of this operation.


pathRequired
path: str
  • Type: str

The path of this operation in the api.


content_typesOptional
content_types: typing.List[str]
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
operation_id: str
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired
operation_lookup: typing.Mapping[OperationDetails]

Details about all operations in the API.


scopeRequired
scope: Construct
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional
cors_options: SerializedCorsOptions

Cross Origin Resource Sharing options for the API.


JavaProjectOptions

JavaProjectOptions.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.JavaProjectOptions(
  artifact_id: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  commit_generated: bool = None,
  compile_options: MavenCompileOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  distdir: str = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  group_id: str = None,
  junit: bool = None,
  junit_options: JunitOptions = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  name: str = None,
  outdir: str = None,
  packaging: str = None,
  packaging_options: MavenPackagingOptions = None,
  parent: Project = None,
  parent_pom: ParentPom = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_java: bool = None,
  projenrc_java_options: ProjenrcOptions = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  sample_java_package: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  test_deps: typing.List[str] = None,
  url: str = None,
  version: str = None,
  vscode: bool = None
)

Properties

Name Type Description
artifact_id str The artifactId is generally the name that the project is known by.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
compile_options projen.java.MavenCompileOptions Compile options.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
description str Description of a project is always good.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
distdir str Final artifact output directory.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
group_id str This is generally unique amongst an organization or a project.
junit bool Include junit tests.
junit_options projen.java.JunitOptions junit options.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
packaging str Project packaging format.
packaging_options projen.java.MavenPackagingOptions Packaging options.
parent projen.Project The parent project, if this project is part of a bigger project.
parent_pom 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.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_java bool Use projenrc in java.
projenrc_java_options projen.java.ProjenrcOptions Options related to projenrc in java.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projen_token_secret str 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 bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
sample_java_package str The java package to use for the code sample.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
test_deps typing.List[str] List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.
url str The URL, like the name, is not required.
version str This is the last piece of the naming puzzle.
vscode bool Enable VSCode integration.

artifact_idOptional
artifact_id: str
  • Type: str
  • 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.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


compile_optionsOptional
compile_options: MavenCompileOptions
  • Type: projen.java.MavenCompileOptions
  • Default: defaults

Compile options.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str
  • 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.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


distdirOptional
distdir: str
  • Type: str
  • Default: "dist/java"

Final artifact output directory.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


group_idOptional
group_id: str
  • Type: str
  • 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
junit: bool
  • Type: bool
  • Default: true

Include junit tests.


junit_optionsOptional
junit_options: JunitOptions
  • Type: projen.java.JunitOptions
  • Default: defaults

junit options.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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
packaging: str
  • Type: str
  • Default: "jar"

Project packaging format.


packaging_optionsOptional
packaging_options: MavenPackagingOptions
  • Type: projen.java.MavenPackagingOptions
  • Default: defaults

Packaging options.


parentOptional
parent: Project
  • Type: projen.Project

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


parent_pomOptional
parent_pom: 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.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_javaOptional
projenrc_java: bool
  • Type: bool
  • 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.


projenrc_java_optionsOptional
projenrc_java_options: ProjenrcOptions
  • Type: projen.java.ProjenrcOptions
  • Default: default options

Options related to projenrc in java.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
readme: SampleReadmeProps
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


sample_java_packageOptional
sample_java_package: str
  • Type: str
  • Default: "org.acme"

The java package to use for the code sample.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


test_depsOptional
test_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>.

Additional dependencies can be added via project.addTestDependency().


urlOptional
url: str
  • Type: str
  • 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
version: str
  • Type: str
  • 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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


LibraryConfiguration

Configuration for generated libraries.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.LibraryConfiguration(
  libraries: typing.List[Library],
  options: GeneratedLibraryOptions = None
)

Properties

Name Type Description
libraries typing.List[Library] The library to generate.
options GeneratedLibraryOptions Options for the generated library package.

librariesRequired
libraries: typing.List[Library]

The library to generate.


optionsOptional
options: GeneratedLibraryOptions

Options for the generated library package.

Note that only options for the specified libraries will apply


ManagedRule

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.ManagedRule(
  name: str,
  excluded_rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ExcludedRuleProperty]]] = None,
  managed_rule_group_configs: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ManagedRuleGroupConfigProperty]]] = None,
  rule_action_overrides: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, RuleActionOverrideProperty]]] = None,
  scope_down_statement: typing.Union[IResolvable, StatementProperty] = None,
  version: str = None,
  vendor: str = None,
  vendor_name: str = None
)

Properties

Name Type Description
name str The name of the managed rule group.
excluded_rules typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.aws_wafv2.CfnWebACL.ExcludedRuleProperty]]] Rules in the referenced rule group whose actions are set to Count .
managed_rule_group_configs typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.aws_wafv2.CfnWebACL.ManagedRuleGroupConfigProperty]]] Additional information that's used by a managed rule group.
rule_action_overrides typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.aws_wafv2.CfnWebACL.RuleActionOverrideProperty]]] Action settings to use in the place of the rule actions that are configured inside the rule group.
scope_down_statement typing.Union[aws_cdk.IResolvable, aws_cdk.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 str The version of the managed rule group to use.
vendor str The name of the managed rule group vendor.
vendor_name str The name of the managed rule group vendor.

nameRequired
name: str
  • Type: str

The name of the managed rule group.

You use this, along with the vendor name, to identify the rule group.


excluded_rulesOptional
excluded_rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ExcludedRuleProperty]]]
  • Type: typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.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 .


managed_rule_group_configsOptional
managed_rule_group_configs: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ManagedRuleGroupConfigProperty]]]
  • Type: typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.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.

rule_action_overridesOptional
rule_action_overrides: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, RuleActionOverrideProperty]]]
  • Type: typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.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.


scope_down_statementOptional
scope_down_statement: typing.Union[IResolvable, StatementProperty]
  • Type: typing.Union[aws_cdk.IResolvable, aws_cdk.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
version: str
  • Type: str

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.
vendor: str
  • Type: str

The name of the managed rule group vendor.

You use this, along with the rule group name, to identify the rule group.


vendor_nameOptional
vendor_name: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.MethodAndPath(
  method: str,
  path: str
)

Properties

Name Type Description
method str The http method of this operation.
path str The path of this operation in the api.

methodRequired
method: str
  • Type: str

The http method of this operation.


pathRequired
path: str
  • Type: str

The path of this operation in the api.


MockIntegrationResponse

Properties for a mock integration response.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.MockIntegrationResponse(
  status_code: typing.Union[int, float],
  body: str = None
)

Properties

Name Type Description
status_code typing.Union[int, float] HTTP response status code.
body str Response body.

status_codeRequired
status_code: typing.Union[int, float]
  • Type: typing.Union[int, float]

HTTP response status code.


bodyOptional
body: str
  • Type: str

Response body.


MockResponseDataGenerationOptions

Options for generating mock data.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.MockResponseDataGenerationOptions(
  disable: bool = None,
  locale: str = None,
  max_array_length: typing.Union[int, float] = None,
  seed: typing.Union[int, float] = None
)

Properties

Name Type Description
disable bool Set to true to disable generating mock data.
locale str Locale of generated data.
max_array_length typing.Union[int, float] Maximum length of generated arrays.
seed typing.Union[int, float] Seed for faker to generate data with.

disableOptional
disable: bool
  • Type: bool
  • Default: false

Set to true to disable generating mock data.


localeOptional
locale: str
  • Type: str
  • Default: en

Locale of generated data.

https://fakerjs.dev/guide/localization.html#available-locales


max_array_lengthOptional
max_array_length: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • Default: 3

Maximum length of generated arrays.


seedOptional
seed: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • Default: 1337

Seed for faker to generate data with.


MockResponseGenerationOptions

Options for generating mock data.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.MockResponseGenerationOptions(
  mock_data_options: MockResponseDataGenerationOptions = None
)

Properties

Name Type Description
mock_data_options MockResponseDataGenerationOptions Options for the generated mock response data.

mock_data_optionsOptional
mock_data_options: MockResponseDataGenerationOptions

Options for the generated mock response data.


ModelConfiguration

Configuration for modelling the API.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.ModelConfiguration(
  language: ModelLanguage,
  options: ModelOptions
)

Properties

Name Type Description
language ModelLanguage The language the API model is defined in.
options ModelOptions Options for the API model.

languageRequired
language: ModelLanguage

The language the API model is defined in.


optionsRequired
options: ModelOptions

Options for the API model.


ModelOptions

Options for models.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.ModelOptions(
  openapi: OpenApiModelOptions = None,
  smithy: SmithyModelOptions = None,
  type_spec: TypeSpecModelOptions = None
)

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.
type_spec TypeSpecModelOptions Options for the TypeSpec model - required when the model language is TYPESPEC.

openapiOptional
openapi: OpenApiModelOptions

Options for the OpenAPI model - required when model language is OPENAPI.


smithyOptional
smithy: SmithyModelOptions

Options for the Smithy model - required when model language is SMITHY.


type_specOptional
type_spec: TypeSpecModelOptions

Options for the TypeSpec model - required when the model language is TYPESPEC.


ModelProject

Model project references.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.ModelProject(
  api_name: str,
  outdir: str,
  parsed_spec_file: str,
  openapi: OpenApiModelProject = None,
  smithy: SmithyModelProject = None,
  type_spec: TypeSpecModelProject = None
)

Properties

Name Type Description
api_name str Name of the API.
outdir str Directory of the model project.
parsed_spec_file str Name of the bundled OpenAPI specification file.
openapi OpenApiModelProject Reference to the OpenAPI model project.
smithy SmithyModelProject Reference to the Smithy model project.
type_spec TypeSpecModelProject Reference to the TypeSpec model project.

api_nameRequired
api_name: str
  • Type: str

Name of the API.


outdirRequired
outdir: str
  • Type: str

Directory of the model project.


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Name of the bundled OpenAPI specification file.


openapiOptional
openapi: OpenApiModelProject

Reference to the OpenAPI model project.

Will be defined if the model language is OpenAPI


smithyOptional
smithy: SmithyModelProject

Reference to the Smithy model project.

Will be defined if the model language is Smithy


type_specOptional
type_spec: 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.ModelProjectDetails(
  api_name: str,
  outdir: str,
  parsed_spec_file: str
)

Properties

Name Type Description
api_name str Name of the API.
outdir str Directory of the model project.
parsed_spec_file str Name of the bundled OpenAPI specification file.

api_nameRequired
api_name: str
  • Type: str

Name of the API.


outdirRequired
outdir: str
  • Type: str

Directory of the model project.


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Name of the bundled OpenAPI specification file.


OpenApiAsyncDefinitionOptions

Options for the OpenAPI Spec.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncDefinitionOptions(
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

open_api_optionsRequired
open_api_options: OpenApiModelOptions

Options for the openapi model.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


OpenApiAsyncModelProjectOptions

Options for an OpenAPI WebSocket API model.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiAsyncModelProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str,
  async_api_spec_file: str
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


open_api_optionsRequired
open_api_options: OpenApiModelOptions

Options for the openapi model.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


async_api_spec_fileRequired
async_api_spec_file: str
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


OpenApiDefinitionOptions

Options for the OpenAPI Spec.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiDefinitionOptions(
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

open_api_optionsRequired
open_api_options: OpenApiModelOptions

Options for the openapi model.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


OpenApiModelOptions

Options for the OpenAPI model.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiModelOptions(
  title: str
)

Properties

Name Type Description
title str The title in the OpenAPI specification.

titleRequired
title: str
  • Type: str

The title in the OpenAPI specification.


OpenApiModelProjectOptions

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiModelProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


open_api_optionsRequired
open_api_options: OpenApiModelOptions

Options for the openapi model.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


OpenApiProjectDefinitionOptions

Options for the OpenAPI Spec.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OpenApiProjectDefinitionOptions(
  open_api_options: OpenApiModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
open_api_options OpenApiModelOptions Options for the openapi model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

open_api_optionsRequired
open_api_options: OpenApiModelOptions

Options for the openapi model.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


OperationDetails

Details about an API operation.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.OperationDetails(
  method: str,
  path: str,
  content_types: typing.List[str] = None
)

Properties

Name Type Description
method str The http method of this operation.
path str The path of this operation in the api.
content_types typing.List[str] Content types accepted by this operation.

methodRequired
method: str
  • Type: str

The http method of this operation.


pathRequired
path: str
  • Type: str

The path of this operation in the api.


content_typesOptional
content_types: typing.List[str]
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


PartialManagedRuleGroupStatementProperty

PartialManagedRuleGroupStatementProperty.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.PartialManagedRuleGroupStatementProperty(
  name: str,
  excluded_rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ExcludedRuleProperty]]] = None,
  managed_rule_group_configs: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ManagedRuleGroupConfigProperty]]] = None,
  rule_action_overrides: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, RuleActionOverrideProperty]]] = None,
  scope_down_statement: typing.Union[IResolvable, StatementProperty] = None,
  version: str = None
)

Properties

Name Type Description
name str The name of the managed rule group.
excluded_rules typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.aws_wafv2.CfnWebACL.ExcludedRuleProperty]]] Rules in the referenced rule group whose actions are set to Count .
managed_rule_group_configs typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.aws_wafv2.CfnWebACL.ManagedRuleGroupConfigProperty]]] Additional information that's used by a managed rule group.
rule_action_overrides typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.aws_wafv2.CfnWebACL.RuleActionOverrideProperty]]] Action settings to use in the place of the rule actions that are configured inside the rule group.
scope_down_statement typing.Union[aws_cdk.IResolvable, aws_cdk.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 str The version of the managed rule group to use.

nameRequired
name: str
  • Type: str

The name of the managed rule group.

You use this, along with the vendor name, to identify the rule group.


excluded_rulesOptional
excluded_rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ExcludedRuleProperty]]]
  • Type: typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.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 .


managed_rule_group_configsOptional
managed_rule_group_configs: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ManagedRuleGroupConfigProperty]]]
  • Type: typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.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.

rule_action_overridesOptional
rule_action_overrides: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, RuleActionOverrideProperty]]]
  • Type: typing.Union[aws_cdk.IResolvable, typing.List[typing.Union[aws_cdk.IResolvable, aws_cdk.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.


scope_down_statementOptional
scope_down_statement: typing.Union[IResolvable, StatementProperty]
  • Type: typing.Union[aws_cdk.IResolvable, aws_cdk.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
version: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.ProjectCollections(
  documentation: typing.List[Project],
  handlers: typing.List[Project],
  infrastructure: typing.List[Project],
  libraries: typing.List[Project],
  model: typing.List[Project],
  projects: typing.List[Project],
  runtimes: typing.List[Project]
)

Properties

Name Type Description
documentation typing.List[projen.Project] Array of all documentation projects.
handlers typing.List[projen.Project] Array of all handler projects.
infrastructure typing.List[projen.Project] Array of all infrastructure projects.
libraries typing.List[projen.Project] Array of all library projects.
model typing.List[projen.Project] Array of all model projects.
projects typing.List[projen.Project] Array of all projects managed by type-safe-api.
runtimes typing.List[projen.Project] Array of all runtime projects.

documentationRequired
documentation: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all documentation projects.


handlersRequired
handlers: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all handler projects.


infrastructureRequired
infrastructure: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all infrastructure projects.


librariesRequired
libraries: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all library projects.


modelRequired
model: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all model projects.


projectsRequired
projects: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all projects managed by type-safe-api.


runtimesRequired
runtimes: typing.List[Project]
  • Type: typing.List[projen.Project]

Array of all runtime projects.


PythonProjectOptions

PythonProjectOptions.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.PythonProjectOptions(
  author_email: str = None,
  author_name: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  classifiers: typing.List[str] = None,
  clobber: bool = None,
  commit_generated: bool = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  license: str = None,
  logging: LoggerOptions = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  module_name: str = None,
  name: str = None,
  outdir: str = None,
  package_name: str = None,
  parent: Project = None,
  poetry_options: PoetryPyprojectOptionsWithoutDeps = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_python_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  pytest: bool = None,
  pytest_options: PytestOptions = None,
  python_exec: str = None,
  readme: SampleReadmeProps = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  sample: bool = None,
  setup_config: typing.Mapping[typing.Any] = None,
  setuptools: bool = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  version: str = None,
  vscode: bool = None
)

Properties

Name Type Description
author_email str Author's e-mail.
author_name str Author's name.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
classifiers typing.List[str] A list of PyPI trove classifiers that describe the project.
clobber bool Add a clobber task which resets the repo to origin.
commit_generated bool Whether to commit the managed files by default.
deps typing.List[str] List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.
description str A short description of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str A URL to the website of the project.
license str License of this package as an SPDX identifier.
logging projen.LoggerOptions Configure logging options such as verbosity.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
module_name str Name of the python package as used in imports and filenames.
name str This is the name of your project.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package_name str Package name.
parent projen.Project The parent project, if this project is part of a bigger project.
poetry_options projen.python.PoetryPyprojectOptionsWithoutDeps Additional options to set for poetry if using poetry.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_python_options projen.python.ProjenrcOptions Options related to projenrc in python.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
pytest bool Include pytest tests.
pytest_options projen.python.PytestOptions pytest options.
python_exec str Path to the python executable to use.
readme projen.SampleReadmeProps The README setup.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
sample bool Include sample code and test if the relevant directories don't exist.
setup_config typing.Mapping[typing.Any] Additional fields to pass in the setup() function if using setuptools.
setuptools bool Use setuptools with a setup.py script for packaging and publishing.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
version str Version of the package.
vscode bool Enable VSCode integration.

author_emailOptional
author_email: str
  • Type: str
  • Default: $GIT_USER_EMAIL

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str
  • Default: $GIT_USER_NAME

Author's name.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
classifiers: typing.List[str]
  • Type: typing.List[str]

A list of PyPI trove classifiers that describe the project.


clobberOptional
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of runtime dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDependency().


descriptionOptional
description: str
  • Type: str

A short description of the package.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • Default: []

List of dev dependencies for this project. Dependencies use the format: <module>@<semver>.

Additional dependencies can be added via project.addDevDependency().


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

A URL to the website of the project.


licenseOptional
license: str
  • Type: str

License of this package as an SPDX identifier.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


module_nameOptional
module_name: str
  • Type: str
  • Default: $PYTHON_MODULE_NAME

Name of the python package as used in imports and filenames.

Must only consist of alphanumeric characters and underscores.


nameOptional
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


outdirOptional
outdir: str
  • Type: str
  • 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.


package_nameOptional
package_name: str
  • Type: str

Package name.


parentOptional
parent: Project
  • Type: projen.Project

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


poetry_optionsOptional
poetry_options: PoetryPyprojectOptionsWithoutDeps
  • Type: projen.python.PoetryPyprojectOptionsWithoutDeps

Additional options to set for poetry if using poetry.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_python_optionsOptional
projenrc_python_options: ProjenrcOptions
  • Type: projen.python.ProjenrcOptions
  • Default: default options

Options related to projenrc in python.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
pytest: bool
  • Type: bool
  • Default: true

Include pytest tests.


pytest_optionsOptional
pytest_options: PytestOptions
  • Type: projen.python.PytestOptions
  • Default: defaults

pytest options.


python_execOptional
python_exec: str
  • Type: str
  • Default: "python"

Path to the python executable to use.


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

The README setup.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


sampleOptional
sample: bool
  • Type: bool
  • Default: true

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


setup_configOptional
setup_config: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

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


setuptoolsOptional
setuptools: bool
  • Type: bool
  • Default: true, unless poetry is true, then false

Use setuptools with a setup.py script for packaging and publishing.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


versionOptional
version: str
  • Type: str
  • Default: "0.1.0"

Version of the package.


vscodeOptional
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


RuntimeConfiguration

Configuration for generated runtime projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.RuntimeConfiguration(
  languages: typing.List[Language],
  options: GeneratedRuntimeCodeOptions = None
)

Properties

Name Type Description
languages typing.List[Language] The languages that runtime projects will be generated in.
options GeneratedRuntimeCodeOptions Options for the generated runtimes.

languagesRequired
languages: typing.List[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
options: GeneratedRuntimeCodeOptions

Options for the generated runtimes.

Note that only options provided for the specified languages will apply.


S3IntegrationProps

Options for S3Integration.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.S3IntegrationProps(
  bucket: IBucket,
  integration_response_set: IntegrationResponseSet = None,
  method: str = None,
  path: str = None
)

Properties

Name Type Description
bucket aws_cdk.aws_s3.IBucket The S3 bucket to be invoked on integration.
integration_response_set IntegrationResponseSet Override the integration response set for the S3 integration.
method str The HTTP method to use when invoking the S3 bucket.
path str The path override to use when invoking the S3 bucket.

bucketRequired
bucket: IBucket
  • Type: aws_cdk.aws_s3.IBucket

The S3 bucket to be invoked on integration.


integration_response_setOptional
integration_response_set: IntegrationResponseSet
  • Type: IntegrationResponseSet
  • Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()

Override the integration response set for the S3 integration.


methodOptional
method: str
  • Type: str
  • Default: integration method is used

The HTTP method to use when invoking the S3 bucket.


pathOptional
path: str
  • Type: str
  • Default: integration path is used

The path override to use when invoking the S3 bucket.


SerializedCorsOptions

Cross-origin resource sharing options.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SerializedCorsOptions(
  allow_headers: typing.List[str],
  allow_methods: typing.List[str],
  allow_origins: typing.List[str],
  status_code: typing.Union[int, float]
)

Properties

Name Type Description
allow_headers typing.List[str] Headers to allow.
allow_methods typing.List[str] HTTP methods to allow.
allow_origins typing.List[str] Origins to allow.
status_code typing.Union[int, float] HTTP status code to be returned by preflight requests.

allow_headersRequired
allow_headers: typing.List[str]
  • Type: typing.List[str]

Headers to allow.


allow_methodsRequired
allow_methods: typing.List[str]
  • Type: typing.List[str]

HTTP methods to allow.


allow_originsRequired
allow_origins: typing.List[str]
  • Type: typing.List[str]

Origins to allow.


status_codeRequired
status_code: typing.Union[int, float]
  • Type: typing.Union[int, float]

HTTP status code to be returned by preflight requests.


SmithyAsyncModelProjectOptions

Options for the Smithy WebSocket API model project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyAsyncModelProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  smithy_options: SmithyModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str,
  async_api_spec_file: str
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
smithy_options SmithyModelOptions Smithy engine options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


smithy_optionsRequired
smithy_options: SmithyModelOptions

Smithy engine options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


async_api_spec_fileRequired
async_api_spec_file: str
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


SmithyBaseProjectOptions

Options for a Smithy project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyBaseProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


SmithyBuildOptions

Options for the smithy build files.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyBuildOptions(
  imports: typing.List[str] = None,
  plugins: typing.Mapping[typing.Mapping[typing.Any]] = None,
  additional_sources: typing.List[str] = None,
  ignore_missing_plugins: bool = None,
  maven: SmithyMavenConfiguration = None,
  projections: typing.Mapping[SmithyProjection] = None
)

Properties

Name Type Description
imports typing.List[str] List of imports.
plugins typing.Mapping[typing.Mapping[typing.Any]] Plugins keyed by plugin id.
additional_sources typing.List[str] Paths to any additional model files or directories to be used as sources for the smithy build.
ignore_missing_plugins bool 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 typing.Mapping[SmithyProjection] Map of projections name to projection configurations https://awslabs.github.io/smithy/2.0/guides/building-models/build-config.html#projections.

importsOptional
imports: typing.List[str]
  • Type: typing.List[str]

List of imports.


pluginsOptional
plugins: typing.Mapping[typing.Mapping[typing.Any]]
  • Type: typing.Mapping[typing.Mapping[typing.Any]]

Plugins keyed by plugin id.


additional_sourcesOptional
additional_sources: typing.List[str]
  • Type: typing.List[str]

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.


ignore_missing_pluginsOptional
ignore_missing_plugins: bool
  • Type: bool
  • 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
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
projections: typing.Mapping[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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyCommon(
  imports: typing.List[str] = None,
  plugins: typing.Mapping[typing.Mapping[typing.Any]] = None
)

Properties

Name Type Description
imports typing.List[str] List of imports.
plugins typing.Mapping[typing.Mapping[typing.Any]] Plugins keyed by plugin id.

importsOptional
imports: typing.List[str]
  • Type: typing.List[str]

List of imports.


pluginsOptional
plugins: typing.Mapping[typing.Mapping[typing.Any]]
  • Type: typing.Mapping[typing.Mapping[typing.Any]]

Plugins keyed by plugin id.


SmithyMavenConfiguration

Configuration for smithy maven dependencies.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyMavenConfiguration(
  dependencies: typing.List[str] = None,
  repository_urls: typing.List[str] = None
)

Properties

Name Type Description
dependencies typing.List[str] 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.
repository_urls typing.List[str] The repository urls used in the build.gradle and smithy-build.json files.

dependenciesOptional
dependencies: typing.List[str]
  • Type: typing.List[str]

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.


repository_urlsOptional
repository_urls: typing.List[str]
  • Type: typing.List[str]
  • 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyModelOptions(
  ignore_gradle_wrapper: bool = None,
  ignore_smithy_build_output: bool = None,
  smithy_build_options: SmithyBuildOptions = None,
  service_name: SmithyServiceName
)

Properties

Name Type Description
ignore_gradle_wrapper bool Set to false if you would like to check in your gradle wrapper.
ignore_smithy_build_output bool 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.
smithy_build_options SmithyBuildOptions Smithy build options.
service_name SmithyServiceName Smithy service name.

ignore_gradle_wrapperOptional
ignore_gradle_wrapper: bool
  • Type: bool
  • 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


ignore_smithy_build_outputOptional
ignore_smithy_build_output: bool
  • Type: bool
  • 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.


smithy_build_optionsOptional
smithy_build_options: SmithyBuildOptions

Smithy build options.


service_nameRequired
service_name: SmithyServiceName

Smithy service name.


SmithyModelProjectOptions

Options for the Smithy REST API model.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyModelProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  smithy_options: SmithyModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
smithy_options SmithyModelOptions Smithy engine options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


smithy_optionsRequired
smithy_options: SmithyModelOptions

Smithy engine options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


SmithyProjectDefinitionOptions

Options for a smithy project definition.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyProjectDefinitionOptions(
  ignore_gradle_wrapper: bool = None,
  ignore_smithy_build_output: bool = None,
  smithy_build_options: SmithyBuildOptions = None
)

Properties

Name Type Description
ignore_gradle_wrapper bool Set to false if you would like to check in your gradle wrapper.
ignore_smithy_build_output bool 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.
smithy_build_options SmithyBuildOptions Smithy build options.

ignore_gradle_wrapperOptional
ignore_gradle_wrapper: bool
  • Type: bool
  • 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


ignore_smithy_build_outputOptional
ignore_smithy_build_output: bool
  • Type: bool
  • 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.


smithy_build_optionsOptional
smithy_build_options: SmithyBuildOptions

Smithy build options.


SmithyProjection

A smithy build projection.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyProjection(
  imports: typing.List[str] = None,
  plugins: typing.Mapping[typing.Mapping[typing.Any]] = None,
  abstract: bool = None,
  transforms: typing.List[SmithyTransform] = None
)

Properties

Name Type Description
imports typing.List[str] List of imports.
plugins typing.Mapping[typing.Mapping[typing.Any]] Plugins keyed by plugin id.
abstract bool Whether or not the projection is abstract.
transforms typing.List[SmithyTransform] Transforms to apply to the projection.

importsOptional
imports: typing.List[str]
  • Type: typing.List[str]

List of imports.


pluginsOptional
plugins: typing.Mapping[typing.Mapping[typing.Any]]
  • Type: typing.Mapping[typing.Mapping[typing.Any]]

Plugins keyed by plugin id.


abstractOptional
abstract: bool
  • Type: bool

Whether or not the projection is abstract.


transformsOptional
transforms: typing.List[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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyServiceName(
  namespace: str,
  service_name: str
)

Properties

Name Type Description
namespace str The service namespace.
service_name str The service name.

namespaceRequired
namespace: str
  • Type: str

The service namespace.

Nested namespaces are separated by '.', for example com.company

https://awslabs.github.io/smithy/2.0/spec/model.html#shape-id


service_nameRequired
service_name: str
  • Type: str

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyServiceProjectDefinitionOptions(
  smithy_options: SmithyModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
smithy_options SmithyModelOptions Smithy engine options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

smithy_optionsRequired
smithy_options: SmithyModelOptions

Smithy engine options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


SmithyShapeLibraryProjectOptions

Options for the Smithy shape library.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyShapeLibraryProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  ignore_gradle_wrapper: bool = None,
  ignore_smithy_build_output: bool = None,
  smithy_build_options: SmithyBuildOptions = None
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
ignore_gradle_wrapper bool Set to false if you would like to check in your gradle wrapper.
ignore_smithy_build_output bool 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.
smithy_build_options SmithyBuildOptions Smithy build options.

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


ignore_gradle_wrapperOptional
ignore_gradle_wrapper: bool
  • Type: bool
  • 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


ignore_smithy_build_outputOptional
ignore_smithy_build_output: bool
  • Type: bool
  • 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.


smithy_build_optionsOptional
smithy_build_options: SmithyBuildOptions

Smithy build options.


SmithyTransform

A smithy build transform.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SmithyTransform(
  args: typing.Mapping[typing.Any],
  name: str
)

Properties

Name Type Description
args typing.Mapping[typing.Any] Arguments for the transform.
name str Name of the transform.

argsRequired
args: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

Arguments for the transform.


nameRequired
name: str
  • Type: str

Name of the transform.


SnapStartFunctionProps

Options for the SnapStartFunction construct.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.SnapStartFunctionProps(
  max_event_age: Duration = None,
  on_failure: IDestination = None,
  on_success: IDestination = None,
  retry_attempts: typing.Union[int, float] = None,
  adot_instrumentation: AdotInstrumentationConfig = None,
  allow_all_ipv6_outbound: bool = None,
  allow_all_outbound: bool = None,
  allow_public_subnet: bool = None,
  application_log_level: str = None,
  application_log_level_v2: ApplicationLogLevel = None,
  architecture: Architecture = None,
  code_signing_config: ICodeSigningConfig = None,
  current_version_options: VersionOptions = None,
  dead_letter_queue: IQueue = None,
  dead_letter_queue_enabled: bool = None,
  dead_letter_topic: ITopic = None,
  description: str = None,
  environment: typing.Mapping[str] = None,
  environment_encryption: IKey = None,
  ephemeral_storage_size: Size = None,
  events: typing.List[IEventSource] = None,
  filesystem: FileSystem = None,
  function_name: str = None,
  initial_policy: typing.List[PolicyStatement] = None,
  insights_version: LambdaInsightsVersion = None,
  ipv6_allowed_for_dual_stack: bool = None,
  layers: typing.List[ILayerVersion] = None,
  log_format: str = None,
  logging_format: LoggingFormat = None,
  log_group: ILogGroup = None,
  log_retention: RetentionDays = None,
  log_retention_retry_options: LogRetentionRetryOptions = None,
  log_retention_role: IRole = None,
  memory_size: typing.Union[int, float] = None,
  params_and_secrets: ParamsAndSecretsLayerVersion = None,
  profiling: bool = None,
  profiling_group: IProfilingGroup = None,
  recursive_loop: RecursiveLoop = None,
  reserved_concurrent_executions: typing.Union[int, float] = None,
  role: IRole = None,
  runtime_management_mode: RuntimeManagementMode = None,
  security_groups: typing.List[ISecurityGroup] = None,
  snap_start: SnapStartConf = None,
  system_log_level: str = None,
  system_log_level_v2: SystemLogLevel = None,
  timeout: Duration = None,
  tracing: Tracing = None,
  vpc: IVpc = None,
  vpc_subnets: SubnetSelection = None,
  code: Code,
  handler: str,
  runtime: Runtime,
  disable_snap_start: bool = None
)

Properties

Name Type Description
max_event_age aws_cdk.Duration The maximum age of a request that Lambda sends to a function for processing.
on_failure aws_cdk.aws_lambda.IDestination The destination for failed invocations.
on_success aws_cdk.aws_lambda.IDestination The destination for successful invocations.
retry_attempts typing.Union[int, float] The maximum number of times to retry when the function returns an error.
adot_instrumentation aws_cdk.aws_lambda.AdotInstrumentationConfig Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
allow_all_ipv6_outbound bool Whether to allow the Lambda to send all ipv6 network traffic.
allow_all_outbound bool Whether to allow the Lambda to send all network traffic (except ipv6).
allow_public_subnet bool Lambda Functions in a public subnet can NOT access the internet.
application_log_level str Sets the application log level for the function.
application_log_level_v2 aws_cdk.aws_lambda.ApplicationLogLevel Sets the application log level for the function.
architecture aws_cdk.aws_lambda.Architecture The system architectures compatible with this lambda function.
code_signing_config aws_cdk.aws_lambda.ICodeSigningConfig Code signing config associated with this function.
current_version_options aws_cdk.aws_lambda.VersionOptions Options for the lambda.Version resource automatically created by the fn.currentVersion method.
dead_letter_queue aws_cdk.aws_sqs.IQueue The SQS queue to use if DLQ is enabled.
dead_letter_queue_enabled bool Enabled DLQ.
dead_letter_topic aws_cdk.aws_sns.ITopic The SNS topic to use as a DLQ.
description str A description of the function.
environment typing.Mapping[str] Key-value pairs that Lambda caches and makes available for your Lambda functions.
environment_encryption aws_cdk.aws_kms.IKey The AWS KMS key that's used to encrypt your function's environment variables.
ephemeral_storage_size aws_cdk.Size The size of the function’s /tmp directory in MiB.
events typing.List[aws_cdk.aws_lambda.IEventSource] Event sources for this function.
filesystem aws_cdk.aws_lambda.FileSystem The filesystem configuration for the lambda function.
function_name str A name for the function.
initial_policy typing.List[aws_cdk.aws_iam.PolicyStatement] Initial policy statements to add to the created Lambda Role.
insights_version aws_cdk.aws_lambda.LambdaInsightsVersion Specify the version of CloudWatch Lambda insights to use for monitoring.
ipv6_allowed_for_dual_stack bool Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
layers typing.List[aws_cdk.aws_lambda.ILayerVersion] A list of layers to add to the function's execution environment.
log_format str Sets the logFormat for the function.
logging_format aws_cdk.aws_lambda.LoggingFormat Sets the loggingFormat for the function.
log_group aws_cdk.aws_logs.ILogGroup The log group the function sends logs to.
log_retention aws_cdk.aws_logs.RetentionDays The number of days log events are kept in CloudWatch Logs.
log_retention_retry_options aws_cdk.aws_lambda.LogRetentionRetryOptions When log retention is specified, a custom resource attempts to create the CloudWatch log group.
log_retention_role aws_cdk.aws_iam.IRole The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
memory_size typing.Union[int, float] The amount of memory, in MB, that is allocated to your Lambda function.
params_and_secrets aws_cdk.aws_lambda.ParamsAndSecretsLayerVersion Specify the configuration of Parameters and Secrets Extension.
profiling bool Enable profiling.
profiling_group aws_cdk.aws_codeguruprofiler.IProfilingGroup Profiling Group.
recursive_loop aws_cdk.aws_lambda.RecursiveLoop Sets the Recursive Loop Protection for Lambda Function.
reserved_concurrent_executions typing.Union[int, float] The maximum of concurrent executions you want to reserve for the function.
role aws_cdk.aws_iam.IRole Lambda execution role.
runtime_management_mode aws_cdk.aws_lambda.RuntimeManagementMode Sets the runtime management configuration for a function's version.
security_groups typing.List[aws_cdk.aws_ec2.ISecurityGroup] The list of security groups to associate with the Lambda's network interfaces.
snap_start aws_cdk.aws_lambda.SnapStartConf Enable SnapStart for Lambda Function.
system_log_level str Sets the system log level for the function.
system_log_level_v2 aws_cdk.aws_lambda.SystemLogLevel Sets the system log level for the function.
timeout aws_cdk.Duration The function execution time (in seconds) after which Lambda terminates the function.
tracing aws_cdk.aws_lambda.Tracing Enable AWS X-Ray Tracing for Lambda Function.
vpc aws_cdk.aws_ec2.IVpc VPC network to place Lambda network interfaces.
vpc_subnets aws_cdk.aws_ec2.SubnetSelection Where to place the network interfaces within the VPC.
code aws_cdk.aws_lambda.Code The source code of your Lambda function.
handler str The name of the method within your code that Lambda calls to execute your function.
runtime aws_cdk.aws_lambda.Runtime The runtime environment for the Lambda function that you are uploading.
disable_snap_start bool When true, disable snap start.

max_event_ageOptional
max_event_age: Duration
  • Type: aws_cdk.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


on_failureOptional
on_failure: IDestination
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for failed invocations.


on_successOptional
on_success: IDestination
  • Type: aws_cdk.aws_lambda.IDestination
  • Default: no destination

The destination for successful invocations.


retry_attemptsOptional
retry_attempts: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • Default: 2

The maximum number of times to retry when the function returns an error.

Minimum: 0 Maximum: 2


adot_instrumentationOptional
adot_instrumentation: AdotInstrumentationConfig
  • Type: aws_cdk.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


allow_all_ipv6_outboundOptional
allow_all_ipv6_outbound: bool
  • Type: bool
  • 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.


allow_all_outboundOptional
allow_all_outbound: bool
  • Type: bool
  • 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.


allow_public_subnetOptional
allow_public_subnet: bool
  • Type: bool
  • 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


~~application_log_level~~Optional
  • Deprecated: Use applicationLogLevelV2 as a property instead.
application_log_level: str
  • Type: str
  • Default: "INFO"

Sets the application log level for the function.


application_log_level_v2Optional
application_log_level_v2: ApplicationLogLevel
  • Type: aws_cdk.aws_lambda.ApplicationLogLevel
  • Default: ApplicationLogLevel.INFO

Sets the application log level for the function.


architectureOptional
architecture: Architecture
  • Type: aws_cdk.aws_lambda.Architecture
  • Default: Architecture.X86_64

The system architectures compatible with this lambda function.


code_signing_configOptional
code_signing_config: ICodeSigningConfig
  • Type: aws_cdk.aws_lambda.ICodeSigningConfig
  • Default: Not Sign the Code

Code signing config associated with this function.


current_version_optionsOptional
current_version_options: VersionOptions
  • Type: aws_cdk.aws_lambda.VersionOptions
  • Default: default options as described in VersionOptions

Options for the lambda.Version resource automatically created by the fn.currentVersion method.


dead_letter_queueOptional
dead_letter_queue: IQueue
  • Type: aws_cdk.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.


dead_letter_queue_enabledOptional
dead_letter_queue_enabled: bool
  • Type: bool
  • 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.


dead_letter_topicOptional
dead_letter_topic: ITopic
  • Type: aws_cdk.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
description: str
  • Type: str
  • Default: No description.

A description of the function.


environmentOptional
environment: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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.


environment_encryptionOptional
environment_encryption: IKey
  • Type: aws_cdk.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.


ephemeral_storage_sizeOptional
ephemeral_storage_size: Size
  • Type: aws_cdk.Size
  • Default: 512 MiB

The size of the function’s /tmp directory in MiB.


eventsOptional
events: typing.List[IEventSource]
  • Type: typing.List[aws_cdk.aws_lambda.IEventSource]
  • Default: No event sources.

Event sources for this function.

You can also add event sources using addEventSource.


filesystemOptional
filesystem: FileSystem
  • Type: aws_cdk.aws_lambda.FileSystem
  • Default: will not mount any filesystem

The filesystem configuration for the lambda function.


function_nameOptional
function_name: str
  • Type: str
  • 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.


initial_policyOptional
initial_policy: typing.List[PolicyStatement]
  • Type: typing.List[aws_cdk.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.


insights_versionOptional
insights_version: LambdaInsightsVersion
  • Type: aws_cdk.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


ipv6_allowed_for_dual_stackOptional
ipv6_allowed_for_dual_stack: bool
  • Type: bool
  • Default: false

Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

Only used if 'vpc' is supplied.


layersOptional
layers: typing.List[ILayerVersion]
  • Type: typing.List[aws_cdk.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.


~~log_format~~Optional
  • Deprecated: Use loggingFormat as a property instead.
log_format: str
  • Type: str
  • Default: "Text"

Sets the logFormat for the function.


logging_formatOptional
logging_format: LoggingFormat
  • Type: aws_cdk.aws_lambda.LoggingFormat
  • Default: LoggingFormat.TEXT

Sets the loggingFormat for the function.


log_groupOptional
log_group: ILogGroup
  • Type: aws_cdk.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.


log_retentionOptional
log_retention: RetentionDays
  • Type: aws_cdk.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;


log_retention_retry_optionsOptional
log_retention_retry_options: LogRetentionRetryOptions
  • Type: aws_cdk.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.


log_retention_roleOptional
log_retention_role: IRole
  • Type: aws_cdk.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.


memory_sizeOptional
memory_size: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


params_and_secretsOptional
params_and_secrets: ParamsAndSecretsLayerVersion
  • Type: aws_cdk.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
profiling: bool
  • Type: bool
  • Default: No profiling.

Enable profiling.

https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html


profiling_groupOptional
profiling_group: IProfilingGroup
  • Type: aws_cdk.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


recursive_loopOptional
recursive_loop: RecursiveLoop
  • Type: aws_cdk.aws_lambda.RecursiveLoop
  • Default: RecursiveLoop.Terminate

Sets the Recursive Loop Protection for Lambda Function.

It lets Lambda detect and terminate unintended recusrive loops.


reserved_concurrent_executionsOptional
reserved_concurrent_executions: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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
role: IRole
  • Type: aws_cdk.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".


runtime_management_modeOptional
runtime_management_mode: RuntimeManagementMode
  • Type: aws_cdk.aws_lambda.RuntimeManagementMode
  • Default: Auto

Sets the runtime management configuration for a function's version.


security_groupsOptional
security_groups: typing.List[ISecurityGroup]
  • Type: typing.List[aws_cdk.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.


snap_startOptional
snap_start: SnapStartConf
  • Type: aws_cdk.aws_lambda.SnapStartConf
  • Default: No snapstart

Enable SnapStart for Lambda Function.

SnapStart is currently supported only for Java 11, 17 runtime


~~system_log_level~~Optional
  • Deprecated: Use systemLogLevelV2 as a property instead.
system_log_level: str
  • Type: str
  • Default: "INFO"

Sets the system log level for the function.


system_log_level_v2Optional
system_log_level_v2: SystemLogLevel
  • Type: aws_cdk.aws_lambda.SystemLogLevel
  • Default: SystemLogLevel.INFO

Sets the system log level for the function.


timeoutOptional
timeout: Duration
  • Type: aws_cdk.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
tracing: Tracing
  • Type: aws_cdk.aws_lambda.Tracing
  • Default: Tracing.Disabled

Enable AWS X-Ray Tracing for Lambda Function.


vpcOptional
vpc: IVpc
  • Type: aws_cdk.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.


vpc_subnetsOptional
vpc_subnets: SubnetSelection
  • Type: aws_cdk.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
code: Code
  • Type: aws_cdk.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
handler: str
  • Type: str

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
runtime: Runtime
  • Type: aws_cdk.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.


disable_snap_startOptional
disable_snap_start: bool
  • Type: bool
  • Default: false

When true, disable snap start.


TypeSafeApiAsyncModelBuildOptions

Options for converting OpenAPI to AsyncAPI.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuildOptions(
  async_api_spec_file: str,
  parsed_spec_file: str
)

Properties

Name Type Description
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

async_api_spec_fileRequired
async_api_spec_file: str
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSafeApiAsyncModelBuildOutputOptions

Output of the OpenAPI to AsyncAPI task.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuildOutputOptions(
  async_api_spec_file: str
)

Properties

Name Type Description
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).

async_api_spec_fileRequired
async_api_spec_file: str
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


TypeSafeApiIntegration

Defines an integration for an individual API operation.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiIntegration(
  integration: Integration,
  authorizer: Authorizer = None,
  options: TypeSafeApiIntegrationOptions = None
)

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
integration: Integration

The integration to service the api operation.


authorizerOptional
authorizer: Authorizer

The authorizer to use for this api operation (overrides the default).


optionsOptional
options: TypeSafeApiIntegrationOptions

Options for the integration.


TypeSafeApiIntegrationOptions

Options for an integration.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiIntegrationOptions(
  api_key_required: bool = None
)

Properties

Name Type Description
api_key_required bool Require an API key to invoke this operation.

api_key_requiredOptional
api_key_required: bool
  • Type: bool
  • 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiModelBuildOptions(
  parsed_spec_file: str,
  open_api_specification_path: str,
  smithy_json_model_path: str = None
)

Properties

Name Type Description
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).
open_api_specification_path str Path to the OpenAPI specification.
smithy_json_model_path str Optional path to the Smithy JSON model (for Smithy projects only).

parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


open_api_specification_pathRequired
open_api_specification_path: str
  • Type: str

Path to the OpenAPI specification.


smithy_json_model_pathOptional
smithy_json_model_path: str
  • Type: str

Optional path to the Smithy JSON model (for Smithy projects only).


TypeSafeApiModelBuildOutputOptions

Output for the OpenAPI parse/bundle task.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiModelBuildOutputOptions(
  parsed_spec_file: str
)

Properties

Name Type Description
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSafeApiModelProjectOptions

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiModelProjectOptions(
  model_language: ModelLanguage,
  model_options: ModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
model_language ModelLanguage Language the model is defined in.
model_options ModelOptions Options for the model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

model_languageRequired
model_language: ModelLanguage

Language the model is defined in.


model_optionsRequired
model_options: ModelOptions

Options for the model.


handler_languagesOptional
handler_languages: typing.List[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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiOptions(
  integrations: typing.Mapping[TypeSafeApiIntegration],
  operation_lookup: typing.Mapping[OperationDetails],
  api_key_options: ApiKeyOptions = None,
  cors_options: CorsOptions = None,
  default_authorizer: Authorizer = None
)

Properties

Name Type Description
integrations typing.Mapping[TypeSafeApiIntegration] A mapping of API operation to its integration.
operation_lookup typing.Mapping[OperationDetails] Details about each operation.
api_key_options ApiKeyOptions Options for API keys.
cors_options aws_cdk.aws_apigateway.CorsOptions Cross Origin Resource Sharing options for the API.
default_authorizer Authorizer The default authorizer to use for your api.

integrationsRequired
integrations: typing.Mapping[TypeSafeApiIntegration]

A mapping of API operation to its integration.


operation_lookupRequired
operation_lookup: typing.Mapping[OperationDetails]

Details about each operation.


api_key_optionsOptional
api_key_options: ApiKeyOptions

Options for API keys.


cors_optionsOptional
cors_options: CorsOptions
  • Type: aws_cdk.aws_apigateway.CorsOptions

Cross Origin Resource Sharing options for the API.


default_authorizerOptional
default_authorizer: 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  infrastructure: InfrastructureConfiguration,
  model: ModelConfiguration,
  commit_generated_code: bool = None,
  documentation: DocumentationConfiguration = None,
  handlers: HandlersConfiguration = None,
  library: LibraryConfiguration = None,
  runtime: RuntimeConfiguration = None
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
infrastructure InfrastructureConfiguration Configuration for generated infrastructure.
model ModelConfiguration Configuration for the API model.
commit_generated_code bool 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


infrastructureRequired
infrastructure: InfrastructureConfiguration

Configuration for generated infrastructure.


modelRequired
model: ModelConfiguration

Configuration for the API model.


commit_generated_codeOptional
commit_generated_code: bool
  • Type: bool
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


documentationOptional
documentation: DocumentationConfiguration

Configuration for generated documentation.


handlersOptional
handlers: HandlersConfiguration

Configuration for lambda handlers for implementing the API.


libraryOptional
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
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeApiWebAclOptions(
  cidr_allow_list: CidrAllowList = None,
  disable: bool = None,
  managed_rules: typing.List[ManagedRule] = None
)

Properties

Name Type Description
cidr_allow_list CidrAllowList List of cidr ranges to allow.
disable bool If set to true, no WebACL will be associated with the API.
managed_rules typing.List[ManagedRule] List of managed rules to apply to the web acl.

cidr_allow_listOptional
cidr_allow_list: CidrAllowList

List of cidr ranges to allow.


disableOptional
disable: bool
  • Type: bool
  • 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.


managed_rulesOptional
managed_rules: typing.List[ManagedRule]
  • Type: typing.List[ManagedRule]
  • Default: [{ vendor: "AWS", name: "AWSManagedRulesCommonRuleSet" }]

List of managed rules to apply to the web acl.


TypeSafeRestApiProps

Configuration for the TypeSafeRestApi construct.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeRestApiProps(
  cloud_watch_role: bool = None,
  cloud_watch_role_removal_policy: RemovalPolicy = None,
  deploy: bool = None,
  deploy_options: StageOptions = None,
  description: str = None,
  disable_execute_api_endpoint: bool = None,
  domain_name: DomainNameOptions = None,
  endpoint_export_name: str = None,
  endpoint_types: typing.List[EndpointType] = None,
  fail_on_warnings: bool = None,
  parameters: typing.Mapping[str] = None,
  policy: PolicyDocument = None,
  rest_api_name: str = None,
  retain_deployments: bool = None,
  integrations: typing.Mapping[TypeSafeApiIntegration],
  operation_lookup: typing.Mapping[OperationDetails],
  api_key_options: ApiKeyOptions = None,
  cors_options: CorsOptions = None,
  default_authorizer: Authorizer = None,
  spec_path: str,
  min_compression_size: Size = None,
  output_spec_bucket: IBucket = None,
  web_acl_options: TypeSafeApiWebAclOptions = None
)

Properties

Name Type Description
cloud_watch_role bool Automatically configure an AWS CloudWatch role for API Gateway.
cloud_watch_role_removal_policy aws_cdk.RemovalPolicy The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.
deploy bool Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
deploy_options aws_cdk.aws_apigateway.StageOptions Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.
description str A description of the RestApi construct.
disable_execute_api_endpoint bool Specifies whether clients can invoke the API using the default execute-api endpoint.
domain_name aws_cdk.aws_apigateway.DomainNameOptions Configure a custom domain name and map it to this API.
endpoint_export_name str Export name for the CfnOutput containing the API endpoint.
endpoint_types typing.List[aws_cdk.aws_apigateway.EndpointType] A list of the endpoint types of the API.
fail_on_warnings bool Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters typing.Mapping[str] Custom header parameters for the request.
policy aws_cdk.aws_iam.PolicyDocument A policy document that contains the permissions for this RestApi.
rest_api_name str A name for the API Gateway RestApi resource.
retain_deployments bool Retains old deployment resources when the API changes.
integrations typing.Mapping[TypeSafeApiIntegration] A mapping of API operation to its integration.
operation_lookup typing.Mapping[OperationDetails] Details about each operation.
api_key_options ApiKeyOptions Options for API keys.
cors_options aws_cdk.aws_apigateway.CorsOptions Cross Origin Resource Sharing options for the API.
default_authorizer Authorizer The default authorizer to use for your api.
spec_path str Path to the JSON open api spec.
min_compression_size aws_cdk.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.
output_spec_bucket aws_cdk.aws_s3.IBucket By default, the spec is prepared and outputted into the CDK assets bucket.
web_acl_options TypeSafeApiWebAclOptions Options for the AWS WAF v2 WebACL associated with the api.

cloud_watch_roleOptional
cloud_watch_role: bool
  • Type: bool
  • Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

Automatically configure an AWS CloudWatch role for API Gateway.


cloud_watch_role_removal_policyOptional
cloud_watch_role_removal_policy: RemovalPolicy
  • Type: aws_cdk.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
deploy: bool
  • Type: bool
  • 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.


deploy_optionsOptional
deploy_options: StageOptions
  • Type: aws_cdk.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
description: str
  • Type: str
  • Default: 'Automatically created by the RestApi construct'

A description of the RestApi construct.


disable_execute_api_endpointOptional
disable_execute_api_endpoint: bool
  • Type: bool
  • 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


domain_nameOptional
domain_name: DomainNameOptions
  • Type: aws_cdk.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.


endpoint_export_nameOptional
endpoint_export_name: str
  • Type: str
  • Default: when no export name is given, output will be created without export

Export name for the CfnOutput containing the API endpoint.


endpoint_typesOptional
endpoint_types: typing.List[EndpointType]
  • Type: typing.List[aws_cdk.aws_apigateway.EndpointType]
  • Default: EndpointType.EDGE

A list of the endpoint types of the API.

Use this property when creating an API.


fail_on_warningsOptional
fail_on_warnings: bool
  • Type: bool
  • Default: false

Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.


parametersOptional
parameters: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • Default: No parameters.

Custom header parameters for the request.

https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html


policyOptional
policy: PolicyDocument
  • Type: aws_cdk.aws_iam.PolicyDocument
  • Default: No policy.

A policy document that contains the permissions for this RestApi.


rest_api_nameOptional
rest_api_name: str
  • Type: str
  • Default: ID of the RestApi construct.

A name for the API Gateway RestApi resource.


retain_deploymentsOptional
retain_deployments: bool
  • Type: bool
  • 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
integrations: typing.Mapping[TypeSafeApiIntegration]

A mapping of API operation to its integration.


operation_lookupRequired
operation_lookup: typing.Mapping[OperationDetails]

Details about each operation.


api_key_optionsOptional
api_key_options: ApiKeyOptions

Options for API keys.


cors_optionsOptional
cors_options: CorsOptions
  • Type: aws_cdk.aws_apigateway.CorsOptions

Cross Origin Resource Sharing options for the API.


default_authorizerOptional
default_authorizer: 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.


spec_pathRequired
spec_path: str
  • Type: str

Path to the JSON open api spec.


min_compression_sizeOptional
min_compression_size: Size
  • Type: aws_cdk.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.


output_spec_bucketOptional
output_spec_bucket: IBucket
  • Type: aws_cdk.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.


web_acl_optionsOptional
web_acl_options: 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebsocketApiIntegration(
  integration: WebSocketRouteIntegration
)

Properties

Name Type Description
integration aws_cdk.aws_apigatewayv2.WebSocketRouteIntegration The integration to service the route.

integrationRequired
integration: WebSocketRouteIntegration
  • Type: aws_cdk.aws_apigatewayv2.WebSocketRouteIntegration

The integration to service the route.


TypeSafeWebSocketApiModelConfiguration

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebSocketApiModelConfiguration(
  language: ModelLanguage,
  options: ModelOptions
)

Properties

Name Type Description
language ModelLanguage The language the API model is defined in.
options ModelOptions Options for the API model.

languageRequired
language: ModelLanguage

The language the API model is defined in.


optionsRequired
options: ModelOptions

Options for the API model.


TypeSafeWebSocketApiModelProjectOptions

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebSocketApiModelProjectOptions(
  model_language: ModelLanguage,
  model_options: ModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
model_language ModelLanguage Language the model is defined in.
model_options ModelOptions Options for the model.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

model_languageRequired
model_language: ModelLanguage

Language the model is defined in.


model_optionsRequired
model_options: ModelOptions

Options for the model.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


TypeSafeWebSocketApiProjectOptions

Options for the TypeSafeWebSocketApiProject.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebSocketApiProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  infrastructure: WebSocketInfrastructureConfiguration,
  model: TypeSafeWebSocketApiModelConfiguration,
  documentation: WebSocketDocumentationConfiguration = None,
  handlers: WebSocketHandlersConfiguration = None,
  library: WebSocketLibraryConfiguration = None,
  runtime: WebSocketRuntimeConfiguration = None
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


infrastructureRequired
infrastructure: WebSocketInfrastructureConfiguration

Configuration for generated infrastructure.


modelRequired
model: TypeSafeWebSocketApiModelConfiguration

Configuration for the API model.


documentationOptional
documentation: WebSocketDocumentationConfiguration

Configuration for generated documentation.


handlersOptional
handlers: WebSocketHandlersConfiguration

Configuration for lambda handlers for implementing the API.


libraryOptional
library: WebSocketLibraryConfiguration

Configuration for generated libraries.

These include clients for interacting with your websocket API


runtimeOptional
runtime: WebSocketRuntimeConfiguration

Configuration for generated runtime projects (containing types, clients and server code).


TypeSafeWebsocketApiProps

Properties for a Type Safe WebSocket API.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSafeWebsocketApiProps(
  api_key_selection_expression: WebSocketApiKeySelectionExpression = None,
  api_name: str = None,
  description: str = None,
  integrations: typing.Mapping[TypeSafeWebsocketApiIntegration],
  operation_lookup: typing.Mapping[WebsocketOperationDetails],
  spec_path: str,
  authorizer: IWebSocketRouteAuthorizer = None,
  connect: TypeSafeWebsocketApiIntegration = None,
  disable_access_logging: bool = None,
  disable_grant_management_access_to_lambdas: bool = None,
  disable_mock_integration_responses: bool = None,
  disconnect: TypeSafeWebsocketApiIntegration = None,
  stage_props: WebSocketStageProps = None
)

Properties

Name Type Description
api_key_selection_expression aws_cdk.aws_apigatewayv2.WebSocketApiKeySelectionExpression An API key selection expression.
api_name str Name for the WebSocket API resource.
description str The description of the API.
integrations typing.Mapping[TypeSafeWebsocketApiIntegration] WebSocket routes and their corresponding integrations.
operation_lookup typing.Mapping[WebsocketOperationDetails] Details about each operation.
spec_path str Path to the websocket api specification json file.
authorizer aws_cdk.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).
disable_access_logging bool Disable access logging.
disable_grant_management_access_to_lambdas bool By default, all lambda integrations are granted management API access for the websocket API to send messages, disconnect clients, etc.
disable_mock_integration_responses bool 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).
stage_props WebSocketStageProps Options for the default stage.

api_key_selection_expressionOptional
api_key_selection_expression: WebSocketApiKeySelectionExpression
  • Type: aws_cdk.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.


api_nameOptional
api_name: str
  • Type: str
  • Default: id of the WebSocketApi construct.

Name for the WebSocket API resource.


descriptionOptional
description: str
  • Type: str
  • Default: none

The description of the API.


integrationsRequired
integrations: typing.Mapping[TypeSafeWebsocketApiIntegration]

WebSocket routes and their corresponding integrations.


operation_lookupRequired
operation_lookup: typing.Mapping[WebsocketOperationDetails]

Details about each operation.


spec_pathRequired
spec_path: str
  • Type: str

Path to the websocket api specification json file.


authorizerOptional
authorizer: IWebSocketRouteAuthorizer
  • Type: aws_cdk.aws_apigatewayv2.IWebSocketRouteAuthorizer
  • Default: NONE

Authorizer to use for the API (applied to the $connect route).


connectOptional
connect: TypeSafeWebsocketApiIntegration

Integration for the $connect route (invoked when a new client connects).


disable_access_loggingOptional
disable_access_logging: bool
  • Type: bool
  • Default: false

Disable access logging.


disable_grant_management_access_to_lambdasOptional
disable_grant_management_access_to_lambdas: bool
  • Type: bool
  • 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.


disable_mock_integration_responsesOptional
disable_mock_integration_responses: bool
  • Type: bool
  • 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
disconnect: TypeSafeWebsocketApiIntegration

Integration for the $disconnect route (invoked when a client disconnects).


stage_propsOptional
stage_props: WebSocketStageProps

Options for the default stage.


TypeScriptProjectOptions

TypeScriptProjectOptions.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeScriptProjectOptions(
  allow_library_dependencies: bool = None,
  artifacts_directory: str = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_approve_upgrades: bool = None,
  auto_detect_bin: bool = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundled_deps: typing.List[str] = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  clobber: bool = None,
  code_artifact_options: CodeArtifactOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  commit_generated: bool = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  default_release_branch: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps: typing.List[str] = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  description: str = None,
  dev_container: bool = None,
  dev_deps: typing.List[str] = None,
  disable_tsconfig: bool = None,
  disable_tsconfig_dev: bool = None,
  docgen: bool = None,
  docs_directory: str = None,
  entrypoint: str = None,
  entrypoint_types: str = None,
  eslint: bool = None,
  eslint_options: EslintOptions = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitignore: typing.List[str] = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  gitpod: bool = None,
  homepage: str = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  jsii_release_version: str = None,
  keywords: typing.List[str] = None,
  libdir: str = None,
  license: str = None,
  licensed: bool = None,
  logging: LoggerOptions = None,
  major_version: typing.Union[int, float] = None,
  max_node_version: str = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  min_major_version: typing.Union[int, float] = None,
  min_node_version: str = None,
  mutable_build: bool = None,
  name: str = None,
  npm_access: NpmAccess = None,
  npm_dist_tag: str = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  outdir: str = None,
  package: bool = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  parent: Project = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  project_type: ProjectType = None,
  projen_command: str = None,
  projen_credentials: GithubCredentials = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  projenrc_js_options: ProjenrcOptions = None,
  projenrc_ts: bool = None,
  projenrc_ts_options: ProjenrcOptions = None,
  projen_token_secret: str = None,
  projen_version: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  readme: SampleReadmeProps = None,
  releasable_commits: ReleasableCommits = None,
  release: bool = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_to_npm: bool = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow: bool = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  repository: str = None,
  repository_directory: str = None,
  sample_code: bool = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  srcdir: str = None,
  stability: str = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  testdir: str = None,
  tsconfig: TypescriptConfigOptions = None,
  tsconfig_dev: TypescriptConfigOptions = None,
  tsconfig_dev_file: str = None,
  ts_jest_options: TsJestOptions = None,
  typescript_version: str = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  vscode: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_container_image: str = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  yarn_berry_options: YarnBerryOptions = None
)

Properties

Name Type Description
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
artifacts_directory str A directory which will contain build artifacts.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber bool Add a clobber task which resets the repo to origin.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commit_generated bool Whether to commit the managed files by default.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
default_release_branch str The name of the main release branch.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps typing.List[str] Runtime dependencies of this module.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description str The description is just a string that helps people understand the purpose of the package.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
dev_deps typing.List[str] Build dependencies for this module.
disable_tsconfig bool Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disable_tsconfig_dev bool Do not generate a tsconfig.dev.json file.
docgen bool Docgen by Typedoc.
docs_directory str Docs directory.
entrypoint str Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypoint_types str The .d.ts file that includes the type declarations for this module.
eslint bool Setup eslint.
eslint_options projen.javascript.EslintOptions Eslint options.
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitignore typing.List[str] Additional entries to .gitignore.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
gitpod bool Add a Gitpod development environment.
homepage str Package's Homepage / Website.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
keywords typing.List[str] Keywords to include in package.json.
libdir str Typescript artifacts output directory.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
major_version typing.Union[int, float] Major version to release from the default branch.
max_node_version str Minimum node.js version to require via engines (inclusive).
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
min_major_version typing.Union[int, float] Minimal Major version to release.
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
mutable_build bool Automatically update files modified during builds to pull-request branches.
name str This is the name of your project.
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
outdir str The root directory of the project. Relative to this directory, all files are synthesized.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
project_type projen.ProjectType Which type of project this is (library/app).
projen_command str The shell command to use in order to run the projen CLI.
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrc_ts bool Use TypeScript for your projenrc file (.projenrc.ts).
projenrc_ts_options projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projen_token_secret str The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
projen_version str Version of projen to install.
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release bool Add release management to this project.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow bool DEPRECATED: renamed to release.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
sample_code bool Generate one-time sample in src/ and test/ if there are no files there.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
srcdir str Typescript sources directory.
stability str Package's Stability.
stale bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir str Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfig_dev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfig_dev_file str The name of the development tsconfig.json file.
ts_jest_options projen.typescript.TsJestOptions Options for ts-jest.
typescript_version str TypeScript version to use.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
vscode bool Enable VSCode integration.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_container_image str Container image to use for GitHub workflows.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.

allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


code_artifact_optionsOptional
code_artifact_options: 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


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


default_release_branchOptional
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
description: str
  • Type: str

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


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


disable_tsconfigOptional
disable_tsconfig: bool
  • Type: bool
  • Default: false

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


disable_tsconfig_devOptional
disable_tsconfig_dev: bool
  • Type: bool
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
docgen: bool
  • Type: bool
  • Default: false

Docgen by Typedoc.


docs_directoryOptional
docs_directory: str
  • Type: str
  • Default: "docs"

Docs directory.


entrypointOptional
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypoint_typesOptional
entrypoint_types: str
  • Type: str
  • 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
eslint: bool
  • Type: bool
  • Default: true

Setup eslint.


eslint_optionsOptional
eslint_options: EslintOptions
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


libdirOptional
libdir: str
  • Type: str
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


npm_accessOptional
npm_access: 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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.


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


outdirOptional
outdir: str
  • Type: str
  • 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
package: bool
  • Type: bool
  • Default: true

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


parentOptional
parent: Project
  • Type: projen.Project

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


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projen_credentialsOptional
projen_credentials: 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.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrc_tsOptional
projenrc_ts: bool
  • Type: bool
  • Default: false

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


projenrc_ts_optionsOptional
projenrc_ts_options: ProjenrcOptions
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


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

The README setup.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


sample_codeOptional
sample_code: bool
  • Type: bool
  • Default: true

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


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
srcdir: str
  • Type: str
  • Default: "src"

Typescript sources directory.


stabilityOptional
stability: str
  • Type: str

Package's Stability.


staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
testdir: str
  • Type: str
  • 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
tsconfig: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfig_devOptional
tsconfig_dev: TypescriptConfigOptions
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

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


tsconfig_dev_fileOptional
tsconfig_dev_file: str
  • Type: str
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


ts_jest_optionsOptional
ts_jest_options: TsJestOptions
  • Type: projen.typescript.TsJestOptions

Options for ts-jest.


typescript_versionOptional
typescript_version: str
  • Type: str
  • 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).


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarn_berry_optionsOptional
yarn_berry_options: 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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncDefinitionOptions(
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

type_spec_optionsRequired
type_spec_options: TypeSpecModelOptions

TypeSpec model options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


TypeSpecAsyncModelProjectOptions

Options for the TypeSpec WebSocket API model project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecAsyncModelProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  dev_container: bool = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitpod: bool = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  project_type: ProjectType = None,
  projen_credentials: GithubCredentials = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  vscode: bool = None,
  allow_library_dependencies: bool = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_detect_bin: bool = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  bundled_deps: typing.List[str] = None,
  code_artifact_options: CodeArtifactOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_deps: typing.List[str] = None,
  entrypoint: str = None,
  homepage: str = None,
  keywords: typing.List[str] = None,
  license: str = None,
  licensed: bool = None,
  max_node_version: str = None,
  min_node_version: str = None,
  npm_access: NpmAccess = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  repository: str = None,
  repository_directory: str = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  stability: str = None,
  yarn_berry_options: YarnBerryOptions = None,
  jsii_release_version: str = None,
  major_version: typing.Union[int, float] = None,
  min_major_version: typing.Union[int, float] = None,
  npm_dist_tag: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  releasable_commits: ReleasableCommits = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  workflow_container_image: str = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  default_release_branch: str,
  artifacts_directory: str = None,
  auto_approve_upgrades: bool = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  gitignore: typing.List[str] = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  mutable_build: bool = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  package: bool = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_js_options: ProjenrcOptions = None,
  projen_version: str = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  release: bool = None,
  release_to_npm: bool = None,
  release_workflow: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None,
  async_api_spec_file: str,
  parsed_spec_file: str
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitpod bool Add a Gitpod development environment.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
project_type projen.ProjectType Which type of project this is (library/app).
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_token_secret str 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 bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode bool Enable VSCode integration.
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps typing.List[str] Runtime dependencies of this module.
description str The description is just a string that helps people understand the purpose of the package.
dev_deps typing.List[str] Build dependencies for this module.
entrypoint str Module entrypoint (main in package.json).
homepage str Package's Homepage / Website.
keywords typing.List[str] Keywords to include in package.json.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
max_node_version str Minimum node.js version to require via engines (inclusive).
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
stability str Package's Stability.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
major_version typing.Union[int, float] Major version to release from the default branch.
min_major_version typing.Union[int, float] Minimal Major version to release.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
workflow_container_image str Container image to use for GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
default_release_branch str The name of the main release branch.
artifacts_directory str A directory which will contain build artifacts.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore typing.List[str] Additional entries to .gitignore.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
mutable_build bool Automatically update files modified during builds to pull-request branches.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projen_version str Version of projen to install.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
release bool Add release management to this project.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_workflow bool DEPRECATED: renamed to release.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
async_api_spec_file str Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_credentialsOptional
projen_credentials: 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.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
readme: SampleReadmeProps
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


binOptional
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


code_artifact_optionsOptional
code_artifact_options: 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
deps: typing.List[str]
  • Type: typing.List[str]
  • 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
description: str
  • Type: str

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

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


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


npm_accessOptional
npm_access: 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.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
stability: str
  • Type: str

Package's Stability.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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.


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


default_release_branchRequired
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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.


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
package: bool
  • Type: bool
  • Default: true

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


type_spec_optionsRequired
type_spec_options: TypeSpecModelOptions

TypeSpec model options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


async_api_spec_fileRequired
async_api_spec_file: str
  • Type: str

Path to the generated AsyncAPI specification (relative to the project root).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSpecDefinitionOptions

Options for the TypeSpec model definition.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecDefinitionOptions(
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

type_spec_optionsRequired
type_spec_options: TypeSpecModelOptions

TypeSpec model options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


TypeSpecModelOptions

Options for the TypeSpec model.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecModelOptions(
  namespace: str
)

Properties

Name Type Description
namespace str The namespace for your API.

namespaceRequired
namespace: str
  • Type: str

The namespace for your API.

https://typespec.io/docs/language-basics/namespaces/ eg. MyApi


TypeSpecModelProjectOptions

Options for the TypeSpec model project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecModelProjectOptions(
  name: str,
  commit_generated: bool = None,
  git_ignore_options: IgnoreFileOptions = None,
  git_options: GitOptions = None,
  logging: LoggerOptions = None,
  outdir: str = None,
  parent: Project = None,
  projen_command: str = None,
  projenrc_json: bool = None,
  projenrc_json_options: ProjenrcJsonOptions = None,
  renovatebot: bool = None,
  renovatebot_options: RenovatebotOptions = None,
  auto_approve_options: AutoApproveOptions = None,
  auto_merge: bool = None,
  auto_merge_options: AutoMergeOptions = None,
  clobber: bool = None,
  dev_container: bool = None,
  github: bool = None,
  github_options: GitHubOptions = None,
  gitpod: bool = None,
  mergify: bool = None,
  mergify_options: MergifyOptions = None,
  project_type: ProjectType = None,
  projen_credentials: GithubCredentials = None,
  projen_token_secret: str = None,
  readme: SampleReadmeProps = None,
  stale: bool = None,
  stale_options: StaleOptions = None,
  vscode: bool = None,
  allow_library_dependencies: bool = None,
  author_email: str = None,
  author_name: str = None,
  author_organization: bool = None,
  author_url: str = None,
  auto_detect_bin: bool = None,
  bin: typing.Mapping[str] = None,
  bugs_email: str = None,
  bugs_url: str = None,
  bundled_deps: typing.List[str] = None,
  code_artifact_options: CodeArtifactOptions = None,
  deps: typing.List[str] = None,
  description: str = None,
  dev_deps: typing.List[str] = None,
  entrypoint: str = None,
  homepage: str = None,
  keywords: typing.List[str] = None,
  license: str = None,
  licensed: bool = None,
  max_node_version: str = None,
  min_node_version: str = None,
  npm_access: NpmAccess = None,
  npm_provenance: bool = None,
  npm_registry: str = None,
  npm_registry_url: str = None,
  npm_token_secret: str = None,
  package_manager: NodePackageManager = None,
  package_name: str = None,
  peer_dependency_options: PeerDependencyOptions = None,
  peer_deps: typing.List[str] = None,
  pnpm_version: str = None,
  repository: str = None,
  repository_directory: str = None,
  scoped_packages_options: typing.List[ScopedPackagesOptions] = None,
  scripts: typing.Mapping[str] = None,
  stability: str = None,
  yarn_berry_options: YarnBerryOptions = None,
  jsii_release_version: str = None,
  major_version: typing.Union[int, float] = None,
  min_major_version: typing.Union[int, float] = None,
  npm_dist_tag: str = None,
  post_build_steps: typing.List[JobStep] = None,
  prerelease: str = None,
  publish_dry_run: bool = None,
  publish_tasks: bool = None,
  releasable_commits: ReleasableCommits = None,
  release_branches: typing.Mapping[BranchOptions] = None,
  release_every_commit: bool = None,
  release_failure_issue: bool = None,
  release_failure_issue_label: str = None,
  release_schedule: str = None,
  release_tag_prefix: str = None,
  release_trigger: ReleaseTrigger = None,
  release_workflow_name: str = None,
  release_workflow_setup_steps: typing.List[JobStep] = None,
  versionrc_options: typing.Mapping[typing.Any] = None,
  workflow_container_image: str = None,
  workflow_runs_on: typing.List[str] = None,
  workflow_runs_on_group: GroupRunnerOptions = None,
  default_release_branch: str,
  artifacts_directory: str = None,
  auto_approve_upgrades: bool = None,
  build_workflow: bool = None,
  build_workflow_options: BuildWorkflowOptions = None,
  build_workflow_triggers: Triggers = None,
  bundler_options: BundlerOptions = None,
  check_licenses: LicenseCheckerOptions = None,
  code_cov: bool = None,
  code_cov_token_secret: str = None,
  copyright_owner: str = None,
  copyright_period: str = None,
  dependabot: bool = None,
  dependabot_options: DependabotOptions = None,
  deps_upgrade: bool = None,
  deps_upgrade_options: UpgradeDependenciesOptions = None,
  gitignore: typing.List[str] = None,
  jest: bool = None,
  jest_options: JestOptions = None,
  mutable_build: bool = None,
  npmignore: typing.List[str] = None,
  npmignore_enabled: bool = None,
  npm_ignore_options: IgnoreFileOptions = None,
  package: bool = None,
  prettier: bool = None,
  prettier_options: PrettierOptions = None,
  projen_dev_dependency: bool = None,
  projenrc_js: bool = None,
  projenrc_js_options: ProjenrcOptions = None,
  projen_version: str = None,
  pull_request_template: bool = None,
  pull_request_template_contents: typing.List[str] = None,
  release: bool = None,
  release_to_npm: bool = None,
  release_workflow: bool = None,
  workflow_bootstrap_steps: typing.List[JobStep] = None,
  workflow_git_identity: GitIdentity = None,
  workflow_node_version: str = None,
  workflow_package_cache: bool = None,
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None,
  parsed_spec_file: str
)

Properties

Name Type Description
name str This is the name of your project.
commit_generated bool Whether to commit the managed files by default.
git_ignore_options projen.IgnoreFileOptions Configuration options for .gitignore file.
git_options projen.GitOptions Configuration options for git.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir str The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projen_command str The shell command to use in order to run the projen CLI.
projenrc_json bool Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrc_json_options projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot bool Use renovatebot to handle dependency upgrades.
renovatebot_options projen.RenovatebotOptions Options for renovatebot.
auto_approve_options projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
auto_merge bool Enable automatic merging on GitHub.
auto_merge_options projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber bool Add a clobber task which resets the repo to origin.
dev_container bool Add a VSCode development environment (used for GitHub Codespaces).
github bool Enable GitHub integration.
github_options projen.github.GitHubOptions Options for GitHub integration.
gitpod bool Add a Gitpod development environment.
mergify bool Whether mergify should be enabled on this repository or not.
mergify_options projen.github.MergifyOptions Options for mergify.
project_type projen.ProjectType Which type of project this is (library/app).
projen_credentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projen_token_secret str 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 bool Auto-close of stale issues and pull request.
stale_options projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode bool Enable VSCode integration.
allow_library_dependencies bool Allow the project to include peerDependencies and bundledDependencies.
author_email str Author's e-mail.
author_name str Author's name.
author_organization bool Is the author an organization.
author_url str Author's URL / Website.
auto_detect_bin bool Automatically add all executables under the bin directory to your package.json file under the bin section.
bin typing.Mapping[str] Binary programs vended with your module.
bugs_email str The email address to which issues should be reported.
bugs_url str The url to your project's issue tracker.
bundled_deps typing.List[str] List of dependencies to bundle into this module.
code_artifact_options projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps typing.List[str] Runtime dependencies of this module.
description str The description is just a string that helps people understand the purpose of the package.
dev_deps typing.List[str] Build dependencies for this module.
entrypoint str Module entrypoint (main in package.json).
homepage str Package's Homepage / Website.
keywords typing.List[str] Keywords to include in package.json.
license str License's SPDX identifier.
licensed bool Indicates if a license should be added.
max_node_version str Minimum node.js version to require via engines (inclusive).
min_node_version str Minimum Node.js version to require via package.json engines (inclusive).
npm_access projen.javascript.NpmAccess Access level of the npm package.
npm_provenance bool Should provenance statements be generated when the package is published.
npm_registry str The host name of the npm registry to publish to.
npm_registry_url str The base URL of the npm package registry.
npm_token_secret str GitHub secret which contains the NPM token to use when publishing packages.
package_manager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
package_name str The "name" in package.json.
peer_dependency_options projen.javascript.PeerDependencyOptions Options for peerDeps.
peer_deps typing.List[str] Peer dependencies for this module.
pnpm_version str The version of PNPM to use if using PNPM as a package manager.
repository str The repository is the location where the actual code for your package lives.
repository_directory str 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.
scoped_packages_options typing.List[projen.javascript.ScopedPackagesOptions] Options for privately hosted scoped packages.
scripts typing.Mapping[str] npm scripts to include.
stability str Package's Stability.
yarn_berry_options projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsii_release_version str Version requirement of publib which is used to publish modules to npm.
major_version typing.Union[int, float] Major version to release from the default branch.
min_major_version typing.Union[int, float] Minimal Major version to release.
npm_dist_tag str The npmDistTag to use when publishing from the default branch.
post_build_steps typing.List[projen.github.workflows.JobStep] Steps to execute after build as part of the release workflow.
prerelease str Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run bool Instead of actually publishing to package managers, just print the publishing command.
publish_tasks bool Define publishing tasks that can be executed manually as well as workflows.
releasable_commits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release_branches typing.Mapping[projen.release.BranchOptions] Defines additional release branches.
release_every_commit bool Automatically release new versions every commit to one of branches in releaseBranches.
release_failure_issue bool Create a github issue on every failed publishing task.
release_failure_issue_label str The label to apply to issues indicating publish failures.
release_schedule str CRON schedule to trigger new releases.
release_tag_prefix str Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
release_trigger projen.release.ReleaseTrigger The release trigger to use.
release_workflow_name str The name of the default release workflow.
release_workflow_setup_steps typing.List[projen.github.workflows.JobStep] A set of workflow steps to execute in order to setup the workflow container.
versionrc_options typing.Mapping[typing.Any] Custom configuration used when creating changelog with standard-version package.
workflow_container_image str Container image to use for GitHub workflows.
workflow_runs_on typing.List[str] Github Runner selection labels.
workflow_runs_on_group projen.GroupRunnerOptions Github Runner Group selection options.
default_release_branch str The name of the main release branch.
artifacts_directory str A directory which will contain build artifacts.
auto_approve_upgrades bool Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
build_workflow bool Define a GitHub workflow for building PRs.
build_workflow_options projen.javascript.BuildWorkflowOptions Options for PR build workflow.
build_workflow_triggers projen.github.workflows.Triggers Build workflow triggers.
bundler_options projen.javascript.BundlerOptions Options for Bundler.
check_licenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
code_cov bool 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.
code_cov_token_secret str Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyright_owner str License copyright owner.
copyright_period str The copyright years to put in the LICENSE file.
dependabot bool Use dependabot to handle dependency upgrades.
dependabot_options projen.github.DependabotOptions Options for dependabot.
deps_upgrade bool Use tasks and github workflows to handle dependency upgrades.
deps_upgrade_options projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore typing.List[str] Additional entries to .gitignore.
jest bool Setup jest unit tests.
jest_options projen.javascript.JestOptions Jest options.
mutable_build bool Automatically update files modified during builds to pull-request branches.
npmignore typing.List[str] Additional entries to .npmignore.
npmignore_enabled bool Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options projen.IgnoreFileOptions Configuration options for .npmignore file.
package bool Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier bool Setup prettier.
prettier_options projen.javascript.PrettierOptions Prettier options.
projen_dev_dependency bool Indicates of "projen" should be installed as a devDependency.
projenrc_js bool Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrc_js_options projen.javascript.ProjenrcOptions Options for .projenrc.js.
projen_version str Version of projen to install.
pull_request_template bool Include a GitHub pull request template.
pull_request_template_contents typing.List[str] The contents of the pull request template.
release bool Add release management to this project.
release_to_npm bool Automatically release to npm when new versions are introduced.
release_workflow bool DEPRECATED: renamed to release.
workflow_bootstrap_steps typing.List[projen.github.workflows.JobStep] Workflow steps to use in order to bootstrap this repo.
workflow_git_identity projen.github.GitIdentity The git identity to use in workflows.
workflow_node_version str The node version to use in GitHub workflows.
workflow_package_cache bool Enable Node.js package cache in GitHub workflows.
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).
parsed_spec_file str Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
name: str
  • Type: str
  • Default: $BASEDIR

This is the name of your project.


commit_generatedOptional
commit_generated: bool
  • Type: bool
  • Default: true

Whether to commit the managed files by default.


git_ignore_optionsOptional
git_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


git_optionsOptional
git_options: GitOptions
  • Type: projen.GitOptions

Configuration options for git.


loggingOptional
logging: LoggerOptions
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
outdir: str
  • Type: str
  • 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
parent: Project
  • Type: projen.Project

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


projen_commandOptional
projen_command: str
  • Type: str
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrc_jsonOptional
projenrc_json: bool
  • Type: bool
  • Default: false

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


projenrc_json_optionsOptional
projenrc_json_options: ProjenrcJsonOptions
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
renovatebot: bool
  • Type: bool
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebot_optionsOptional
renovatebot_options: RenovatebotOptions
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


auto_approve_optionsOptional
auto_approve_options: AutoApproveOptions
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


auto_mergeOptional
auto_merge: bool
  • Type: bool
  • Default: true

Enable automatic merging on GitHub.

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


auto_merge_optionsOptional
auto_merge_options: 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
clobber: bool
  • Type: bool
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


dev_containerOptional
dev_container: bool
  • Type: bool
  • Default: false

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


githubOptional
github: bool
  • Type: bool
  • Default: true

Enable GitHub integration.

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


github_optionsOptional
github_options: GitHubOptions
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
gitpod: bool
  • Type: bool
  • Default: false

Add a Gitpod development environment.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead
mergify: bool
  • Type: bool
  • Default: true

Whether mergify should be enabled on this repository or not.


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

Options for mergify.


~~project_type~~Optional
  • Deprecated: no longer supported at the base project level
project_type: ProjectType
  • Type: projen.ProjectType
  • Default: ProjectType.UNKNOWN

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


projen_credentialsOptional
projen_credentials: 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.


~~projen_token_secret~~Optional
  • Deprecated: use projenCredentials
projen_token_secret: str
  • Type: str
  • 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
readme: SampleReadmeProps
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
stale: bool
  • Type: bool
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


stale_optionsOptional
stale_options: StaleOptions
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
vscode: bool
  • Type: bool
  • Default: true

Enable VSCode integration.

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


allow_library_dependenciesOptional
allow_library_dependencies: bool
  • Type: bool
  • 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.


author_emailOptional
author_email: str
  • Type: str

Author's e-mail.


author_nameOptional
author_name: str
  • Type: str

Author's name.


author_organizationOptional
author_organization: bool
  • Type: bool

Is the author an organization.


author_urlOptional
author_url: str
  • Type: str

Author's URL / Website.


auto_detect_binOptional
auto_detect_bin: bool
  • Type: bool
  • Default: true

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


binOptional
bin: typing.Mapping[str]
  • Type: typing.Mapping[str]

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.


bugs_emailOptional
bugs_email: str
  • Type: str

The email address to which issues should be reported.


bugs_urlOptional
bugs_url: str
  • Type: str

The url to your project's issue tracker.


bundled_depsOptional
bundled_deps: typing.List[str]
  • Type: typing.List[str]

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.


code_artifact_optionsOptional
code_artifact_options: 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
deps: typing.List[str]
  • Type: typing.List[str]
  • 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
description: str
  • Type: str

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


dev_depsOptional
dev_deps: typing.List[str]
  • Type: typing.List[str]
  • 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
entrypoint: str
  • Type: str
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

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


homepageOptional
homepage: str
  • Type: str

Package's Homepage / Website.


keywordsOptional
keywords: typing.List[str]
  • Type: typing.List[str]

Keywords to include in package.json.


licenseOptional
license: str
  • Type: str
  • 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
licensed: bool
  • Type: bool
  • Default: true

Indicates if a license should be added.


max_node_versionOptional
max_node_version: str
  • Type: str
  • Default: no max

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


min_node_versionOptional
min_node_version: str
  • Type: str
  • Default: no "engines" specified

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


npm_accessOptional
npm_access: 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.


npm_provenanceOptional
npm_provenance: bool
  • Type: bool
  • 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


~~npm_registry~~Optional
  • Deprecated: use npmRegistryUrl instead
npm_registry: str
  • Type: str

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npm_registry_urlOptional
npm_registry_url: str

The base URL of the npm package registry.

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


npm_token_secretOptional
npm_token_secret: str
  • Type: str
  • Default: "NPM_TOKEN"

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


package_managerOptional
package_manager: NodePackageManager
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


package_nameOptional
package_name: str
  • Type: str
  • Default: defaults to project name

The "name" in package.json.


peer_dependency_optionsOptional
peer_dependency_options: PeerDependencyOptions
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peer_depsOptional
peer_deps: typing.List[str]
  • Type: typing.List[str]
  • 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.


pnpm_versionOptional
pnpm_version: str
  • Type: str
  • Default: "7"

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


repositoryOptional
repository: str
  • Type: str

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

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


repository_directoryOptional
repository_directory: str
  • Type: str

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.


scoped_packages_optionsOptional
scoped_packages_options: typing.List[ScopedPackagesOptions]
  • Type: typing.List[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()
scripts: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • 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
stability: str
  • Type: str

Package's Stability.


yarn_berry_optionsOptional
yarn_berry_options: YarnBerryOptions
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsii_release_versionOptional
jsii_release_version: str
  • Type: str
  • Default: "latest"

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


major_versionOptional
major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


min_major_versionOptional
min_major_version: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • 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.


npm_dist_tagOptional
npm_dist_tag: str
  • Type: str
  • 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.


post_build_stepsOptional
post_build_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: []

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


prereleaseOptional
prerelease: str
  • Type: str
  • Default: normal semantic versions

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


publish_dry_runOptional
publish_dry_run: bool
  • Type: bool
  • Default: false

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


publish_tasksOptional
publish_tasks: bool
  • Type: bool
  • 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.


releasable_commitsOptional
releasable_commits: ReleasableCommits
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


release_branchesOptional
release_branches: typing.Mapping[BranchOptions]
  • Type: typing.Mapping[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.


~~release_every_commit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
release_every_commit: bool
  • Type: bool
  • Default: true

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


release_failure_issueOptional
release_failure_issue: bool
  • Type: bool
  • Default: false

Create a github issue on every failed publishing task.


release_failure_issue_labelOptional
release_failure_issue_label: str
  • Type: str
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~release_schedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
release_schedule: str
  • Type: str
  • Default: no scheduled releases

CRON schedule to trigger new releases.


release_tag_prefixOptional
release_tag_prefix: str
  • Type: str
  • 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.


release_triggerOptional
release_trigger: ReleaseTrigger
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


release_workflow_nameOptional
release_workflow_name: str
  • Type: str
  • Default: "release"

The name of the default release workflow.


release_workflow_setup_stepsOptional
release_workflow_setup_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]

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


versionrc_optionsOptional
versionrc_options: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.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.


workflow_container_imageOptional
workflow_container_image: str
  • Type: str
  • Default: default image

Container image to use for GitHub workflows.


workflow_runs_onOptional
workflow_runs_on: typing.List[str]
  • Type: typing.List[str]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflow_runs_on_groupOptional
workflow_runs_on_group: GroupRunnerOptions
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


default_release_branchRequired
default_release_branch: str
  • Type: str
  • Default: "main"

The name of the main release branch.


artifacts_directoryOptional
artifacts_directory: str
  • Type: str
  • Default: "dist"

A directory which will contain build artifacts.


auto_approve_upgradesOptional
auto_approve_upgrades: bool
  • Type: bool
  • 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.


build_workflowOptional
build_workflow: bool
  • Type: bool
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


build_workflow_optionsOptional
build_workflow_options: BuildWorkflowOptions
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


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

Build workflow triggers.


bundler_optionsOptional
bundler_options: BundlerOptions
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


check_licensesOptional
check_licenses: 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.


code_covOptional
code_cov: bool
  • Type: bool
  • 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.


code_cov_token_secretOptional
code_cov_token_secret: str
  • Type: str
  • 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.


copyright_owner: str
  • Type: str
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyright_period: str
  • Type: str
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
dependabot: bool
  • Type: bool
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabot_optionsOptional
dependabot_options: DependabotOptions
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


deps_upgradeOptional
deps_upgrade: bool
  • Type: bool
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


deps_upgrade_optionsOptional
deps_upgrade_options: UpgradeDependenciesOptions
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
gitignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .gitignore.


jestOptional
jest: bool
  • Type: bool
  • Default: true

Setup jest unit tests.


jest_optionsOptional
jest_options: JestOptions
  • Type: projen.javascript.JestOptions
  • Default: default options

Jest options.


~~mutable_build~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild
mutable_build: bool
  • Type: bool
  • 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
npmignore: typing.List[str]
  • Type: typing.List[str]

Additional entries to .npmignore.


npmignore_enabledOptional
npmignore_enabled: bool
  • Type: bool
  • Default: true

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


npm_ignore_optionsOptional
npm_ignore_options: IgnoreFileOptions
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
package: bool
  • Type: bool
  • Default: true

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


prettierOptional
prettier: bool
  • Type: bool
  • Default: false

Setup prettier.


prettier_optionsOptional
prettier_options: PrettierOptions
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projen_dev_dependencyOptional
projen_dev_dependency: bool
  • Type: bool
  • Default: true if not a subproject

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


projenrc_jsOptional
projenrc_js: bool
  • Type: bool
  • Default: true if projenrcJson is false

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


projenrc_js_optionsOptional
projenrc_js_options: ProjenrcOptions
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projen_versionOptional
projen_version: str
  • Type: str
  • Default: Defaults to the latest version.

Version of projen to install.


pull_request_templateOptional
pull_request_template: bool
  • Type: bool
  • Default: true

Include a GitHub pull request template.


pull_request_template_contentsOptional
pull_request_template_contents: typing.List[str]
  • Type: typing.List[str]
  • Default: default content

The contents of the pull request template.


releaseOptional
release: bool
  • Type: bool
  • Default: true (false for subprojects)

Add release management to this project.


release_to_npmOptional
release_to_npm: bool
  • Type: bool
  • Default: false

Automatically release to npm when new versions are introduced.


~~release_workflow~~Optional
  • Deprecated: see release.
release_workflow: bool
  • Type: bool
  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflow_bootstrap_stepsOptional
workflow_bootstrap_steps: typing.List[JobStep]
  • Type: typing.List[projen.github.workflows.JobStep]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflow_git_identityOptional
workflow_git_identity: GitIdentity
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflow_node_versionOptional
workflow_node_version: str
  • Type: str
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflow_package_cacheOptional
workflow_package_cache: bool
  • Type: bool
  • Default: false

Enable Node.js package cache in GitHub workflows.


type_spec_optionsRequired
type_spec_options: TypeSpecModelOptions

TypeSpec model options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Path of the parsed/bundled OpenAPI specification (relative to the project root).


TypeSpecProjectDefinitionOptions

Options for a TypeSpec model project.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.TypeSpecProjectDefinitionOptions(
  type_spec_options: TypeSpecModelOptions,
  handler_languages: typing.List[Language] = None
)

Properties

Name Type Description
type_spec_options TypeSpecModelOptions TypeSpec model options.
handler_languages typing.List[Language] The languages users have specified for handler projects (if any).

type_spec_optionsRequired
type_spec_options: TypeSpecModelOptions

TypeSpec model options.


handler_languagesOptional
handler_languages: typing.List[Language]

The languages users have specified for handler projects (if any).


WebSocketApiProps

WebSocketApiProps.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketApiProps(
  api_key_selection_expression: WebSocketApiKeySelectionExpression = None,
  api_name: str = None,
  description: str = None
)

Properties

Name Type Description
api_key_selection_expression aws_cdk.aws_apigatewayv2.WebSocketApiKeySelectionExpression An API key selection expression.
api_name str Name for the WebSocket API resource.
description str The description of the API.

api_key_selection_expressionOptional
api_key_selection_expression: WebSocketApiKeySelectionExpression
  • Type: aws_cdk.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.


api_nameOptional
api_name: str
  • Type: str
  • Default: id of the WebSocketApi construct.

Name for the WebSocket API resource.


descriptionOptional
description: str
  • Type: str
  • Default: none

The description of the API.


WebSocketDocumentationConfiguration

Configuration for generated documentation.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketDocumentationConfiguration(
  formats: typing.List[WebSocketDocumentationFormat],
  options: GeneratedWebSocketDocumentationOptions = None
)

Properties

Name Type Description
formats typing.List[WebSocketDocumentationFormat] Formats for generated documentation.
options GeneratedWebSocketDocumentationOptions Options for the generated documentation projects.

formatsRequired
formats: typing.List[WebSocketDocumentationFormat]

Formats for generated documentation.


optionsOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketHandlersConfiguration(
  languages: typing.List[Language],
  options: GeneratedHandlersCodeOptions = None
)

Properties

Name Type Description
languages typing.List[Language] The languages lambda handlers are written in.
options GeneratedHandlersCodeOptions Options for the infrastructure package.

languagesRequired
languages: typing.List[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
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketInfrastructureConfiguration(
  language: Language,
  options: GeneratedInfrastructureCodeOptions = None
)

Properties

Name Type Description
language Language The language to generate the type-safe CDK infrastructure in.
options GeneratedInfrastructureCodeOptions Options for the infrastructure package.

languageRequired
language: Language

The language to generate the type-safe CDK infrastructure in.


optionsOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketLibraryConfiguration(
  libraries: typing.List[WebSocketLibrary],
  options: GeneratedWebSocketLibraryOptions = None
)

Properties

Name Type Description
libraries typing.List[WebSocketLibrary] The libraries to generate.
options GeneratedWebSocketLibraryOptions Options for the generated library package.

librariesRequired
libraries: typing.List[WebSocketLibrary]

The libraries to generate.


optionsOptional
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketModelProject(
  api_name: str,
  outdir: str,
  parsed_spec_file: str,
  async_api_spec_file: str,
  openapi: OpenApiAsyncModelProject = None,
  smithy: SmithyAsyncModelProject = None,
  type_spec: TypeSpecAsyncModelProject = None
)

Properties

Name Type Description
api_name str Name of the API.
outdir str Directory of the model project.
parsed_spec_file str Name of the bundled OpenAPI specification file.
async_api_spec_file str File name of the generated async api specification.
openapi OpenApiAsyncModelProject Reference to the OpenAPI model project.
smithy SmithyAsyncModelProject Reference to the Smithy model project.
type_spec TypeSpecAsyncModelProject Reference to the TypeSpec model project.

api_nameRequired
api_name: str
  • Type: str

Name of the API.


outdirRequired
outdir: str
  • Type: str

Directory of the model project.


parsed_spec_fileRequired
parsed_spec_file: str
  • Type: str

Name of the bundled OpenAPI specification file.


async_api_spec_fileRequired
async_api_spec_file: str
  • Type: str

File name of the generated async api specification.


openapiOptional
openapi: OpenApiAsyncModelProject

Reference to the OpenAPI model project.

Will be defined if the model language is OpenAPI


smithyOptional
smithy: SmithyAsyncModelProject

Reference to the Smithy model project.

Will be defined if the model language is Smithy


type_specOptional
type_spec: TypeSpecAsyncModelProject

Reference to the TypeSpec model project.

Will be defined if the model language is TypeSpec


WebsocketOperationDetails

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebsocketOperationDetails(
  path: str
)

Properties

Name Type Description
path str Path in the OpenAPI spec for the operation.

pathRequired
path: str
  • Type: str

Path in the OpenAPI spec for the operation.


WebSocketRuntimeConfiguration

Configuration for generated runtime projects.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketRuntimeConfiguration(
  languages: typing.List[Language],
  options: GeneratedRuntimeCodeOptions = None
)

Properties

Name Type Description
languages typing.List[Language] The languages that runtime projects will be generated in.
options GeneratedRuntimeCodeOptions Options for the generated runtimes.

languagesRequired
languages: typing.List[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
options: GeneratedRuntimeCodeOptions

Options for the generated runtimes.

Note that only options provided for the specified languages will apply.


WebSocketStageProps

WebSocketStageProps.

Initializer

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.WebSocketStageProps(
  auto_deploy: bool = None,
  description: str = None,
  domain_mapping: DomainMappingOptions = None,
  stage_name: str = None,
  throttle: ThrottleSettings = None
)

Properties

Name Type Description
auto_deploy bool Whether updates to an API automatically trigger a new deployment.
description str The description for the API stage.
domain_mapping aws_cdk.aws_apigatewayv2.DomainMappingOptions The options for custom domain and api mapping.
stage_name str The name of the stage.
throttle aws_cdk.aws_apigatewayv2.ThrottleSettings Throttle settings for the routes of this stage.

auto_deployOptional
auto_deploy: bool
  • Type: bool
  • Default: false

Whether updates to an API automatically trigger a new deployment.


descriptionOptional
description: str
  • Type: str
  • Default: no description

The description for the API stage.


domain_mappingOptional
domain_mapping: DomainMappingOptions
  • Type: aws_cdk.aws_apigatewayv2.DomainMappingOptions
  • Default: no custom domain and api mapping configuration

The options for custom domain and api mapping.


stage_nameOptional
stage_name: str
  • Type: str

The name of the stage.


throttleOptional
throttle: ThrottleSettings
  • Type: aws_cdk.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.Authorizer(
  authorization_type: AuthorizationType,
  authorizer_id: str,
  authorization_scopes: typing.List[str] = None
)
Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.

authorization_typeRequired
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
  • Type: typing.List[str]

Scopes for the authorizer, if any.


Properties

Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.

authorization_typeRequired
authorization_type: AuthorizationType
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
authorizer_id: str
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]

Scopes for the authorizer, if any.


Authorizers

Class used to construct authorizers for use in the OpenApiGatewayLambdaApi construct.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.Authorizers.cognito(
  authorizer_id: str,
  user_pools: typing.List[IUserPool],
  authorization_scopes: typing.List[str] = None
)

A Cognito User Pools authorizer.

authorizer_idRequired
  • Type: str

Unique identifier for this authorizer.


user_poolsRequired
  • Type: typing.List[aws_cdk.aws_cognito.IUserPool]

The Cognito user pools associated with this authorizer.


authorization_scopesOptional
  • Type: typing.List[str]
  • 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


custom
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.Authorizers.custom(
  authorizer_id: str,
  function: IFunction,
  authorizer_result_ttl_in_seconds: typing.Union[int, float] = None,
  identity_source: str = None,
  type: CustomAuthorizerType = None
)

A custom authorizer.

authorizer_idRequired
  • Type: str

Unique identifier for this authorizer.


functionRequired
  • Type: aws_cdk.aws_lambda.IFunction

The lambda function used to authorize requests.


authorizer_result_ttl_in_secondsOptional
  • Type: typing.Union[int, float]
  • Default: 300

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


identity_sourceOptional
  • Type: str
  • 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

The type of custom authorizer.

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


iam
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.Authorizers.iam()

An IAM authorizer which uses AWS signature version 4 to authorize requests.

none
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.Authorizers.none()

No authorizer.

CatchAllErrorIntegrationResponseSet

An integration response set that catches all errors and returns a 500.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.CatchAllErrorIntegrationResponseSet()
Name Type Description

Methods

Name Description
render Render the integration responses into the Integration.

render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> typing.Mapping[ApiGatewayIntegrationResponse]

Render the integration responses into the Integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


CognitoAuthorizer

An authorizer that uses Cognito identity or access tokens.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.CognitoAuthorizer(
  authorizer_id: str,
  user_pools: typing.List[IUserPool],
  authorization_scopes: typing.List[str] = None
)
Name Type Description
authorizer_id str Unique identifier for this authorizer.
user_pools typing.List[aws_cdk.aws_cognito.IUserPool] The Cognito user pools associated with this authorizer.
authorization_scopes typing.List[str] A list of authorization scopes configured on the method.

authorizer_idRequired
  • Type: str

Unique identifier for this authorizer.


user_poolsRequired
  • Type: typing.List[aws_cdk.aws_cognito.IUserPool]

The Cognito user pools associated with this authorizer.


authorization_scopesOptional
  • Type: typing.List[str]
  • 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


Methods

Name Description
with_scopes Returns this authorizer with scopes applied, intended for usage in individual operations where scopes may differ on a per-operation basis.

with_scopes
def with_scopes(
  authorization_scopes: str
) -> 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

authorization_scopesRequired
  • Type: str

the scopes to apply.


Properties

Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.
user_pools typing.List[aws_cdk.aws_cognito.IUserPool] The Cognito user pools associated with this authorizer.

authorization_typeRequired
authorization_type: AuthorizationType
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
authorizer_id: str
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]

Scopes for the authorizer, if any.


user_poolsRequired
user_pools: typing.List[IUserPool]
  • Type: typing.List[aws_cdk.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.CompositeIntegrationResponseSet(
  response_sets: IntegrationResponseSet
)
Name Type Description
response_sets IntegrationResponseSet No description.

response_setsRequired

Methods

Name Description
render Render the integration responses into the Integration.

render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> typing.Mapping[ApiGatewayIntegrationResponse]

Render the integration responses into the Integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


CustomAuthorizer

An authorizer that uses a lambda function to authorize requests.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.CustomAuthorizer(
  authorizer_id: str,
  function: IFunction,
  authorizer_result_ttl_in_seconds: typing.Union[int, float] = None,
  identity_source: str = None,
  type: CustomAuthorizerType = None
)
Name Type Description
authorizer_id str Unique identifier for this authorizer.
function aws_cdk.aws_lambda.IFunction The lambda function used to authorize requests.
authorizer_result_ttl_in_seconds typing.Union[int, float] The number of seconds during which the authorizer result is cached.
identity_source str The source of the identity in an incoming request.
type CustomAuthorizerType The type of custom authorizer.

authorizer_idRequired
  • Type: str

Unique identifier for this authorizer.


functionRequired
  • Type: aws_cdk.aws_lambda.IFunction

The lambda function used to authorize requests.


authorizer_result_ttl_in_secondsOptional
  • Type: typing.Union[int, float]
  • Default: 300

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


identity_sourceOptional
  • Type: str
  • 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

The type of custom authorizer.

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


Properties

Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.
authorizer_result_ttl_in_seconds typing.Union[int, float] The number of seconds during which the authorizer result is cached.
function aws_cdk.aws_lambda.IFunction The lambda function used to authorize requests.
identity_source str The source of the identity in an incoming request.
type CustomAuthorizerType The type of custom authorizer.

authorization_typeRequired
authorization_type: AuthorizationType
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
authorizer_id: str
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]

Scopes for the authorizer, if any.


authorizer_result_ttl_in_secondsRequired
authorizer_result_ttl_in_seconds: typing.Union[int, float]
  • Type: typing.Union[int, float]

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


functionRequired
function: IFunction
  • Type: aws_cdk.aws_lambda.IFunction

The lambda function used to authorize requests.


identity_sourceRequired
identity_source: str
  • Type: str

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
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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.CustomIntegrationResponseSet(
  responses: typing.Mapping[ApiGatewayIntegrationResponse] = None
)
Name Type Description
responses typing.Mapping[ApiGatewayIntegrationResponse] The responses to add to the integration response.

responsesOptional

The responses to add to the integration response.


Methods

Name Description
render Render the integration responses into the Integration.

render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> typing.Mapping[ApiGatewayIntegrationResponse]

Render the integration responses into the Integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


DefaultPassthroughIntegrationResponseSet

An integration response set which adds a passthrough for the default response.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.DefaultPassthroughIntegrationResponseSet(
  status_code: typing.Union[int, float] = None
)
Name Type Description
status_code typing.Union[int, float] Override the status code returned by the default integration response.

status_codeOptional
  • Type: typing.Union[int, float]
  • Default: 200

Override the status code returned by the default integration response.


Methods

Name Description
render Render the integration responses into the Integration.

render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> typing.Mapping[ApiGatewayIntegrationResponse]

Render the integration responses into the Integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


IamAuthorizer

An IAM authorizer.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IamAuthorizer()
Name Type Description

Properties

Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.

authorization_typeRequired
authorization_type: AuthorizationType
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
authorizer_id: str
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.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
def grant(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  api: SpecRestApi,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct
) -> None

Grant permissions for the API to invoke the integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


apiRequired
  • Type: aws_cdk.aws_apigateway.SpecRestApi

The api to grant permissions for.


operation_idRequired
  • Type: str

The ID of the operation for which permissions are being granted.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which permission resources can be created.


render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> ApiGatewayIntegration

Render the integration into an API Gateway OpenAPI extension.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


IntegrationResponseSet

A set of integration responses.

You can extend this to implement your own integration response set

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSet()
Name Type Description

Methods

Name Description
render Render the integration responses into the Integration.

render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> typing.Mapping[ApiGatewayIntegrationResponse]

Render the integration responses into the Integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


IntegrationResponseSets

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSets()
Name Type Description

Static Functions

Name Description
catch_all 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.
default_passthrough An integration response set which adds a passthrough for the default response.
s3_json_error_message 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.

catch_all
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSets.catch_all()

An integration response set that catches all 4XX and 5XX errors and returns a 500.

composite
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSets.composite(
  response_sets: 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.

response_setsRequired

custom
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSets.custom(
  responses: typing.Mapping[ApiGatewayIntegrationResponse] = None
)

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

responsesOptional

The responses to add to the integration response.


default_passthrough
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSets.default_passthrough(
  status_code: typing.Union[int, float] = None
)

An integration response set which adds a passthrough for the default response.

status_codeOptional
  • Type: typing.Union[int, float]
  • Default: 200

Override the status code returned by the default integration response.


s3_json_error_message
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.IntegrationResponseSets.s3_json_error_message()

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.Integrations.lambda(
  lambda_function: IFunction
)

An integration that invokes a lambda function to service the request.

lambda_functionRequired
  • Type: aws_cdk.aws_lambda.IFunction

the function to invoke.


mock
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.Integrations.mock(
  status_code: typing.Union[int, float],
  body: str = None
)

An integration that returns a hardcoded response.

status_codeRequired
  • Type: typing.Union[int, float]

HTTP response status code.


bodyOptional
  • Type: str

Response body.


s3
import aws.pdk.type_safe_api

aws.pdk.type_safe_api.Integrations.s3(
  bucket: IBucket,
  integration_response_set: IntegrationResponseSet = None,
  method: str = None,
  path: str = None
)

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

bucketRequired
  • Type: aws_cdk.aws_s3.IBucket

The S3 bucket to be invoked on integration.


integration_response_setOptional
  • Type: IntegrationResponseSet
  • Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()

Override the integration response set for the S3 integration.


methodOptional
  • Type: str
  • Default: integration method is used

The HTTP method to use when invoking the S3 bucket.


pathOptional
  • Type: str
  • Default: integration path is used

The path override to use when invoking the S3 bucket.


LambdaIntegration

A lambda integration.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.LambdaIntegration(
  lambda_function: IFunction
)
Name Type Description
lambda_function aws_cdk.aws_lambda.IFunction No description.

lambda_functionRequired
  • Type: aws_cdk.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
def grant(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  api: SpecRestApi,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct
) -> None

Grant API Gateway permissions to invoke the lambda.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


apiRequired
  • Type: aws_cdk.aws_apigateway.SpecRestApi

The api to grant permissions for.


operation_idRequired
  • Type: str

The ID of the operation for which permissions are being granted.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which permission resources can be created.


render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> ApiGatewayIntegration

Render the lambda integration as a snippet of OpenAPI.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


MockIntegration

A mock integration to return a hardcoded response.

https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-mock-integration.html

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.MockIntegration(
  status_code: typing.Union[int, float],
  body: str = None
)
Name Type Description
status_code typing.Union[int, float] HTTP response status code.
body str Response body.

status_codeRequired
  • Type: typing.Union[int, float]

HTTP response status code.


bodyOptional
  • Type: str

Response body.


Methods

Name Description
grant Grant permissions for the API to invoke the integration.
render Render the integration into an API Gateway OpenAPI extension.

grant
def grant(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  api: SpecRestApi,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct
) -> None

Grant permissions for the API to invoke the integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


apiRequired
  • Type: aws_cdk.aws_apigateway.SpecRestApi

The api to grant permissions for.


operation_idRequired
  • Type: str

The ID of the operation for which permissions are being granted.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which permission resources can be created.


render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> ApiGatewayIntegration

Render the integration into an API Gateway OpenAPI extension.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


NoneAuthorizer

No authorizer.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.NoneAuthorizer()
Name Type Description

Properties

Name Type Description
authorization_type aws_cdk.aws_apigateway.AuthorizationType The type of the authorizer.
authorizer_id str The unique identifier for the authorizer.
authorization_scopes typing.List[str] Scopes for the authorizer, if any.

authorization_typeRequired
authorization_type: AuthorizationType
  • Type: aws_cdk.aws_apigateway.AuthorizationType

The type of the authorizer.


authorizer_idRequired
authorizer_id: str
  • Type: str

The unique identifier for the authorizer.


authorization_scopesOptional
authorization_scopes: typing.List[str]
  • Type: typing.List[str]

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 aws.pdk.type_safe_api

aws.pdk.type_safe_api.S3Integration(
  bucket: IBucket,
  integration_response_set: IntegrationResponseSet = None,
  method: str = None,
  path: str = None
)
Name Type Description
bucket aws_cdk.aws_s3.IBucket The S3 bucket to be invoked on integration.
integration_response_set IntegrationResponseSet Override the integration response set for the S3 integration.
method str The HTTP method to use when invoking the S3 bucket.
path str The path override to use when invoking the S3 bucket.

bucketRequired
  • Type: aws_cdk.aws_s3.IBucket

The S3 bucket to be invoked on integration.


integration_response_setOptional
  • Type: IntegrationResponseSet
  • Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()

Override the integration response set for the S3 integration.


methodOptional
  • Type: str
  • Default: integration method is used

The HTTP method to use when invoking the S3 bucket.


pathOptional
  • Type: str
  • Default: integration path is used

The path override to use when invoking the S3 bucket.


Methods

Name Description
grant Grant API Gateway permissions to invoke the S3 bucket.
render Render the S3 integration as a snippet of OpenAPI.

grant
def grant(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  api: SpecRestApi,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct
) -> None

Grant API Gateway permissions to invoke the S3 bucket.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


apiRequired
  • Type: aws_cdk.aws_apigateway.SpecRestApi

The api to grant permissions for.


operation_idRequired
  • Type: str

The ID of the operation for which permissions are being granted.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which permission resources can be created.


render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> ApiGatewayIntegration

Render the S3 integration as a snippet of OpenAPI.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


S3JsonErrorMessageIntegrationResponseSet

An integration response set for S3 errors, that returns a JSON payload with the S3 error message.

Initializers

import aws.pdk.type_safe_api

aws.pdk.type_safe_api.S3JsonErrorMessageIntegrationResponseSet()
Name Type Description

Methods

Name Description
render Render the integration responses into the Integration.

render
def render(
  method: str,
  path: str,
  content_types: typing.List[str] = None,
  operation_id: str,
  operation_lookup: typing.Mapping[OperationDetails],
  scope: Construct,
  cors_options: SerializedCorsOptions = None
) -> typing.Mapping[ApiGatewayIntegrationResponse]

Render the integration responses into the Integration.

methodRequired
  • Type: str

The http method of this operation.


pathRequired
  • Type: str

The path of this operation in the api.


content_typesOptional
  • Type: typing.List[str]
  • Default: application/json

Content types accepted by this operation.


operation_idRequired
  • Type: str

The ID of the operation being rendered.


operation_lookupRequired

Details about all operations in the API.


scopeRequired
  • Type: constructs.Construct

The scope in which the integration is being rendered.


cors_optionsOptional

Cross Origin Resource Sharing options for the API.


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