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). |
project
Required
- Type: projen.Project
open_api_options
Required
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
- Type: typing.List[Language]
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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
open_api_specification_path
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
open_api_options
Required
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
- Type: str
Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file
Required
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
api_name
Required
api_name: str
- Type: str
Name of the API.
definition
Required
definition: OpenApiAsyncDefinition
- Type: 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_TASK
Required
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). |
project
Required
- Type: projen.Project
open_api_options
Required
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
- Type: typing.List[Language]
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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
open_api_specification_path
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
open_api_options
Required
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
api_name
Required
api_name: str
- Type: str
Name of the API.
definition
Required
definition: OpenApiDefinition
- Type: 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_TASK
Required
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). |
project
Required
- Type: projen.Project
open_api_options
Required
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
- Type: typing.List[Language]
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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
open_api_specification_path
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
smithy_options
Required
- Type: SmithyModelOptions
Smithy engine options.
handler_languages
Optional
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
- Type: str
Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file
Required
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
deps
Required
- Type: SmithyBaseProject
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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
api_name
Required
api_name: str
- Type: str
Name of the API.
definition
Required
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_TASK
Required
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. |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
deps
Required
- Type: SmithyBaseProject
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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
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_TASK
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
smithy_options
Required
- Type: SmithyModelOptions
Smithy engine options.
handler_languages
Optional
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
deps
Required
- Type: SmithyBaseProject
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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
api_name
Required
api_name: str
- Type: str
Name of the API.
definition
Required
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_TASK
Required
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. |
project
Required
- Type: projen.Project
ignore_gradle_wrapper
Optional
- 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_output
Optional
- 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_options
Optional
- Type: SmithyBuildOptions
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.
deps
Required
- 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.
deps
Required
- Type: SmithyProjectDefinition
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.
sources
Required
- 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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
gradle_project_name
Required
gradle_project_name: str
- Type: str
Name of the gradle project.
model_dir
Required
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). |
project
Required
- Type: projen.Project
smithy_options
Required
- Type: SmithyModelOptions
Smithy engine options.
handler_languages
Optional
- Type: typing.List[Language]
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.
deps
Required
- 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.
deps
Required
- Type: SmithyProjectDefinition
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.
sources
Required
- 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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
gradle_project_name
Required
gradle_project_name: str
- Type: str
Name of the gradle project.
model_dir
Required
model_dir: str
- Type: str
Directory of model source code.
generated_model_dir
Required
generated_model_dir: str
- Type: str
Directory of generated model source code.
open_api_specification_path
Required
open_api_specification_path: str
- Type: str
Path to the generated OpenAPI specification, relative to the project outdir.
smithy_json_model_path
Required
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. |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
ignore_gradle_wrapper
Optional
- 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_output
Optional
- 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_options
Optional
- Type: SmithyBuildOptions
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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
deps
Required
- Type: SmithyBaseProject
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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
definition
Required
definition: SmithyProjectDefinition
- Type: 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_TASK
Required
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. |
scope
Required
- Type: constructs.Construct
id
Required
- Type: str
max_event_age
Optional
- 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_failure
Optional
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for failed invocations.
on_success
Optional
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for successful invocations.
retry_attempts
Optional
- 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_instrumentation
Optional
- Type: aws_cdk.aws_lambda.AdotInstrumentationConfig
- Default: No ADOT instrumentation
Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
allow_all_ipv6_outbound
Optional
- 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_outbound
Optional
- 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_subnet
Optional
- 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.
~~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_v2
Optional
- Type: aws_cdk.aws_lambda.ApplicationLogLevel
- Default: ApplicationLogLevel.INFO
Sets the application log level for the function.
architecture
Optional
- Type: aws_cdk.aws_lambda.Architecture
- Default: Architecture.X86_64
The system architectures compatible with this lambda function.
code_signing_config
Optional
- Type: aws_cdk.aws_lambda.ICodeSigningConfig
- Default: Not Sign the Code
Code signing config associated with this function.
current_version_options
Optional
- 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_queue
Optional
- Type: aws_cdk.aws_sqs.IQueue
- Default: SQS queue with 14 day retention period if
deadLetterQueueEnabled
istrue
The SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify deadLetterTopic
property instead.
dead_letter_queue_enabled
Optional
- 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_topic
Optional
- 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.
description
Optional
- Type: str
- Default: No description.
A description of the function.
environment
Optional
- 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_encryption
Optional
- 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_size
Optional
- Type: aws_cdk.Size
- Default: 512 MiB
The size of the function’s /tmp directory in MiB.
events
Optional
- 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
.
filesystem
Optional
- Type: aws_cdk.aws_lambda.FileSystem
- Default: will not mount any filesystem
The filesystem configuration for the lambda function.
function_name
Optional
- 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_policy
Optional
- 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_version
Optional
- Type: aws_cdk.aws_lambda.LambdaInsightsVersion
- Default: No Lambda Insights
Specify the version of CloudWatch Lambda insights to use for monitoring.
ipv6_allowed_for_dual_stack
Optional
- Type: bool
- Default: false
Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
Only used if 'vpc' is supplied.
layers
Optional
- 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_format
Optional
- Type: aws_cdk.aws_lambda.LoggingFormat
- Default: LoggingFormat.TEXT
Sets the loggingFormat for the function.
log_group
Optional
- 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_retention
Optional
- 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_options
Optional
- 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_role
Optional
- 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_size
Optional
- 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_secrets
Optional
- 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
profiling
Optional
- Type: bool
- Default: No profiling.
Enable profiling.
https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
profiling_group
Optional
- 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_loop
Optional
- 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_executions
Optional
- 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
role
Optional
- 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_mode
Optional
- Type: aws_cdk.aws_lambda.RuntimeManagementMode
- Default: Auto
Sets the runtime management configuration for a function's version.
security_groups
Optional
- 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_start
Optional
- 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_v2
Optional
- Type: aws_cdk.aws_lambda.SystemLogLevel
- Default: SystemLogLevel.INFO
Sets the system log level for the function.
timeout
Optional
- 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.
tracing
Optional
- Type: aws_cdk.aws_lambda.Tracing
- Default: Tracing.Disabled
Enable AWS X-Ray Tracing for Lambda Function.
vpc
Optional
- 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_subnets
Optional
- 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
).
code
Required
- 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.
handler
Required
- 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.
runtime
Required
- 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_start
Optional
- 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
).
policy
Required
- 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));
source
Required
- 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.
id
Required
- Type: str
batch_size
Optional
- 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_error
Optional
- Type: bool
- Default: false
If the function returns an error, split the batch in two and retry.
enabled
Optional
- Type: bool
- Default: true
Set to false to disable the event source upon creation.
event_source_arn
Optional
- 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_encryption
Optional
- 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
filters
Optional
- 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_servers
Optional
- 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_id
Optional
- 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.
kafka_topic
Optional
- Type: str
- Default: no topic
The name of the Kafka topic.
max_batching_window
Optional
- 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_concurrency
Optional
- 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_age
Optional
- 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_failure
Optional
- Type: aws_cdk.aws_lambda.IEventSourceDlq
- Default: discarded records are ignored
An Amazon SQS queue or Amazon SNS topic destination for discarded records.
parallelization_factor
Optional
- 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_failures
Optional
- 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_attempts
Optional
- 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_configurations
Optional
- 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.
starting_position
Optional
- 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.
starting_position_timestamp
Optional
- Type: typing.Union[int, float]
- Default: no timestamp
The time from which to start reading, in Unix time seconds.
support_s3_on_failure_destination
Optional
- Type: bool
- Default: false
Check if support S3 onfailure destination(ODF).
Currently only MSK and self managed kafka event support S3 ODF
tumbling_window
Optional
- 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_type
Optional
- Type: aws_cdk.aws_lambda.FunctionUrlAuthType
- Default: FunctionUrlAuthType.AWS_IAM
The type of authentication that your function URL uses.
cors
Optional
- Type: aws_cdk.aws_lambda.FunctionUrlCorsOptions
- Default: No CORS configuration.
The cross-origin resource sharing (CORS) settings for your function URL.
invoke_mode
Optional
- 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.
id
Required
- Type: str
The id for the permission construct.
principal
Required
- 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
orsns.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.
action
Optional
- 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_token
Optional
- 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_type
Optional
- Type: aws_cdk.aws_lambda.FunctionUrlAuthType
- Default: No functionUrlAuthType
The authType for the function URL that you are granting permissions for.
organization_id
Optional
- 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.
scope
Optional
- 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_account
Optional
- 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_arn
Optional
- 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.
statement
Required
- 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_age
Optional
- 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_failure
Optional
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for failed invocations.
on_success
Optional
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for successful invocations.
retry_attempts
Optional
- 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.
scope
Required
- Type: constructs.Construct
action
Required
- Type: str
grant_invoke
def grant_invoke(
grantee: IGrantable
) -> Grant
Grant the given identity permissions to invoke this Lambda.
grantee
Required
- 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_principal
Required
- 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.
grantee
Required
- 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.
grantee
Required
- 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.
grantee
Required
- Type: aws_cdk.aws_iam.IGrantable
version
Required
- 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_name
Required
- Type: str
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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_name
Required
- Type: str
The name of the alias.
max_event_age
Optional
- 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_failure
Optional
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for failed invocations.
on_success
Optional
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for successful invocations.
retry_attempts
Optional
- 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_versions
Optional
- 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.
description
Optional
- Type: str
- Default: No description
Description for the alias.
provisioned_concurrent_executions
Optional
- 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.
key
Required
- Type: str
The environment variable key.
value
Required
- Type: str
The environment variable's value.
remove_in_edge
Optional
- 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.
add_layers
def add_layers(
layers: ILayerVersion
) -> None
Adds one or more Lambda Layers to this Lambda function.
layers
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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.
construct
Required
- 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_name
Required
- Type: str
The property to classify.
locked
Required
- 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.
scope
Required
- Type: constructs.Construct
id
Required
- Type: str
function_arn
Required
- 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.
scope
Required
- Type: constructs.Construct
The parent construct.
id
Required
- Type: str
The name of the lambda construct.
function_arn
Required
- Type: str
The ARN of the Lambda function.
Format: arn:
architecture
Optional
- 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).
role
Optional
- 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_environment
Optional
- 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 tofalse
.
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_group
Optional
- 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_permissions
Optional
- 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.
scope
Required
- Type: constructs.Construct
id
Required
- Type: str
function_name
Required
- 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_name
Required
- Type: str
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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.
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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.
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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.
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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.
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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.
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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.
account
Optional
- Type: str
- Default: Deployment account.
Account which this metric comes from.
color
Optional
- 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_map
Optional
- Type: typing.Mapping[str]
- Default: No dimensions.
Dimensions of the metric.
label
Optional
- 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.
period
Optional
- Type: aws_cdk.Duration
- Default: Duration.minutes(5)
The period over which the specified statistic is applied.
region
Optional
- Type: str
- Default: Deployment region.
Region which this metric comes from.
statistic
Optional
- 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%)"
unit
Optional
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
env
Required
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.
stack
Required
stack: Stack
- Type: aws_cdk.Stack
The stack in which this resource is defined.
architecture
Required
architecture: Architecture
- Type: aws_cdk.aws_lambda.Architecture
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
connections
Required
connections: Connections
- Type: aws_cdk.aws_ec2.Connections
Access the Connections object.
Will fail if not a VPC-enabled Lambda Function
function_arn
Required
function_arn: str
- Type: str
ARN of this function.
function_name
Required
function_name: str
- Type: str
Name of this function.
grant_principal
Required
grant_principal: IPrincipal
- Type: aws_cdk.aws_iam.IPrincipal
The principal this Lambda Function is running as.
is_bound_to_vpc
Required
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_version
Required
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_node
Required
permissions_node: Node
- Type: constructs.Node
The construct node where permissions are attached.
resource_arns_for_grant_invoke
Required
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().
role
Optional
role: IRole
- Type: aws_cdk.aws_iam.IRole
Execution role associated with this function.
current_version
Required
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_group
Required
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.
runtime
Required
runtime: Runtime
- Type: aws_cdk.aws_lambda.Runtime
The runtime configured for this lambda.
dead_letter_queue
Optional
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_topic
Optional
dead_letter_topic: ITopic
- Type: aws_cdk.aws_sns.ITopic
The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).
timeout
Optional
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). |
project
Required
- Type: projen.Project
async_api_spec_file
Required
- Type: str
Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file
Required
- 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.
x
Required
- 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.
x
Required
- Type: typing.Any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
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). |
project
Required
- Type: projen.Project
parsed_spec_file
Required
- Type: str
Path of the parsed/bundled OpenAPI specification (relative to the project root).
open_api_specification_path
Required
- Type: str
Path to the OpenAPI specification.
smithy_json_model_path
Optional
- 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.
x
Required
- 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.
x
Required
- Type: typing.Any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
infrastructure
Required
Configuration for generated infrastructure.
model
Required
- Type: ModelConfiguration
Configuration for the API model.
commit_generated_code
Optional
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
documentation
Optional
Configuration for generated documentation.
handlers
Optional
- Type: HandlersConfiguration
Configuration for lambda handlers for implementing the API.
library
Optional
- Type: 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.
runtime
Optional
- Type: RuntimeConfiguration
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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
all
Required
all: ProjectCollections
- Type: ProjectCollections
Collections of all sub-projects managed by this project.
documentation
Required
documentation: GeneratedDocumentationProjects
Generated documentation projects.
Only the properties corresponding to specified documentation.formats
will be defined.
handlers
Required
handlers: GeneratedCodeProjects
- Type: GeneratedCodeProjects
Lambda handlers projects.
Only the properties corresponding to handlers.languages
will be defined.
infrastructure
Required
infrastructure: GeneratedCodeProjects
- Type: GeneratedCodeProjects
Generated infrastructure projects.
Only the property corresponding to infrastructure.language
will be defined.
library
Required
library: GeneratedLibraryProjects
- Type: GeneratedLibraryProjects
Generated library projects.
Only the properties corresponding to specified library.libraries
will be defined.
model
Required
model: ModelProject
- Type: ModelProject
Project for the api model.
runtime
Required
runtime: GeneratedCodeProjects
- Type: 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_TASK
Required
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. |
scope
Required
- Type: constructs.Construct
id
Required
- Type: str
cloud_watch_role
Optional
- 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_policy
Optional
- 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.
deploy
Optional
- 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_options
Optional
- 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.
description
Optional
- Type: str
- Default: 'Automatically created by the RestApi construct'
A description of the RestApi construct.
disable_execute_api_endpoint
Optional
- 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_name
Optional
- Type: aws_cdk.aws_apigateway.DomainNameOptions
- Default: no domain name is defined, use
addDomainName
or directly define aDomainName
.
Configure a custom domain name and map it to this API.
endpoint_export_name
Optional
- 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_types
Optional
- 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_warnings
Optional
- Type: bool
- Default: false
Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters
Optional
- 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
policy
Optional
- Type: aws_cdk.aws_iam.PolicyDocument
- Default: No policy.
A policy document that contains the permissions for this RestApi.
rest_api_name
Optional
- Type: str
- Default: ID of the RestApi construct.
A name for the API Gateway RestApi resource.
retain_deployments
Optional
- 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.
integrations
Required
- Type: typing.Mapping[TypeSafeApiIntegration]
A mapping of API operation to its integration.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about each operation.
api_key_options
Optional
- Type: ApiKeyOptions
Options for API keys.
cors_options
Optional
- Type: aws_cdk.aws_apigateway.CorsOptions
Cross Origin Resource Sharing options for the API.
default_authorizer
Optional
- Type: 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_path
Required
- Type: str
Path to the JSON open api spec.
min_compression_size
Optional
- 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_bucket
Optional
- 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_options
Optional
- Type: 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.
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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
api
Required
api: SpecRestApi
- Type: aws_cdk.aws_apigateway.SpecRestApi
Underlying API Gateway API construct.
extended_api_specification
Required
extended_api_specification: typing.Any
- Type: typing.Any
The OpenAPI specification with applied API gateway extensions.
ip_set
Optional
ip_set: CfnIPSet
- Type: aws_cdk.aws_wafv2.CfnIPSet
Reference to the IP set if created.
web_acl
Optional
web_acl: CfnWebACL
- Type: aws_cdk.aws_wafv2.CfnWebACL
Reference to the webacl, if created.
web_acl_association
Optional
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. |
scope
Required
- Type: constructs.Construct
id
Required
- Type: str
api_key_selection_expression
Optional
- 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_name
Optional
- Type: str
- Default: id of the WebSocketApi construct.
Name for the WebSocket API resource.
description
Optional
- Type: str
- Default: none
The description of the API.
integrations
Required
- Type: typing.Mapping[TypeSafeWebsocketApiIntegration]
WebSocket routes and their corresponding integrations.
operation_lookup
Required
- Type: typing.Mapping[WebsocketOperationDetails]
Details about each operation.
spec_path
Required
- Type: str
Path to the websocket api specification json file.
authorizer
Optional
- Type: aws_cdk.aws_apigatewayv2.IWebSocketRouteAuthorizer
- Default: NONE
Authorizer to use for the API (applied to the $connect route).
connect
Optional
- Type: TypeSafeWebsocketApiIntegration
- Default: mocked
Integration for the $connect route (invoked when a new client connects).
disable_access_logging
Optional
- Type: bool
- Default: false
Disable access logging.
disable_grant_management_access_to_lambdas
Optional
- 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_responses
Optional
- 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)
disconnect
Optional
- Type: TypeSafeWebsocketApiIntegration
- Default: mocked
Integration for the $disconnect route (invoked when a client disconnects).
stage_props
Optional
- Type: WebSocketStageProps
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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
api
Required
api: WebSocketApi
- Type: aws_cdk.aws_apigatewayv2.WebSocketApi
Reference to the websocket API.
default_stage
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
infrastructure
Required
Configuration for generated infrastructure.
model
Required
Configuration for the API model.
documentation
Optional
Configuration for generated documentation.
handlers
Optional
Configuration for lambda handlers for implementing the API.
library
Optional
Configuration for generated libraries.
These include clients for interacting with your websocket API
runtime
Optional
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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- 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
.
_pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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.
_glob
Required
- 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.
name
Required
- 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>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
all
Required
all: ProjectCollections
- Type: ProjectCollections
Collections of all sub-projects managed by this project.
documentation
Required
documentation: GeneratedWebSocketDocumentationProjects
Generated documentation projects.
Only the properties corresponding to specified documentation.formats
will be defined.
handlers
Required
handlers: GeneratedCodeProjects
- Type: GeneratedCodeProjects
Lambda handlers projects.
Only the properties corresponding to handlers.languages
will be defined.
infrastructure
Required
infrastructure: GeneratedCodeProjects
- Type: GeneratedCodeProjects
Generated infrastructure projects.
Only the property corresponding to infrastructure.language
will be defined.
library
Required
library: GeneratedWebSocketLibraryProjects
Generated library projects.
Only the properties corresponding to specified library.libraries
will be defined.
model
Required
model: WebSocketModelProject
- Type: WebSocketModelProject
Project for the api model.
runtime
Required
runtime: GeneratedCodeProjects
- Type: 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_TASK
Required
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). |
project
Required
- Type: projen.javascript.NodeProject
type_spec_options
Required
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
- Type: typing.List[Language]
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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
open_api_specification_path
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
auto_approve_options
Optional
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
- 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.
clobber
Optional
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
dev_container
Optional
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
- 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_credentials
Optional
- 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.
readme
Optional
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
- Type: projen.github.StaleOptions
- Default: see defaults in
StaleOptions
Auto-close stale issues and pull requests.
To disable set stale
to false
.
vscode
Optional
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
allow_library_dependencies
Optional
- 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_email
Optional
- Type: str
Author's e-mail.
author_name
Optional
- Type: str
Author's name.
author_organization
Optional
- Type: bool
Is the author an organization.
author_url
Optional
- Type: str
Author's URL / Website.
auto_detect_bin
Optional
- Type: bool
- Default: true
Automatically add all executables under the bin
directory to your package.json
file under the bin
section.
bin
Optional
- 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_email
Optional
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
- Type: str
The url to your project's issue tracker.
bundled_deps
Optional
- 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_options
Optional
- 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
deps
Optional
- 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' ]
description
Optional
- 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_deps
Optional
- 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' ]
entrypoint
Optional
- 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
homepage
Optional
- Type: str
Package's Homepage / Website.
keywords
Optional
- Type: typing.List[str]
Keywords to include in package.json
.
license
Optional
- 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.
licensed
Optional
- Type: bool
- Default: true
Indicates if a license should be added.
max_node_version
Optional
- Type: str
- Default: no max
Minimum node.js version to require via engines
(inclusive).
min_node_version
Optional
- Type: str
- Default: no "engines" specified
Minimum Node.js version to require via package.json engines
(inclusive).
npm_access
Optional
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_provenance
Optional
- 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 -
Type: str
The host name of the npm registry to publish to.
Cannot be set together with npmRegistryUrl
.
npm_registry_url
Optional
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
package_manager
Optional
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
- Type: str
- Default: defaults to project name
The "name" in package.json.
peer_dependency_options
Optional
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
- 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_version
Optional
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
repository
Optional
- 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_directory
Optional
- 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_options
Optional
- 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()
orpackage.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.
stability
Optional
- Type: str
Package's Stability.
yarn_berry_options
Optional
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
jsii_release_version
Optional
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
major_version
Optional
- 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_version
Optional
- 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_tag
Optional
- 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_steps
Optional
- Type: typing.List[projen.github.workflows.JobStep]
- Default: []
Steps to execute after build as part of the release workflow.
prerelease
Optional
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run
Optional
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
- 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_commits
Optional
- Type: projen.ReleasableCommits
- Default: ReleasableCommits.everyCommit()
Find commits that should be considered releasable Used to decide if a release is required.
release_branches
Optional
- 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_issue
Optional
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
- 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_prefix
Optional
- 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_trigger
Optional
- Type: projen.release.ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous()
)
The release trigger to use.
release_workflow_name
Optional
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
- Type: typing.List[projen.github.workflows.JobStep]
A set of workflow steps to execute in order to setup the workflow container.
versionrc_options
Optional
- 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_image
Optional
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_runs_on
Optional
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
default_release_branch
Required
- Type: str
- Default: "main"
The name of the main release branch.
artifacts_directory
Optional
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
auto_approve_upgrades
Optional
- 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_workflow
Optional
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
- 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_options
Optional
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
- 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_cov
Optional
- 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_secret
Optional
- 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
Optional
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
dependabot
Optional
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps_upgrade
Optional
- Type: bool
- Default: true
Use tasks and github workflows to handle dependency upgrades.
Cannot be used in conjunction with dependabot
.
deps_upgrade_options
Optional
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
gitignore
Optional
- Type: typing.List[str]
Additional entries to .gitignore.
jest
Optional
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
- 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_enabled
Optional
- Type: bool
- Default: true
Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
package
Optional
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
prettier
Optional
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
- Type: projen.javascript.PrettierOptions
- Default: default options
Prettier options.
projen_dev_dependency
Optional
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
- 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_options
Optional
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projen_version
Optional
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
pull_request_template
Optional
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
release
Optional
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_to_npm
Optional
- 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_steps
Optional
- 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_identity
Optional
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
type_spec_options
Required
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
async_api_spec_file
Required
- Type: str
Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file
Required
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- Type: str
The glob pattern to ignore.
add_package_ignore
def add_package_ignore(
pattern: str
) -> None
Adds patterns to be ignored by npm.
pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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
glob
Required
- 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.
name
Required
- 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
.
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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
bins
Required
- 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
.
deps
Required
- 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.
commands
Required
- Type: str
add_deps
def add_deps(
deps: str
) -> None
Defines normal dependencies.
deps
Required
- 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.
deps
Required
- 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
.
fields
Required
- Type: typing.Mapping[typing.Any]
The fields to set.
add_keywords
def add_keywords(
keywords: str
) -> None
Adds keywords to package.json (deduplicated).
keywords
Required
- 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.
deps
Required
- 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.
scripts
Required
- Type: typing.Mapping[str]
The scripts to set.
~~add_test_command
~~
def add_test_command(
commands: str
) -> None
DEPRECATED.
commands
Required
- Type: str
~~has_script
~~
def has_script(
name: str
) -> bool
Indicates if a script by the name name is defined.
name
Required
- Type: str
The name of the script.
remove_script
def remove_script(
name: str
) -> None
Removes the npm script (always successful).
name
Required
- 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_configuration
Optional
- 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.
mutable
Optional
- 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.
name
Required
- Type: str
The script name.
command
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
project_type
Required
project_type: ProjectType
- Type: projen.ProjectType
auto_approve
Optional
auto_approve: AutoApprove
- Type: projen.github.AutoApprove
Auto approve set up for this project.
dev_container
Optional
dev_container: DevContainer
- Type: projen.vscode.DevContainer
Access for .devcontainer.json (used for GitHub Codespaces).
This will be undefined
if devContainer boolean is false
github
Optional
github: GitHub
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
gitpod: Gitpod
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
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_directory
Required
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_directory
Required
artifacts_javascript_directory: str
- Type: str
The location of the npm tarball after build (${artifactsDirectory}/js
).
bundler
Required
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
npmrc
Required
npmrc: NpmConfig
- Type: projen.javascript.NpmConfig
The .npmrc file.
package
Required
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_command
Required
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_merge
Optional
auto_merge: AutoMerge
- Type: projen.github.AutoMerge
Component that sets up mergify for merging approved pull requests.
build_workflow
Optional
build_workflow: BuildWorkflow
- Type: projen.build.BuildWorkflow
The PR build GitHub workflow.
undefined
if buildWorkflow
is disabled.
build_workflow_job_id
Optional
build_workflow_job_id: str
- Type: str
The job ID of the build workflow.
jest
Optional
jest: Jest
- Type: projen.javascript.Jest
The Jest configuration (if enabled).
max_node_version
Optional
max_node_version: str
- Type: str
Maximum node version required by this package.
min_node_version
Optional
min_node_version: str
- Type: str
Minimum node.js version required by this package.
npmignore
Optional
npmignore: IgnoreFile
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
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.
release
Optional
release: Release
- Type: projen.release.Release
Release management.
upgrade_workflow
Optional
upgrade_workflow: UpgradeDependencies
- Type: projen.javascript.UpgradeDependencies
The upgrade workflow.
api_name
Required
api_name: str
- Type: str
definition
Required
definition: TypeSpecAsyncDefinition
- Type: TypeSpecAsyncDefinition
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
str |
The name of the default task (the task executed when projen is run without arguments). |
DEFAULT_TASK
Required
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). |
project
Required
- Type: projen.javascript.NodeProject
type_spec_options
Required
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
- Type: typing.List[Language]
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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
open_api_specification_path
Required
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). |
name
Required
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
- 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.
parent
Optional
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
- 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_json
Optional
- Type: bool
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrc_json_options
Optional
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
auto_approve_options
Optional
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
- 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.
clobber
Optional
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
dev_container
Optional
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
- 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_credentials
Optional
- 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.
readme
Optional
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
- Type: projen.github.StaleOptions
- Default: see defaults in
StaleOptions
Auto-close stale issues and pull requests.
To disable set stale
to false
.
vscode
Optional
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
allow_library_dependencies
Optional
- 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_email
Optional
- Type: str
Author's e-mail.
author_name
Optional
- Type: str
Author's name.
author_organization
Optional
- Type: bool
Is the author an organization.
author_url
Optional
- Type: str
Author's URL / Website.
auto_detect_bin
Optional
- Type: bool
- Default: true
Automatically add all executables under the bin
directory to your package.json
file under the bin
section.
bin
Optional
- 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_email
Optional
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
- Type: str
The url to your project's issue tracker.
bundled_deps
Optional
- 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_options
Optional
- 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
deps
Optional
- 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' ]
description
Optional
- 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_deps
Optional
- 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' ]
entrypoint
Optional
- 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
homepage
Optional
- Type: str
Package's Homepage / Website.
keywords
Optional
- Type: typing.List[str]
Keywords to include in package.json
.
license
Optional
- 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.
licensed
Optional
- Type: bool
- Default: true
Indicates if a license should be added.
max_node_version
Optional
- Type: str
- Default: no max
Minimum node.js version to require via engines
(inclusive).
min_node_version
Optional
- Type: str
- Default: no "engines" specified
Minimum Node.js version to require via package.json engines
(inclusive).
npm_access
Optional
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_provenance
Optional
- 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 -
Type: str
The host name of the npm registry to publish to.
Cannot be set together with npmRegistryUrl
.
npm_registry_url
Optional
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
package_manager
Optional
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
- Type: str
- Default: defaults to project name
The "name" in package.json.
peer_dependency_options
Optional
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
- 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_version
Optional
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
repository
Optional
- 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_directory
Optional
- 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_options
Optional
- 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()
orpackage.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.
stability
Optional
- Type: str
Package's Stability.
yarn_berry_options
Optional
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
jsii_release_version
Optional
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
major_version
Optional
- 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_version
Optional
- 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_tag
Optional
- 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_steps
Optional
- Type: typing.List[projen.github.workflows.JobStep]
- Default: []
Steps to execute after build as part of the release workflow.
prerelease
Optional
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run
Optional
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
- 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_commits
Optional
- Type: projen.ReleasableCommits
- Default: ReleasableCommits.everyCommit()
Find commits that should be considered releasable Used to decide if a release is required.
release_branches
Optional
- 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_issue
Optional
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
- 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_prefix
Optional
- 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_trigger
Optional
- Type: projen.release.ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous()
)
The release trigger to use.
release_workflow_name
Optional
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
- Type: typing.List[projen.github.workflows.JobStep]
A set of workflow steps to execute in order to setup the workflow container.
versionrc_options
Optional
- 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_image
Optional
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_runs_on
Optional
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
default_release_branch
Required
- Type: str
- Default: "main"
The name of the main release branch.
artifacts_directory
Optional
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
auto_approve_upgrades
Optional
- 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_workflow
Optional
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
- 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_options
Optional
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
- 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_cov
Optional
- 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_secret
Optional
- 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
Optional
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
dependabot
Optional
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps_upgrade
Optional
- Type: bool
- Default: true
Use tasks and github workflows to handle dependency upgrades.
Cannot be used in conjunction with dependabot
.
deps_upgrade_options
Optional
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
gitignore
Optional
- Type: typing.List[str]
Additional entries to .gitignore.
jest
Optional
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
- 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_enabled
Optional
- Type: bool
- Default: true
Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npm_ignore_options
Optional
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
package
Optional
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
prettier
Optional
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
- Type: projen.javascript.PrettierOptions
- Default: default options
Prettier options.
projen_dev_dependency
Optional
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
- 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_options
Optional
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projen_version
Optional
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
pull_request_template
Optional
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
release
Optional
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_to_npm
Optional
- 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_steps
Optional
- 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_identity
Optional
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
type_spec_options
Required
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
- 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.
globs
Required
- Type: str
The glob patterns to match.
add_git_ignore
def add_git_ignore(
pattern: str
) -> None
Adds a .gitignore pattern.
pattern
Required
- Type: str
The glob pattern to ignore.
add_package_ignore
def add_package_ignore(
pattern: str
) -> None
Adds patterns to be ignored by npm.
pattern
Required
- 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.
name
Required
- Type: str
The task name to add.
condition
Optional
- 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.
cwd
Optional
- Type: str
- Default: process.cwd()
The working directory for all steps in this task (unless overridden by the step).
description
Optional
- Type: str
- Default: the task name
The description of this build command.
env
Optional
- 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_env
Optional
- 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.
args
Optional
- Type: typing.List[str]
- Default: no arguments are passed to the step
Should the provided exec
shell command receive fixed args.
exec
Optional
- Type: str
- Default: add steps using
task.exec(command)
ortask.spawn(subtask)
Shell command to execute as the first command of the task.
receive_args
Optional
- Type: bool
- Default: false
Should the provided exec
shell command receive args passed to the task.
steps
Optional
- 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.
message
Required
- 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
glob
Required
- 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.
name
Required
- 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
.
task
Required
- Type: projen.Task
The task for which the command is required.
synth
def synth() -> None
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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_path
Required
- 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
bins
Required
- 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
.
deps
Required
- 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.
commands
Required
- Type: str
add_deps
def add_deps(
deps: str
) -> None
Defines normal dependencies.
deps
Required
- 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.
deps
Required
- 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
.
fields
Required
- Type: typing.Mapping[typing.Any]
The fields to set.
add_keywords
def add_keywords(
keywords: str
) -> None
Adds keywords to package.json (deduplicated).
keywords
Required
- 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.
deps
Required
- 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.
scripts
Required
- Type: typing.Mapping[str]
The scripts to set.
~~add_test_command
~~
def add_test_command(
commands: str
) -> None
DEPRECATED.
commands
Required
- Type: str
~~has_script
~~
def has_script(
name: str
) -> bool
Indicates if a script by the name name is defined.
name
Required
- Type: str
The name of the script.
remove_script
def remove_script(
name: str
) -> None
Removes the npm script (always successful).
name
Required
- 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_configuration
Optional
- 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.
mutable
Optional
- 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.
name
Required
- Type: str
The script name.
command
Required
- 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.
x
Required
- 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.
x
Required
- 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.
construct
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
build_task
Required
build_task: Task
- Type: projen.Task
commit_generated
Required
commit_generated: bool
- Type: bool
Whether to commit the managed files by default.
compile_task
Required
compile_task: Task
- Type: projen.Task
components
Required
components: typing.List[Component]
- Type: typing.List[projen.Component]
Returns all the components within this project.
deps
Required
deps: Dependencies
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected: bool
- Type: bool
Whether or not the project is being ejected.
files
Required
files: typing.List[FileBase]
- Type: typing.List[projen.FileBase]
All files in this project.
gitattributes
Required
gitattributes: GitAttributesFile
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore: IgnoreFile
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger: Logger
- Type: projen.Logger
Logging utilities.
name
Required
name: str
- Type: str
Project name.
outdir
Required
outdir: str
- Type: str
Absolute output directory of this project.
package_task
Required
package_task: Task
- Type: projen.Task
post_compile_task
Required
post_compile_task: Task
- Type: projen.Task
pre_compile_task
Required
pre_compile_task: Task
- Type: projen.Task
project_build
Required
project_build: ProjectBuild
- Type: projen.ProjectBuild
Manages the build process of the project.
projen_command
Required
projen_command: str
- Type: str
The command to use in order to run the projen CLI.
root
Required
root: Project
- Type: projen.Project
The root project.
subprojects
Required
subprojects: typing.List[Project]
- Type: typing.List[projen.Project]
Returns all the subprojects within this project.
tasks
Required
tasks: Tasks
- Type: projen.Tasks
Project tasks.
test_task
Required
test_task: Task
- Type: projen.Task
default_task
Optional
default_task: Task
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
init_project
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
A parent project.
If undefined, this is the root project.
project_type
Required
project_type: ProjectType
- Type: projen.ProjectType
auto_approve
Optional
auto_approve: AutoApprove
- Type: projen.github.AutoApprove
Auto approve set up for this project.
dev_container
Optional
dev_container: DevContainer
- Type: projen.vscode.DevContainer
Access for .devcontainer.json (used for GitHub Codespaces).
This will be undefined
if devContainer boolean is false
github
Optional
github: GitHub
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
gitpod: Gitpod
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
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_directory
Required
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_directory
Required
artifacts_javascript_directory: str
- Type: str
The location of the npm tarball after build (${artifactsDirectory}/js
).
bundler
Required
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
npmrc
Required
npmrc: NpmConfig
- Type: projen.javascript.NpmConfig
The .npmrc file.
package
Required
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_command
Required
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_merge
Optional
auto_merge: AutoMerge
- Type: projen.github.AutoMerge
Component that sets up mergify for merging approved pull requests.
build_workflow
Optional
build_workflow: BuildWorkflow
- Type: projen.build.BuildWorkflow
The PR build GitHub workflow.
undefined
if buildWorkflow
is disabled.
build_workflow_job_id
Optional
build_workflow_job_id: str
- Type: str
The job ID of the build workflow.
jest
Optional
jest: Jest
- Type: projen.javascript.Jest
The Jest configuration (if enabled).
max_node_version
Optional
max_node_version: str
- Type: str
Maximum node version required by this package.
min_node_version
Optional
min_node_version: str
- Type: str
Minimum node.js version required by this package.
npmignore
Optional
npmignore: IgnoreFile
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
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.
release
Optional
release: Release
- Type: projen.release.Release
Release management.
upgrade_workflow
Optional
upgrade_workflow: UpgradeDependencies
- Type: projen.javascript.UpgradeDependencies
The upgrade workflow.
api_name
Required
api_name: str
- Type: str
definition
Required
definition: TypeSpecDefinition
- Type: TypeSpecDefinition
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
str |
The name of the default task (the task executed when projen is run without arguments). |
DEFAULT_TASK
Required
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.
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). |
project
Required
- Type: projen.javascript.NodeProject
type_spec_options
Required
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
- Type: typing.List[Language]
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.
x
Required
- 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.
x
Required
- 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. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
project
Required
project: Project
- Type: projen.Project
open_api_specification_path
Required
open_api_specification_path: str
- Type: str
Path to the generated OpenAPI specification.
Structs
ApiGatewayIntegration
Represents an api gateway integration.
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_parameters
Optional
cache_key_parameters: typing.List[str]
- Type: typing.List[str]
A list of request parameters whose values are to be cached.
cache_namespace
Optional
cache_namespace: str
- Type: str
An API-specific tag group of related cached parameters.
connection_id
Optional
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_type
Optional
connection_type: str
- Type: str
The integration connection type.
The valid value is "VPC_LINK" for private integration or "INTERNET", otherwise.
content_handling
Optional
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.
credentials
Optional
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_method
Optional
http_method: str
- Type: str
The HTTP method used in the integration request.
For Lambda function invocations, the value must be POST.
passthrough_behavior
Optional
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_parameters
Optional
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.
request_templates
Optional
request_templates: typing.Mapping[str]
- Type: typing.Mapping[str]
Mapping templates for a request payload of specified MIME types.
responses
Optional
responses: typing.Mapping[ApiGatewayIntegrationResponse]
- Type: 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
Optional
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_config
Optional
tls_config: ApiGatewayIntegrationTlsConfig
Specifies the TLS configuration for an integration.
type
Optional
type: str
- Type: str
The type of integration with the specified backend.
https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html#type
uri
Optional
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_parameters
Required
response_parameters: typing.Mapping[str]
- Type: typing.Mapping[str]
Specifies parameter mappings for the response.
response_templates
Required
response_templates: typing.Mapping[str]
- Type: typing.Mapping[str]
Specifies MIME type-specific mapping templates for the response’s payload.
status_code
Required
status_code: str
- Type: str
HTTP status code for the method response.
content_handling
Optional
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.
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_verification
Optional
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. |
source
Required
source: ApiKeySourceType
- Type: aws_cdk.aws_apigateway.ApiKeySourceType
Source type for an API key.
required_by_default
Optional
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_type
Required
authorization_type: AuthorizationType
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
authorizer_id: str
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
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_ranges
Required
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_type
Required
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_path
Required
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_id
Required
authorizer_id: str
- Type: str
Unique identifier for this authorizer.
user_pools
Required
user_pools: typing.List[IUserPool]
- Type: typing.List[aws_cdk.aws_cognito.IUserPool]
The Cognito user pools associated with this authorizer.
authorization_scopes
Optional
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.
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_id
Required
authorizer_id: str
- Type: str
Unique identifier for this authorizer.
function
Required
function: IFunction
- Type: aws_cdk.aws_lambda.IFunction
The lambda function used to authorize requests.
authorizer_result_ttl_in_seconds
Optional
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_source
Optional
identity_source: str
- Type: str
- Default: "method.request.header.Authorization"
The source of the identity in an incoming request.
type
Optional
type: CustomAuthorizerType
- Type: CustomAuthorizerType
- Default: CustomAuthorizerType.TOKEN
The type of custom authorizer.
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. |
responses
Optional
responses: typing.Mapping[ApiGatewayIntegrationResponse]
- Type: 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_code
Optional
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. |
formats
Required
formats: typing.List[DocumentationFormat]
- Type: typing.List[DocumentationFormat]
Formats for generated documentation.
options
Optional
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_code
Optional
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_code
Optional
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. |
java
Optional
java: JavaProject
- Type: projen.java.JavaProject
Generated java project.
python
Optional
python: PythonProject
- Type: projen.python.PythonProject
Generated python project.
typescript
Optional
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_redoc
Optional
html_redoc: GeneratedHtmlRedocDocumentationOptions
Generated html redoc documentation project options.
markdown
Optional
markdown: GeneratedMarkdownDocumentationOptions
Generated markdown documentation project options.
plantuml
Optional
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_redoc
Optional
html_redoc: Project
- Type: projen.Project
Generated html redoc documentation project.
markdown
Optional
markdown: Project
- Type: projen.Project
Generated markdown documentation project.
plantuml
Optional
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. |
java
Optional
java: GeneratedJavaHandlersOptions
Options for the java handlers project.
These override the default inferred options.
python
Optional
python: GeneratedPythonHandlersOptions
Options for the python handlers project.
These override the default inferred options.
typescript
Optional
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_code
Optional
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_code
Optional
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. |
java
Optional
java: GeneratedJavaInfrastructureOptions
Options for the generated java infrastructure project.
These override the default inferred options.
python
Optional
python: GeneratedPythonInfrastructureOptions
Options for the generated python infrastructure project.
These override the default inferred options.
typescript
Optional
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_id
Optional
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_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
compile_options
Optional
compile_options: MavenCompileOptions
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
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()
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
distdir
Optional
distdir: str
- Type: str
- Default: "dist/java"
Final artifact output directory.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
group_id
Optional
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.
junit
Optional
junit: bool
- Type: bool
- Default: true
Include junit tests.
junit_options
Optional
junit_options: JunitOptions
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
logging
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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.
packaging
Optional
packaging: str
- Type: str
- Default: "jar"
Project packaging format.
packaging_options
Optional
packaging_options: MavenPackagingOptions
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
parent_pom
Optional
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_command
Optional
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_credentials
Optional
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_java
Optional
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_options
Optional
projenrc_java_options: ProjenrcOptions
- Type: projen.java.ProjenrcOptions
- Default: default options
Options related to projenrc in java.
projenrc_json
Optional
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_options
Optional
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.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
sample_java_package
Optional
sample_java_package: str
- Type: str
- Default: "org.acme"
The java package to use for the code sample.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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_deps
Optional
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()
.
url
Optional
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.
version
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
runtime_version
Optional
runtime_version: JavaVersion
- Type: JavaVersion
- Default: JavaVersion.JAVA_17
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_id
Optional
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_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
compile_options
Optional
compile_options: MavenCompileOptions
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
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()
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
distdir
Optional
distdir: str
- Type: str
- Default: "dist/java"
Final artifact output directory.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
group_id
Optional
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.
junit
Optional
junit: bool
- Type: bool
- Default: true
Include junit tests.
junit_options
Optional
junit_options: JunitOptions
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
logging
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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.
packaging
Optional
packaging: str
- Type: str
- Default: "jar"
Project packaging format.
packaging_options
Optional
packaging_options: MavenPackagingOptions
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
parent_pom
Optional
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_command
Optional
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_credentials
Optional
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_java
Optional
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_options
Optional
projenrc_java_options: ProjenrcOptions
- Type: projen.java.ProjenrcOptions
- Default: default options
Options related to projenrc in java.
projenrc_json
Optional
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_options
Optional
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.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
sample_java_package
Optional
sample_java_package: str
- Type: str
- Default: "org.acme"
The java package to use for the code sample.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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_deps
Optional
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()
.
url
Optional
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.
version
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
mock_data_options
Optional
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_id
Optional
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_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
compile_options
Optional
compile_options: MavenCompileOptions
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
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()
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
distdir
Optional
distdir: str
- Type: str
- Default: "dist/java"
Final artifact output directory.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
group_id
Optional
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.
junit
Optional
junit: bool
- Type: bool
- Default: true
Include junit tests.
junit_options
Optional
junit_options: JunitOptions
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
logging
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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.
packaging
Optional
packaging: str
- Type: str
- Default: "jar"
Project packaging format.
packaging_options
Optional
packaging_options: MavenPackagingOptions
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
parent_pom
Optional
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_command
Optional
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_credentials
Optional
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_java
Optional
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_options
Optional
projenrc_java_options: ProjenrcOptions
- Type: projen.java.ProjenrcOptions
- Default: default options
Options related to projenrc in java.
projenrc_json
Optional
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_options
Optional
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.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
sample_java_package
Optional
sample_java_package: str
- Type: str
- Default: "org.acme"
The java package to use for the code sample.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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_deps
Optional
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()
.
url
Optional
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.
version
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commit_generated_code
Optional
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_hooks
Optional
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_hooks
Optional
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_code
Optional
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_code
Optional
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_code
Optional
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_email
Optional
author_email: str
- Type: str
- Default: $GIT_USER_EMAIL
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
- Default: $GIT_USER_NAME
Author's name.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
classifiers
Optional
classifiers: typing.List[str]
- Type: typing.List[str]
A list of PyPI trove classifiers that describe the project.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
deps
Optional
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()
.
description
Optional
description: str
- Type: str
A short description of the package.
dev_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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()
.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
A URL to the website of the project.
license
Optional
license: str
- Type: str
License of this package as an SPDX identifier.
logging
Optional
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_name
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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_name
Optional
package_name: str
- Type: str
Package name.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
poetry_options
Optional
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_command
Optional
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_credentials
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_python_options
Optional
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.
pytest
Optional
pytest: bool
- Type: bool
- Default: true
Include pytest tests.
pytest_options
Optional
pytest_options: PytestOptions
- Type: projen.python.PytestOptions
- Default: defaults
pytest options.
python_exec
Optional
python_exec: str
- Type: str
- Default: "python"
Path to the python executable to use.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
setup_config
Optional
setup_config: typing.Mapping[typing.Any]
- Type: typing.Mapping[typing.Any]
Additional fields to pass in the setup() function if using setuptools.
setuptools
Optional
setuptools: bool
- Type: bool
- Default: true, unless poetry is true, then false
Use setuptools with a setup.py script for packaging and publishing.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
version
Optional
version: str
- Type: str
- Default: "0.1.0"
Version of the package.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
architecture
Optional
architecture: Architecture
- Type: Architecture
- Default: Architecture.X86_64
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_version
Optional
runtime_version: PythonVersion
- Type: PythonVersion
- Default: PythonVersion.PYTHON_3_11
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_email
Optional
author_email: str
- Type: str
- Default: $GIT_USER_EMAIL
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
- Default: $GIT_USER_NAME
Author's name.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
classifiers
Optional
classifiers: typing.List[str]
- Type: typing.List[str]
A list of PyPI trove classifiers that describe the project.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
deps
Optional
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()
.
description
Optional
description: str
- Type: str
A short description of the package.
dev_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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()
.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
A URL to the website of the project.
license
Optional
license: str
- Type: str
License of this package as an SPDX identifier.
logging
Optional
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_name
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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_name
Optional
package_name: str
- Type: str
Package name.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
poetry_options
Optional
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_command
Optional
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_credentials
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_python_options
Optional
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.
pytest
Optional
pytest: bool
- Type: bool
- Default: true
Include pytest tests.
pytest_options
Optional
pytest_options: PytestOptions
- Type: projen.python.PytestOptions
- Default: defaults
pytest options.
python_exec
Optional
python_exec: str
- Type: str
- Default: "python"
Path to the python executable to use.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
setup_config
Optional
setup_config: typing.Mapping[typing.Any]
- Type: typing.Mapping[typing.Any]
Additional fields to pass in the setup() function if using setuptools.
setuptools
Optional
setuptools: bool
- Type: bool
- Default: true, unless poetry is true, then false
Use setuptools with a setup.py script for packaging and publishing.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
version
Optional
version: str
- Type: str
- Default: "0.1.0"
Version of the package.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
mock_data_options
Optional
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_email
Optional
author_email: str
- Type: str
- Default: $GIT_USER_EMAIL
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
- Default: $GIT_USER_NAME
Author's name.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
classifiers
Optional
classifiers: typing.List[str]
- Type: typing.List[str]
A list of PyPI trove classifiers that describe the project.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
deps
Optional
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()
.
description
Optional
description: str
- Type: str
A short description of the package.
dev_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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()
.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
A URL to the website of the project.
license
Optional
license: str
- Type: str
License of this package as an SPDX identifier.
logging
Optional
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_name
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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_name
Optional
package_name: str
- Type: str
Package name.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
poetry_options
Optional
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_command
Optional
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_credentials
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_python_options
Optional
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.
pytest
Optional
pytest: bool
- Type: bool
- Default: true
Include pytest tests.
pytest_options
Optional
pytest_options: PytestOptions
- Type: projen.python.PytestOptions
- Default: defaults
pytest options.
python_exec
Optional
python_exec: str
- Type: str
- Default: "python"
Path to the python executable to use.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
setup_config
Optional
setup_config: typing.Mapping[typing.Any]
- Type: typing.Mapping[typing.Any]
Additional fields to pass in the setup() function if using setuptools.
setuptools
Optional
setuptools: bool
- Type: bool
- Default: true, unless poetry is true, then false
Use setuptools with a setup.py script for packaging and publishing.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
version
Optional
version: str
- Type: str
- Default: "0.1.0"
Version of the package.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commit_generated_code
Optional
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. |
java
Optional
java: GeneratedJavaRuntimeOptions
Options for a generated java project.
These override the default inferred options.
python
Optional
python: GeneratedPythonRuntimeOptions
Options for a generated python project.
These override the default inferred options.
typescript
Optional
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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
handler_entry_points
Optional
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_version
Optional
runtime_version: NodeVersion
- Type: NodeVersion
- Default: NodeVersion.NODE_18
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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
mock_data_options
Optional
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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
commit_generated_code
Optional
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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
commit_generated_code
Optional
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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
commit_generated_code
Optional
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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
commit_generated_code
Optional
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. |
html
Optional
html: GeneratedAsyncApiHtmlDocumentationOptions
Generated AsyncAPI html documentation project options.
markdown
Optional
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. |
html
Optional
html: Project
- Type: projen.Project
Generated AsyncAPI html documentation project.
markdown
Optional
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_client
Optional
typescript_web_socket_client: GeneratedTypeScriptWebSocketClientOptions
Options for the generated typescript websocket client library.
These override the default inferred options.
typescript_web_socket_hooks
Optional
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_client
Optional
typescript_web_socket_client: TypeScriptProject
- Type: projen.typescript.TypeScriptProject
Generated typescript websocket client project.
typescript_web_socket_hooks
Optional
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. |
languages
Required
languages: typing.List[Language]
- Type: 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.
options
Optional
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. |
language
Required
language: Language
- Type: Language
The language to generate the type-safe CDK infrastructure in.
options
Optional
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. |
method
Required
method: str
- Type: str
The http method of this operation.
path
Required
path: str
- Type: str
The path of this operation in the api.
content_types
Optional
content_types: typing.List[str]
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
api
Required
api: SpecRestApi
- Type: aws_cdk.aws_apigateway.SpecRestApi
The api to grant permissions for.
operation_id
Required
operation_id: str
- Type: str
The ID of the operation for which permissions are being granted.
operation_lookup
Required
operation_lookup: typing.Mapping[OperationDetails]
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
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. |
method
Required
method: str
- Type: str
The http method of this operation.
path
Required
path: str
- Type: str
The path of this operation in the api.
content_types
Optional
content_types: typing.List[str]
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
operation_id: str
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
operation_lookup: typing.Mapping[OperationDetails]
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
scope: Construct
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
cors_options: SerializedCorsOptions
- Type: 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_id
Optional
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_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
compile_options
Optional
compile_options: MavenCompileOptions
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
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()
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
distdir
Optional
distdir: str
- Type: str
- Default: "dist/java"
Final artifact output directory.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
group_id
Optional
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.
junit
Optional
junit: bool
- Type: bool
- Default: true
Include junit tests.
junit_options
Optional
junit_options: JunitOptions
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
logging
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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.
packaging
Optional
packaging: str
- Type: str
- Default: "jar"
Project packaging format.
packaging_options
Optional
packaging_options: MavenPackagingOptions
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
parent_pom
Optional
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_command
Optional
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_credentials
Optional
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_java
Optional
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_options
Optional
projenrc_java_options: ProjenrcOptions
- Type: projen.java.ProjenrcOptions
- Default: default options
Options related to projenrc in java.
projenrc_json
Optional
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_options
Optional
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.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
sample_java_package
Optional
sample_java_package: str
- Type: str
- Default: "org.acme"
The java package to use for the code sample.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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_deps
Optional
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()
.
url
Optional
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.
version
Optional
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.
vscode
Optional
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. |
libraries
Required
libraries: typing.List[Library]
- Type: typing.List[Library]
The library to generate.
options
Optional
options: GeneratedLibraryOptions
- Type: 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. |
name
Required
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_rules
Optional
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, includingCount
.
managed_rule_group_configs
Optional
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_overrides
Optional
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_statement
Optional
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.
version
Optional
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_name
Optional
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
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. |
method
Required
method: str
- Type: str
The http method of this operation.
path
Required
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_code
Required
status_code: typing.Union[int, float]
- Type: typing.Union[int, float]
HTTP response status code.
body
Optional
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. |
disable
Optional
disable: bool
- Type: bool
- Default: false
Set to true to disable generating mock data.
locale
Optional
locale: str
- Type: str
- Default: en
Locale of generated data.
https://fakerjs.dev/guide/localization.html#available-locales
max_array_length
Optional
max_array_length: typing.Union[int, float]
- Type: typing.Union[int, float]
- Default: 3
Maximum length of generated arrays.
seed
Optional
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_options
Optional
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. |
language
Required
language: ModelLanguage
- Type: ModelLanguage
The language the API model is defined in.
options
Required
options: ModelOptions
- Type: 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. |
openapi
Optional
openapi: OpenApiModelOptions
- Type: OpenApiModelOptions
Options for the OpenAPI model - required when model language is OPENAPI.
smithy
Optional
smithy: SmithyModelOptions
- Type: SmithyModelOptions
Options for the Smithy model - required when model language is SMITHY.
type_spec
Optional
type_spec: TypeSpecModelOptions
- Type: 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_name
Required
api_name: str
- Type: str
Name of the API.
outdir
Required
outdir: str
- Type: str
Directory of the model project.
parsed_spec_file
Required
parsed_spec_file: str
- Type: str
Name of the bundled OpenAPI specification file.
openapi
Optional
openapi: OpenApiModelProject
- Type: OpenApiModelProject
Reference to the OpenAPI model project.
Will be defined if the model language is OpenAPI
smithy
Optional
smithy: SmithyModelProject
- Type: SmithyModelProject
Reference to the Smithy model project.
Will be defined if the model language is Smithy
type_spec
Optional
type_spec: TypeSpecModelProject
- Type: 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_name
Required
api_name: str
- Type: str
Name of the API.
outdir
Required
outdir: str
- Type: str
Directory of the model project.
parsed_spec_file
Required
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_options
Required
open_api_options: OpenApiModelOptions
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
open_api_options
Required
open_api_options: OpenApiModelOptions
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
parsed_spec_file: str
- Type: str
Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file
Required
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_options
Required
open_api_options: OpenApiModelOptions
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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. |
title
Required
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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
open_api_options
Required
open_api_options: OpenApiModelOptions
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
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_options
Required
open_api_options: OpenApiModelOptions
- Type: OpenApiModelOptions
Options for the openapi model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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. |
method
Required
method: str
- Type: str
The http method of this operation.
path
Required
path: str
- Type: str
The path of this operation in the api.
content_types
Optional
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. |
name
Required
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_rules
Optional
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, includingCount
.
managed_rule_group_configs
Optional
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_overrides
Optional
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_statement
Optional
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.
version
Optional
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. |
documentation
Required
documentation: typing.List[Project]
- Type: typing.List[projen.Project]
Array of all documentation projects.
handlers
Required
handlers: typing.List[Project]
- Type: typing.List[projen.Project]
Array of all handler projects.
infrastructure
Required
infrastructure: typing.List[Project]
- Type: typing.List[projen.Project]
Array of all infrastructure projects.
libraries
Required
libraries: typing.List[Project]
- Type: typing.List[projen.Project]
Array of all library projects.
model
Required
model: typing.List[Project]
- Type: typing.List[projen.Project]
Array of all model projects.
projects
Required
projects: typing.List[Project]
- Type: typing.List[projen.Project]
Array of all projects managed by type-safe-api.
runtimes
Required
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_email
Optional
author_email: str
- Type: str
- Default: $GIT_USER_EMAIL
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
- Default: $GIT_USER_NAME
Author's name.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
classifiers
Optional
classifiers: typing.List[str]
- Type: typing.List[str]
A list of PyPI trove classifiers that describe the project.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
deps
Optional
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()
.
description
Optional
description: str
- Type: str
A short description of the package.
dev_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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()
.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
A URL to the website of the project.
license
Optional
license: str
- Type: str
License of this package as an SPDX identifier.
logging
Optional
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_name
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
outdir
Optional
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_name
Optional
package_name: str
- Type: str
Package name.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
poetry_options
Optional
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_command
Optional
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_credentials
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_python_options
Optional
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.
pytest
Optional
pytest: bool
- Type: bool
- Default: true
Include pytest tests.
pytest_options
Optional
pytest_options: PytestOptions
- Type: projen.python.PytestOptions
- Default: defaults
pytest options.
python_exec
Optional
python_exec: str
- Type: str
- Default: "python"
Path to the python executable to use.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
sample
Optional
sample: bool
- Type: bool
- Default: true
Include sample code and test if the relevant directories don't exist.
setup_config
Optional
setup_config: typing.Mapping[typing.Any]
- Type: typing.Mapping[typing.Any]
Additional fields to pass in the setup() function if using setuptools.
setuptools
Optional
setuptools: bool
- Type: bool
- Default: true, unless poetry is true, then false
Use setuptools with a setup.py script for packaging and publishing.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
version
Optional
version: str
- Type: str
- Default: "0.1.0"
Version of the package.
vscode
Optional
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. |
languages
Required
languages: typing.List[Language]
- Type: 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.
options
Optional
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. |
bucket
Required
bucket: IBucket
- Type: aws_cdk.aws_s3.IBucket
The S3 bucket to be invoked on integration.
integration_response_set
Optional
integration_response_set: IntegrationResponseSet
- Type: IntegrationResponseSet
- Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()
Override the integration response set for the S3 integration.
method
Optional
method: str
- Type: str
- Default: integration method is used
The HTTP method to use when invoking the S3 bucket.
path
Optional
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_headers
Required
allow_headers: typing.List[str]
- Type: typing.List[str]
Headers to allow.
allow_methods
Required
allow_methods: typing.List[str]
- Type: typing.List[str]
HTTP methods to allow.
allow_origins
Required
allow_origins: typing.List[str]
- Type: typing.List[str]
Origins to allow.
status_code
Required
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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
smithy_options
Required
smithy_options: SmithyModelOptions
- Type: SmithyModelOptions
Smithy engine options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
parsed_spec_file: str
- Type: str
Path of the parsed/bundled OpenAPI specification (relative to the project root).
async_api_spec_file
Required
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. |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
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. |
imports
Optional
imports: typing.List[str]
- Type: typing.List[str]
List of imports.
plugins
Optional
plugins: typing.Mapping[typing.Mapping[typing.Any]]
- Type: typing.Mapping[typing.Mapping[typing.Any]]
Plugins keyed by plugin id.
additional_sources
Optional
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_plugins
Optional
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.
maven
Optional
maven: SmithyMavenConfiguration
- Type: SmithyMavenConfiguration
- Default: the default configuration required for Smithy to OpenAPI conversion
Maven configuration for the Smithy build project, used to specify dependencies and repositories in the build.gradle and smithy-build.json files.
projections
Optional
projections: typing.Mapping[SmithyProjection]
- Type: typing.Mapping[SmithyProjection]
- Default: no projections
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. |
imports
Optional
imports: typing.List[str]
- Type: typing.List[str]
List of imports.
plugins
Optional
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. |
dependencies
Optional
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_urls
Optional
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_wrapper
Optional
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_output
Optional
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_options
Optional
smithy_build_options: SmithyBuildOptions
- Type: SmithyBuildOptions
Smithy build options.
service_name
Required
service_name: SmithyServiceName
- Type: 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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
smithy_options
Required
smithy_options: SmithyModelOptions
- Type: SmithyModelOptions
Smithy engine options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
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_wrapper
Optional
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_output
Optional
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_options
Optional
smithy_build_options: SmithyBuildOptions
- Type: 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. |
imports
Optional
imports: typing.List[str]
- Type: typing.List[str]
List of imports.
plugins
Optional
plugins: typing.Mapping[typing.Mapping[typing.Any]]
- Type: typing.Mapping[typing.Mapping[typing.Any]]
Plugins keyed by plugin id.
abstract
Optional
abstract: bool
- Type: bool
Whether or not the projection is abstract.
transforms
Optional
transforms: typing.List[SmithyTransform]
- Type: 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. |
namespace
Required
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_name
Required
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_options
Required
smithy_options: SmithyModelOptions
- Type: SmithyModelOptions
Smithy engine options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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. |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
ignore_gradle_wrapper
Optional
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_output
Optional
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_options
Optional
smithy_build_options: SmithyBuildOptions
- Type: 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. |
args
Required
args: typing.Mapping[typing.Any]
- Type: typing.Mapping[typing.Any]
Arguments for the transform.
name
Required
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_age
Optional
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_failure
Optional
on_failure: IDestination
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for failed invocations.
on_success
Optional
on_success: IDestination
- Type: aws_cdk.aws_lambda.IDestination
- Default: no destination
The destination for successful invocations.
retry_attempts
Optional
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_instrumentation
Optional
adot_instrumentation: AdotInstrumentationConfig
- Type: aws_cdk.aws_lambda.AdotInstrumentationConfig
- Default: No ADOT instrumentation
Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
allow_all_ipv6_outbound
Optional
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_outbound
Optional
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_subnet
Optional
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.
~~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_v2
Optional
application_log_level_v2: ApplicationLogLevel
- Type: aws_cdk.aws_lambda.ApplicationLogLevel
- Default: ApplicationLogLevel.INFO
Sets the application log level for the function.
architecture
Optional
architecture: Architecture
- Type: aws_cdk.aws_lambda.Architecture
- Default: Architecture.X86_64
The system architectures compatible with this lambda function.
code_signing_config
Optional
code_signing_config: ICodeSigningConfig
- Type: aws_cdk.aws_lambda.ICodeSigningConfig
- Default: Not Sign the Code
Code signing config associated with this function.
current_version_options
Optional
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_queue
Optional
dead_letter_queue: IQueue
- Type: aws_cdk.aws_sqs.IQueue
- Default: SQS queue with 14 day retention period if
deadLetterQueueEnabled
istrue
The SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify deadLetterTopic
property instead.
dead_letter_queue_enabled
Optional
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_topic
Optional
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.
description
Optional
description: str
- Type: str
- Default: No description.
A description of the function.
environment
Optional
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_encryption
Optional
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_size
Optional
ephemeral_storage_size: Size
- Type: aws_cdk.Size
- Default: 512 MiB
The size of the function’s /tmp directory in MiB.
events
Optional
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
.
filesystem
Optional
filesystem: FileSystem
- Type: aws_cdk.aws_lambda.FileSystem
- Default: will not mount any filesystem
The filesystem configuration for the lambda function.
function_name
Optional
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_policy
Optional
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_version
Optional
insights_version: LambdaInsightsVersion
- Type: aws_cdk.aws_lambda.LambdaInsightsVersion
- Default: No Lambda Insights
Specify the version of CloudWatch Lambda insights to use for monitoring.
ipv6_allowed_for_dual_stack
Optional
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.
layers
Optional
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_format
Optional
logging_format: LoggingFormat
- Type: aws_cdk.aws_lambda.LoggingFormat
- Default: LoggingFormat.TEXT
Sets the loggingFormat for the function.
log_group
Optional
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_retention
Optional
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_options
Optional
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_role
Optional
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_size
Optional
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_secrets
Optional
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
profiling
Optional
profiling: bool
- Type: bool
- Default: No profiling.
Enable profiling.
https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
profiling_group
Optional
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_loop
Optional
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_executions
Optional
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
role
Optional
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_mode
Optional
runtime_management_mode: RuntimeManagementMode
- Type: aws_cdk.aws_lambda.RuntimeManagementMode
- Default: Auto
Sets the runtime management configuration for a function's version.
security_groups
Optional
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_start
Optional
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_v2
Optional
system_log_level_v2: SystemLogLevel
- Type: aws_cdk.aws_lambda.SystemLogLevel
- Default: SystemLogLevel.INFO
Sets the system log level for the function.
timeout
Optional
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.
tracing
Optional
tracing: Tracing
- Type: aws_cdk.aws_lambda.Tracing
- Default: Tracing.Disabled
Enable AWS X-Ray Tracing for Lambda Function.
vpc
Optional
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_subnets
Optional
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
).
code
Required
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.
handler
Required
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.
runtime
Required
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_start
Optional
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_file
Required
async_api_spec_file: str
- Type: str
Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file
Required
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_file
Required
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. |
integration
Required
integration: Integration
- Type: Integration
The integration to service the api operation.
authorizer
Optional
authorizer: Authorizer
- Type: Authorizer
The authorizer to use for this api operation (overrides the default).
options
Optional
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_required
Optional
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_file
Required
parsed_spec_file: str
- Type: str
Path of the parsed/bundled OpenAPI specification (relative to the project root).
open_api_specification_path
Required
open_api_specification_path: str
- Type: str
Path to the OpenAPI specification.
smithy_json_model_path
Optional
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_file
Required
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_language
Required
model_language: ModelLanguage
- Type: ModelLanguage
Language the model is defined in.
model_options
Required
model_options: ModelOptions
- Type: ModelOptions
Options for the model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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. |
integrations
Required
integrations: typing.Mapping[TypeSafeApiIntegration]
- Type: typing.Mapping[TypeSafeApiIntegration]
A mapping of API operation to its integration.
operation_lookup
Required
operation_lookup: typing.Mapping[OperationDetails]
- Type: typing.Mapping[OperationDetails]
Details about each operation.
api_key_options
Optional
api_key_options: ApiKeyOptions
- Type: ApiKeyOptions
Options for API keys.
cors_options
Optional
cors_options: CorsOptions
- Type: aws_cdk.aws_apigateway.CorsOptions
Cross Origin Resource Sharing options for the API.
default_authorizer
Optional
default_authorizer: Authorizer
- Type: 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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
infrastructure
Required
infrastructure: InfrastructureConfiguration
Configuration for generated infrastructure.
model
Required
model: ModelConfiguration
- Type: ModelConfiguration
Configuration for the API model.
commit_generated_code
Optional
commit_generated_code: bool
- Type: bool
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
documentation
Optional
documentation: DocumentationConfiguration
Configuration for generated documentation.
handlers
Optional
handlers: HandlersConfiguration
- Type: HandlersConfiguration
Configuration for lambda handlers for implementing the API.
library
Optional
library: LibraryConfiguration
- Type: 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.
runtime
Optional
runtime: RuntimeConfiguration
- Type: 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_list
Optional
cidr_allow_list: CidrAllowList
- Type: CidrAllowList
- Default: undefined
List of cidr ranges to allow.
disable
Optional
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_rules
Optional
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_role
Optional
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_policy
Optional
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.
deploy
Optional
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_options
Optional
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.
description
Optional
description: str
- Type: str
- Default: 'Automatically created by the RestApi construct'
A description of the RestApi construct.
disable_execute_api_endpoint
Optional
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_name
Optional
domain_name: DomainNameOptions
- Type: aws_cdk.aws_apigateway.DomainNameOptions
- Default: no domain name is defined, use
addDomainName
or directly define aDomainName
.
Configure a custom domain name and map it to this API.
endpoint_export_name
Optional
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_types
Optional
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_warnings
Optional
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.
parameters
Optional
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
policy
Optional
policy: PolicyDocument
- Type: aws_cdk.aws_iam.PolicyDocument
- Default: No policy.
A policy document that contains the permissions for this RestApi.
rest_api_name
Optional
rest_api_name: str
- Type: str
- Default: ID of the RestApi construct.
A name for the API Gateway RestApi resource.
retain_deployments
Optional
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.
integrations
Required
integrations: typing.Mapping[TypeSafeApiIntegration]
- Type: typing.Mapping[TypeSafeApiIntegration]
A mapping of API operation to its integration.
operation_lookup
Required
operation_lookup: typing.Mapping[OperationDetails]
- Type: typing.Mapping[OperationDetails]
Details about each operation.
api_key_options
Optional
api_key_options: ApiKeyOptions
- Type: ApiKeyOptions
Options for API keys.
cors_options
Optional
cors_options: CorsOptions
- Type: aws_cdk.aws_apigateway.CorsOptions
Cross Origin Resource Sharing options for the API.
default_authorizer
Optional
default_authorizer: Authorizer
- Type: 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_path
Required
spec_path: str
- Type: str
Path to the JSON open api spec.
min_compression_size
Optional
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_bucket
Optional
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_options
Optional
web_acl_options: TypeSafeApiWebAclOptions
- Type: 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. |
integration
Required
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. |
language
Required
language: ModelLanguage
- Type: ModelLanguage
The language the API model is defined in.
options
Required
options: ModelOptions
- Type: 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_language
Required
model_language: ModelLanguage
- Type: ModelLanguage
Language the model is defined in.
model_options
Required
model_options: ModelOptions
- Type: ModelOptions
Options for the model.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
infrastructure
Required
infrastructure: WebSocketInfrastructureConfiguration
Configuration for generated infrastructure.
model
Required
model: TypeSafeWebSocketApiModelConfiguration
Configuration for the API model.
documentation
Optional
documentation: WebSocketDocumentationConfiguration
Configuration for generated documentation.
handlers
Optional
handlers: WebSocketHandlersConfiguration
Configuration for lambda handlers for implementing the API.
library
Optional
library: WebSocketLibraryConfiguration
Configuration for generated libraries.
These include clients for interacting with your websocket API
runtime
Optional
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_expression
Optional
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_name
Optional
api_name: str
- Type: str
- Default: id of the WebSocketApi construct.
Name for the WebSocket API resource.
description
Optional
description: str
- Type: str
- Default: none
The description of the API.
integrations
Required
integrations: typing.Mapping[TypeSafeWebsocketApiIntegration]
- Type: typing.Mapping[TypeSafeWebsocketApiIntegration]
WebSocket routes and their corresponding integrations.
operation_lookup
Required
operation_lookup: typing.Mapping[WebsocketOperationDetails]
- Type: typing.Mapping[WebsocketOperationDetails]
Details about each operation.
spec_path
Required
spec_path: str
- Type: str
Path to the websocket api specification json file.
authorizer
Optional
authorizer: IWebSocketRouteAuthorizer
- Type: aws_cdk.aws_apigatewayv2.IWebSocketRouteAuthorizer
- Default: NONE
Authorizer to use for the API (applied to the $connect route).
connect
Optional
connect: TypeSafeWebsocketApiIntegration
- Type: TypeSafeWebsocketApiIntegration
- Default: mocked
Integration for the $connect route (invoked when a new client connects).
disable_access_logging
Optional
disable_access_logging: bool
- Type: bool
- Default: false
Disable access logging.
disable_grant_management_access_to_lambdas
Optional
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_responses
Optional
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)
disconnect
Optional
disconnect: TypeSafeWebsocketApiIntegration
- Type: TypeSafeWebsocketApiIntegration
- Default: mocked
Integration for the $disconnect route (invoked when a client disconnects).
stage_props
Optional
stage_props: WebSocketStageProps
- Type: 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_dependencies
Optional
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_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
author_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_approve_upgrades
Optional
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_bin
Optional
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_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
build_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_deps
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
code_artifact_options
Optional
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_cov
Optional
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_secret
Optional
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_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
copyright_owner
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
default_release_branch
Optional
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps
Optional
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_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
description
Optional
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_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
dev_deps
Optional
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_tsconfig
Optional
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_dev
Optional
disable_tsconfig_dev: bool
- Type: bool
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
docgen: bool
- Type: bool
- Default: false
Docgen by Typedoc.
docs_directory
Optional
docs_directory: str
- Type: str
- Default: "docs"
Docs directory.
entrypoint
Optional
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_types
Optional
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.
eslint
Optional
eslint: bool
- Type: bool
- Default: true
Setup eslint.
eslint_options
Optional
eslint_options: EslintOptions
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
gitpod
Optional
gitpod: bool
- Type: bool
- Default: false
Add a Gitpod development environment.
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
jest_options: JestOptions
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
libdir
Optional
libdir: str
- Type: str
- Default: "lib"
Typescript artifacts output directory.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
major_version
Optional
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_version
Optional
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_version
Optional
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_version
Optional
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.
name
Optional
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_dist_tag
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
outdir
Optional
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
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
post_build_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
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_command
Optional
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_credentials
Optional
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_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
projenrc_js_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenrc_ts
Optional
projenrc_ts: bool
- Type: bool
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrc_ts_options
Optional
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_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
releasable_commits
Optional
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
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_npm
Optional
release_to_npm: bool
- Type: bool
- Default: false
Automatically release to npm when new versions are introduced.
release_trigger
Optional
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_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
repository
Optional
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_directory
Optional
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_code
Optional
sample_code: bool
- Type: bool
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
scoped_packages_options
Optional
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()
orpackage.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.
srcdir
Optional
srcdir: str
- Type: str
- Default: "src"
Typescript sources directory.
stability
Optional
stability: str
- Type: str
Package's Stability.
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
testdir
Optional
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.
tsconfig
Optional
tsconfig: TypescriptConfigOptions
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfig_dev
Optional
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_file
Optional
tsconfig_dev_file: str
- Type: str
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
ts_jest_options
Optional
ts_jest_options: TsJestOptions
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescript_version
Optional
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_options
Optional
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.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
workflow_bootstrap_steps
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_git_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
yarn_berry_options
Optional
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_options
Required
type_spec_options: TypeSpecModelOptions
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
dev_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
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_credentials
Optional
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.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
allow_library_dependencies
Optional
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_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_detect_bin
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
bundled_deps
Optional
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_options
Optional
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
deps
Optional
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' ]
description
Optional
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_deps
Optional
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' ]
entrypoint
Optional
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
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
max_node_version
Optional
max_node_version: str
- Type: str
- Default: no max
Minimum node.js version to require via engines
(inclusive).
min_node_version
Optional
min_node_version: str
- Type: str
- Default: no "engines" specified
Minimum Node.js version to require via package.json engines
(inclusive).
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
repository
Optional
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_directory
Optional
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_options
Optional
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()
orpackage.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.
stability
Optional
stability: str
- Type: str
Package's Stability.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
major_version
Optional
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_version
Optional
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_tag
Optional
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_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_commits
Optional
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_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_trigger
Optional
release_trigger: ReleaseTrigger
- Type: projen.release.ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous()
)
The release trigger to use.
release_workflow_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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_options
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
default_release_branch
Required
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
artifacts_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
auto_approve_upgrades
Optional
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_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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_cov
Optional
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_secret
Optional
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
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
package
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
prettier_options: PrettierOptions
- Type: projen.javascript.PrettierOptions
- Default: default options
Prettier options.
projen_dev_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projen_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
pull_request_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
release
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_to_npm
Optional
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_steps
Optional
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_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
type_spec_options
Required
type_spec_options: TypeSpecModelOptions
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
async_api_spec_file
Required
async_api_spec_file: str
- Type: str
Path to the generated AsyncAPI specification (relative to the project root).
parsed_spec_file
Required
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_options
Required
type_spec_options: TypeSpecModelOptions
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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. |
namespace
Required
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). |
name
Required
name: str
- Type: str
- Default: $BASEDIR
This is the name of your project.
commit_generated
Optional
commit_generated: bool
- Type: bool
- Default: true
Whether to commit the managed files by default.
git_ignore_options
Optional
git_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
git_options
Optional
git_options: GitOptions
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
logging: LoggerOptions
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
parent: Project
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projen_command
Optional
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_json
Optional
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_options
Optional
projenrc_json_options: ProjenrcJsonOptions
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
renovatebot: bool
- Type: bool
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebot_options
Optional
renovatebot_options: RenovatebotOptions
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
auto_approve_options
Optional
auto_approve_options: AutoApproveOptions
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
auto_merge
Optional
auto_merge: bool
- Type: bool
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
auto_merge_options
Optional
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.
clobber
Optional
clobber: bool
- Type: bool
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
dev_container
Optional
dev_container: bool
- Type: bool
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
github: bool
- Type: bool
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
github_options
Optional
github_options: GitHubOptions
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
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_credentials
Optional
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.
readme
Optional
readme: SampleReadmeProps
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
stale: bool
- Type: bool
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
stale_options
Optional
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
.
vscode
Optional
vscode: bool
- Type: bool
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
allow_library_dependencies
Optional
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_email
Optional
author_email: str
- Type: str
Author's e-mail.
author_name
Optional
author_name: str
- Type: str
Author's name.
author_organization
Optional
author_organization: bool
- Type: bool
Is the author an organization.
author_url
Optional
author_url: str
- Type: str
Author's URL / Website.
auto_detect_bin
Optional
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.
bin
Optional
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_email
Optional
bugs_email: str
- Type: str
The email address to which issues should be reported.
bugs_url
Optional
bugs_url: str
- Type: str
The url to your project's issue tracker.
bundled_deps
Optional
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_options
Optional
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
deps
Optional
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' ]
description
Optional
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_deps
Optional
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' ]
entrypoint
Optional
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
homepage
Optional
homepage: str
- Type: str
Package's Homepage / Website.
keywords
Optional
keywords: typing.List[str]
- Type: typing.List[str]
Keywords to include in package.json
.
license
Optional
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.
licensed
Optional
licensed: bool
- Type: bool
- Default: true
Indicates if a license should be added.
max_node_version
Optional
max_node_version: str
- Type: str
- Default: no max
Minimum node.js version to require via engines
(inclusive).
min_node_version
Optional
min_node_version: str
- Type: str
- Default: no "engines" specified
Minimum Node.js version to require via package.json engines
(inclusive).
npm_access
Optional
npm_access: NpmAccess
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npm_provenance
Optional
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_url
Optional
npm_registry_url: str
- Type: str
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npm_token_secret
Optional
npm_token_secret: str
- Type: str
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
package_manager
Optional
package_manager: NodePackageManager
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
package_name
Optional
package_name: str
- Type: str
- Default: defaults to project name
The "name" in package.json.
peer_dependency_options
Optional
peer_dependency_options: PeerDependencyOptions
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peer_deps
Optional
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_version
Optional
pnpm_version: str
- Type: str
- Default: "7"
The version of PNPM to use if using PNPM as a package manager.
repository
Optional
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_directory
Optional
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_options
Optional
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()
orpackage.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.
stability
Optional
stability: str
- Type: str
Package's Stability.
yarn_berry_options
Optional
yarn_berry_options: YarnBerryOptions
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
jsii_release_version
Optional
jsii_release_version: str
- Type: str
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
major_version
Optional
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_version
Optional
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_tag
Optional
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_steps
Optional
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.
prerelease
Optional
prerelease: str
- Type: str
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publish_dry_run
Optional
publish_dry_run: bool
- Type: bool
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publish_tasks
Optional
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_commits
Optional
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_branches
Optional
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_issue
Optional
release_failure_issue: bool
- Type: bool
- Default: false
Create a github issue on every failed publishing task.
release_failure_issue_label
Optional
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_prefix
Optional
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_trigger
Optional
release_trigger: ReleaseTrigger
- Type: projen.release.ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous()
)
The release trigger to use.
release_workflow_name
Optional
release_workflow_name: str
- Type: str
- Default: "release"
The name of the default release workflow.
release_workflow_setup_steps
Optional
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_options
Optional
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_image
Optional
workflow_container_image: str
- Type: str
- Default: default image
Container image to use for GitHub workflows.
workflow_runs_on
Optional
workflow_runs_on: typing.List[str]
- Type: typing.List[str]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflow_runs_on_group
Optional
workflow_runs_on_group: GroupRunnerOptions
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
default_release_branch
Required
default_release_branch: str
- Type: str
- Default: "main"
The name of the main release branch.
artifacts_directory
Optional
artifacts_directory: str
- Type: str
- Default: "dist"
A directory which will contain build artifacts.
auto_approve_upgrades
Optional
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_workflow
Optional
build_workflow: bool
- Type: bool
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
build_workflow_options
Optional
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_options
Optional
bundler_options: BundlerOptions
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
check_licenses
Optional
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_cov
Optional
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_secret
Optional
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
Optional
copyright_owner: str
- Type: str
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyright_period
Optional
copyright_period: str
- Type: str
- Default: current year
The copyright years to put in the LICENSE file.
dependabot
Optional
dependabot: bool
- Type: bool
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabot_options
Optional
dependabot_options: DependabotOptions
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
deps_upgrade
Optional
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_options
Optional
deps_upgrade_options: UpgradeDependenciesOptions
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
gitignore
Optional
gitignore: typing.List[str]
- Type: typing.List[str]
Additional entries to .gitignore.
jest
Optional
jest: bool
- Type: bool
- Default: true
Setup jest unit tests.
jest_options
Optional
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_enabled
Optional
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_options
Optional
npm_ignore_options: IgnoreFileOptions
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
package
Optional
package: bool
- Type: bool
- Default: true
Defines a package
task that will produce an npm tarball under the artifacts directory (e.g. dist
).
prettier
Optional
prettier: bool
- Type: bool
- Default: false
Setup prettier.
prettier_options
Optional
prettier_options: PrettierOptions
- Type: projen.javascript.PrettierOptions
- Default: default options
Prettier options.
projen_dev_dependency
Optional
projen_dev_dependency: bool
- Type: bool
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrc_js
Optional
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_options
Optional
projenrc_js_options: ProjenrcOptions
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projen_version
Optional
projen_version: str
- Type: str
- Default: Defaults to the latest version.
Version of projen to install.
pull_request_template
Optional
pull_request_template: bool
- Type: bool
- Default: true
Include a GitHub pull request template.
pull_request_template_contents
Optional
pull_request_template_contents: typing.List[str]
- Type: typing.List[str]
- Default: default content
The contents of the pull request template.
release
Optional
release: bool
- Type: bool
- Default: true (false for subprojects)
Add release management to this project.
release_to_npm
Optional
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_steps
Optional
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_identity
Optional
workflow_git_identity: GitIdentity
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflow_node_version
Optional
workflow_node_version: str
- Type: str
- Default: same as
minNodeVersion
The node version to use in GitHub workflows.
workflow_package_cache
Optional
workflow_package_cache: bool
- Type: bool
- Default: false
Enable Node.js package cache in GitHub workflows.
type_spec_options
Required
type_spec_options: TypeSpecModelOptions
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: typing.List[Language]
The languages users have specified for handler projects (if any).
parsed_spec_file
Required
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_options
Required
type_spec_options: TypeSpecModelOptions
- Type: TypeSpecModelOptions
TypeSpec model options.
handler_languages
Optional
handler_languages: typing.List[Language]
- Type: 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_expression
Optional
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_name
Optional
api_name: str
- Type: str
- Default: id of the WebSocketApi construct.
Name for the WebSocket API resource.
description
Optional
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. |
formats
Required
formats: typing.List[WebSocketDocumentationFormat]
- Type: typing.List[WebSocketDocumentationFormat]
Formats for generated documentation.
options
Optional
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. |
languages
Required
languages: typing.List[Language]
- Type: 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.
options
Optional
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. |
language
Required
language: Language
- Type: Language
The language to generate the type-safe CDK infrastructure in.
options
Optional
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. |
libraries
Required
libraries: typing.List[WebSocketLibrary]
- Type: typing.List[WebSocketLibrary]
The libraries to generate.
options
Optional
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_name
Required
api_name: str
- Type: str
Name of the API.
outdir
Required
outdir: str
- Type: str
Directory of the model project.
parsed_spec_file
Required
parsed_spec_file: str
- Type: str
Name of the bundled OpenAPI specification file.
async_api_spec_file
Required
async_api_spec_file: str
- Type: str
File name of the generated async api specification.
openapi
Optional
openapi: OpenApiAsyncModelProject
- Type: OpenApiAsyncModelProject
Reference to the OpenAPI model project.
Will be defined if the model language is OpenAPI
smithy
Optional
smithy: SmithyAsyncModelProject
- Type: SmithyAsyncModelProject
Reference to the Smithy model project.
Will be defined if the model language is Smithy
type_spec
Optional
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. |
path
Required
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. |
languages
Required
languages: typing.List[Language]
- Type: 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.
options
Optional
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_deploy
Optional
auto_deploy: bool
- Type: bool
- Default: false
Whether updates to an API automatically trigger a new deployment.
description
Optional
description: str
- Type: str
- Default: no description
The description for the API stage.
domain_mapping
Optional
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_name
Optional
stage_name: str
- Type: str
The name of the stage.
throttle
Optional
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_type
Required
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
- 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_type
Required
authorization_type: AuthorizationType
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
authorizer_id: str
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
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_id
Required
- Type: str
Unique identifier for this authorizer.
user_pools
Required
- Type: typing.List[aws_cdk.aws_cognito.IUserPool]
The Cognito user pools associated with this authorizer.
authorization_scopes
Optional
- 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.
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_id
Required
- Type: str
Unique identifier for this authorizer.
function
Required
- Type: aws_cdk.aws_lambda.IFunction
The lambda function used to authorize requests.
authorizer_result_ttl_in_seconds
Optional
- Type: typing.Union[int, float]
- Default: 300
The number of seconds during which the authorizer result is cached.
identity_source
Optional
- Type: str
- Default: "method.request.header.Authorization"
The source of the identity in an incoming request.
type
Optional
- Type: CustomAuthorizerType
- Default: CustomAuthorizerType.TOKEN
The type of custom authorizer.
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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_id
Required
- Type: str
Unique identifier for this authorizer.
user_pools
Required
- Type: typing.List[aws_cdk.aws_cognito.IUserPool]
The Cognito user pools associated with this authorizer.
authorization_scopes
Optional
- 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.
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.
authorization_scopes
Required
- 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_type
Required
authorization_type: AuthorizationType
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
authorizer_id: str
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
authorization_scopes: typing.List[str]
- Type: typing.List[str]
Scopes for the authorizer, if any.
user_pools
Required
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_sets
Required
- Type: IntegrationResponseSet
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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_id
Required
- Type: str
Unique identifier for this authorizer.
function
Required
- Type: aws_cdk.aws_lambda.IFunction
The lambda function used to authorize requests.
authorizer_result_ttl_in_seconds
Optional
- Type: typing.Union[int, float]
- Default: 300
The number of seconds during which the authorizer result is cached.
identity_source
Optional
- Type: str
- Default: "method.request.header.Authorization"
The source of the identity in an incoming request.
type
Optional
- Type: CustomAuthorizerType
- Default: CustomAuthorizerType.TOKEN
The type of custom authorizer.
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_type
Required
authorization_type: AuthorizationType
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
authorizer_id: str
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
authorization_scopes: typing.List[str]
- Type: typing.List[str]
Scopes for the authorizer, if any.
authorizer_result_ttl_in_seconds
Required
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.
function
Required
function: IFunction
- Type: aws_cdk.aws_lambda.IFunction
The lambda function used to authorize requests.
identity_source
Required
identity_source: str
- Type: str
The source of the identity in an incoming request.
type
Required
type: CustomAuthorizerType
- Type: CustomAuthorizerType
The type of custom authorizer.
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. |
responses
Optional
- Type: typing.Mapping[ApiGatewayIntegrationResponse]
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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_code
Optional
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_type
Required
authorization_type: AuthorizationType
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
authorizer_id: str
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
api
Required
- Type: aws_cdk.aws_apigateway.SpecRestApi
The api to grant permissions for.
operation_id
Required
- Type: str
The ID of the operation for which permissions are being granted.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_sets
Required
- Type: IntegrationResponseSet
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.
responses
Optional
- Type: typing.Mapping[ApiGatewayIntegrationResponse]
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_code
Optional
- 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_function
Required
- 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_code
Required
- Type: typing.Union[int, float]
HTTP response status code.
body
Optional
- 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.
bucket
Required
- Type: aws_cdk.aws_s3.IBucket
The S3 bucket to be invoked on integration.
integration_response_set
Optional
- Type: IntegrationResponseSet
- Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()
Override the integration response set for the S3 integration.
method
Optional
- Type: str
- Default: integration method is used
The HTTP method to use when invoking the S3 bucket.
path
Optional
- 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_function
Required
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
api
Required
- Type: aws_cdk.aws_apigateway.SpecRestApi
The api to grant permissions for.
operation_id
Required
- Type: str
The ID of the operation for which permissions are being granted.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_code
Required
- Type: typing.Union[int, float]
HTTP response status code.
body
Optional
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
api
Required
- Type: aws_cdk.aws_apigateway.SpecRestApi
The api to grant permissions for.
operation_id
Required
- Type: str
The ID of the operation for which permissions are being granted.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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_type
Required
authorization_type: AuthorizationType
- Type: aws_cdk.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizer_id
Required
authorizer_id: str
- Type: str
The unique identifier for the authorizer.
authorization_scopes
Optional
authorization_scopes: typing.List[str]
- Type: typing.List[str]
Scopes for the authorizer, if any.
S3Integration
An S3 integration.
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. |
bucket
Required
- Type: aws_cdk.aws_s3.IBucket
The S3 bucket to be invoked on integration.
integration_response_set
Optional
- Type: IntegrationResponseSet
- Default: a combination of IntegrationResponseSets.defaultPassthrough() and IntegrationResponseSets.s3JsonErrorMessage()
Override the integration response set for the S3 integration.
method
Optional
- Type: str
- Default: integration method is used
The HTTP method to use when invoking the S3 bucket.
path
Optional
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
api
Required
- Type: aws_cdk.aws_apigateway.SpecRestApi
The api to grant permissions for.
operation_id
Required
- Type: str
The ID of the operation for which permissions are being granted.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- 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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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.
method
Required
- Type: str
The http method of this operation.
path
Required
- Type: str
The path of this operation in the api.
content_types
Optional
- Type: typing.List[str]
- Default: application/json
Content types accepted by this operation.
operation_id
Required
- Type: str
The ID of the operation being rendered.
operation_lookup
Required
- Type: typing.Mapping[OperationDetails]
Details about all operations in the API.
scope
Required
- Type: constructs.Construct
The scope in which the integration is being rendered.
cors_options
Optional
- Type: SerializedCorsOptions
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.
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.
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.
OPENAPI
OpenAPI.
TYPESPEC
TypeSpec.
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.
MARKDOWN
Markdown Documentation generated by AsyncAPI's Markdown Template.
WebSocketLibrary
Members
Name | Description |
---|---|
TYPESCRIPT_WEBSOCKET_CLIENT |
No description. |
TYPESCRIPT_WEBSOCKET_HOOKS |
No description. |