Skip to content

API Reference

Constructs

OpenApiAsyncDefinition

The OpenAPI Spec.

Initializers

import software.aws.pdk.type_safe_api.OpenApiAsyncDefinition;

OpenApiAsyncDefinition.Builder.create(Project project)
    .openApiOptions(OpenApiModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).

projectRequired
  • Type: io.github.cdklabs.projen.Project

openApiOptionsRequired

Options for the openapi model.


handlerLanguagesOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.OpenApiAsyncDefinition;

OpenApiAsyncDefinition.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.OpenApiAsyncDefinition;

OpenApiAsyncDefinition.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.
openApiSpecificationPath java.lang.String Path to the root OpenAPI specification file.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

openApiSpecificationPathRequired
public java.lang.String getOpenApiSpecificationPath();
  • Type: java.lang.String

Path to the root OpenAPI specification file.


OpenApiAsyncModelProject

Project for defining an OpenAPI model for a WebSocket API.

Initializers

import software.aws.pdk.type_safe_api.OpenApiAsyncModelProject;

OpenApiAsyncModelProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .openApiOptions(OpenApiModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .parsedSpecFile(java.lang.String)
    .asyncApiSpecFile(java.lang.String)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).
asyncApiSpecFile java.lang.String Path to the generated AsyncAPI specification (relative to the project root).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


openApiOptionsRequired

Options for the openapi model.


handlerLanguagesOptional

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


parsedSpecFileRequired
  • Type: java.lang.String

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


asyncApiSpecFileRequired
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.OpenApiAsyncModelProject;

OpenApiAsyncModelProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.OpenApiAsyncModelProject;

OpenApiAsyncModelProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.OpenApiAsyncModelProject;

OpenApiAsyncModelProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


apiNameRequired
public java.lang.String getApiName();
  • Type: java.lang.String

Name of the API.


definitionRequired
public OpenApiAsyncDefinition getDefinition();

OpenAPI specification component.


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


OpenApiDefinition

The OpenAPI Spec.

Initializers

import software.aws.pdk.type_safe_api.OpenApiDefinition;

OpenApiDefinition.Builder.create(Project project)
    .openApiOptions(OpenApiModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).

projectRequired
  • Type: io.github.cdklabs.projen.Project

openApiOptionsRequired

Options for the openapi model.


handlerLanguagesOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.OpenApiDefinition;

OpenApiDefinition.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.OpenApiDefinition;

OpenApiDefinition.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.
openApiSpecificationPath java.lang.String Path to the root OpenAPI specification file.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

openApiSpecificationPathRequired
public java.lang.String getOpenApiSpecificationPath();
  • Type: java.lang.String

Path to the root OpenAPI specification file.


OpenApiModelProject

Project for defining an OpenAPI model for a REST API.

Initializers

import software.aws.pdk.type_safe_api.OpenApiModelProject;

OpenApiModelProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .openApiOptions(OpenApiModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .parsedSpecFile(java.lang.String)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


openApiOptionsRequired

Options for the openapi model.


handlerLanguagesOptional

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


parsedSpecFileRequired
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.OpenApiModelProject;

OpenApiModelProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.OpenApiModelProject;

OpenApiModelProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.OpenApiModelProject;

OpenApiModelProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


apiNameRequired
public java.lang.String getApiName();
  • Type: java.lang.String

Name of the API.


definitionRequired
public OpenApiDefinition getDefinition();

OpenAPI specification component.


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


OpenApiProjectDefinition

The OpenAPI Spec.

Initializers

import software.aws.pdk.type_safe_api.OpenApiProjectDefinition;

OpenApiProjectDefinition.Builder.create(Project project)
    .openApiOptions(OpenApiModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
openApiOptions OpenApiModelOptions Options for the openapi model.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).

projectRequired
  • Type: io.github.cdklabs.projen.Project

openApiOptionsRequired

Options for the openapi model.


handlerLanguagesOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.OpenApiProjectDefinition;

OpenApiProjectDefinition.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.OpenApiProjectDefinition;

OpenApiProjectDefinition.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.
openApiSpecificationPath java.lang.String Path to the root OpenAPI specification file.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

openApiSpecificationPathRequired
public java.lang.String getOpenApiSpecificationPath();
  • Type: java.lang.String

Path to the root OpenAPI specification file.


SmithyAsyncModelProject

Smithy model project for a WebSocket API.

Initializers

import software.aws.pdk.type_safe_api.SmithyAsyncModelProject;

SmithyAsyncModelProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .smithyOptions(SmithyModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .parsedSpecFile(java.lang.String)
    .asyncApiSpecFile(java.lang.String)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
smithyOptions SmithyModelOptions Smithy engine options.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).
asyncApiSpecFile java.lang.String Path to the generated AsyncAPI specification (relative to the project root).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


smithyOptionsRequired

Smithy engine options.


handlerLanguagesOptional

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


parsedSpecFileRequired
  • Type: java.lang.String

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


asyncApiSpecFileRequired
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


addSmithyDeps
public void addSmithyDeps(SmithyBaseProject deps)

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public SmithyProjectDefinition smithyProjectDefinition()

Returns the smithy project definition.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SmithyAsyncModelProject;

SmithyAsyncModelProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.SmithyAsyncModelProject;

SmithyAsyncModelProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.SmithyAsyncModelProject;

SmithyAsyncModelProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


apiNameRequired
public java.lang.String getApiName();
  • Type: java.lang.String

Name of the API.


definitionRequired
public SmithyServiceProjectDefinition getDefinition();

Smithy model and build settings.


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


SmithyBaseProject

Base project for Smithy projects.

Initializers

import software.aws.pdk.type_safe_api.SmithyBaseProject;

SmithyBaseProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


addSmithyDeps
public void addSmithyDeps(SmithyBaseProject deps)

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public SmithyProjectDefinition smithyProjectDefinition()

Returns the smithy project definition.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SmithyBaseProject;

SmithyBaseProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.SmithyBaseProject;

SmithyBaseProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.SmithyBaseProject;

SmithyBaseProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


SmithyModelProject

Smithy model project for a REST API.

Initializers

import software.aws.pdk.type_safe_api.SmithyModelProject;

SmithyModelProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .smithyOptions(SmithyModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .parsedSpecFile(java.lang.String)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
smithyOptions SmithyModelOptions Smithy engine options.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


smithyOptionsRequired

Smithy engine options.


handlerLanguagesOptional

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


parsedSpecFileRequired
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


addSmithyDeps
public void addSmithyDeps(SmithyBaseProject deps)

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public SmithyProjectDefinition smithyProjectDefinition()

Returns the smithy project definition.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SmithyModelProject;

SmithyModelProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.SmithyModelProject;

SmithyModelProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.SmithyModelProject;

SmithyModelProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


apiNameRequired
public java.lang.String getApiName();
  • Type: java.lang.String

Name of the API.


definitionRequired
public SmithyServiceProjectDefinition getDefinition();

Smithy model and build settings.


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


SmithyProjectDefinition

Definition for a Smithy project.

Initializers

import software.aws.pdk.type_safe_api.SmithyProjectDefinition;

SmithyProjectDefinition.Builder.create(Project project)
//  .ignoreGradleWrapper(java.lang.Boolean)
//  .ignoreSmithyBuildOutput(java.lang.Boolean)
//  .smithyBuildOptions(SmithyBuildOptions)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
ignoreGradleWrapper java.lang.Boolean Set to false if you would like to check in your gradle wrapper.
ignoreSmithyBuildOutput java.lang.Boolean Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.
smithyBuildOptions SmithyBuildOptions Smithy build options.

projectRequired
  • Type: io.github.cdklabs.projen.Project

ignoreGradleWrapperOptional
  • Type: java.lang.Boolean
  • Default: true

Set to false if you would like to check in your gradle wrapper.

Do so if you would like to use a different version of gradle to the one provided by default


ignoreSmithyBuildOutputOptional
  • Type: java.lang.Boolean
  • Default: true

Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.


smithyBuildOptionsOptional

Smithy build options.


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

addDeps
public void addDeps(java.lang.String deps)

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

depsRequired
  • Type: java.lang.String

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


addSmithyDeps
public void addSmithyDeps(SmithyProjectDefinition deps)

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

depsRequired

smithy definitions to depend on.


addSources
public void addSources(java.lang.String sources)

Add additional paths to model source files or directories.

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

sourcesRequired
  • Type: java.lang.String

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SmithyProjectDefinition;

SmithyProjectDefinition.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.SmithyProjectDefinition;

SmithyProjectDefinition.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.
gradleProjectName java.lang.String Name of the gradle project.
modelDir java.lang.String Directory of model source code.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

gradleProjectNameRequired
public java.lang.String getGradleProjectName();
  • Type: java.lang.String

Name of the gradle project.


modelDirRequired
public java.lang.String getModelDir();
  • Type: java.lang.String

Directory of model source code.


SmithyServiceProjectDefinition

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

Initializers

import software.aws.pdk.type_safe_api.SmithyServiceProjectDefinition;

SmithyServiceProjectDefinition.Builder.create(Project project)
    .smithyOptions(SmithyModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
smithyOptions SmithyModelOptions Smithy engine options.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).

projectRequired
  • Type: io.github.cdklabs.projen.Project

smithyOptionsRequired

Smithy engine options.


handlerLanguagesOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

addDeps
public void addDeps(java.lang.String deps)

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

depsRequired
  • Type: java.lang.String

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


addSmithyDeps
public void addSmithyDeps(SmithyProjectDefinition deps)

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

depsRequired

smithy definitions to depend on.


addSources
public void addSources(java.lang.String sources)

Add additional paths to model source files or directories.

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

sourcesRequired
  • Type: java.lang.String

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SmithyServiceProjectDefinition;

SmithyServiceProjectDefinition.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.SmithyServiceProjectDefinition;

SmithyServiceProjectDefinition.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

gradleProjectNameRequired
public java.lang.String getGradleProjectName();
  • Type: java.lang.String

Name of the gradle project.


modelDirRequired
public java.lang.String getModelDir();
  • Type: java.lang.String

Directory of model source code.


generatedModelDirRequired
public java.lang.String getGeneratedModelDir();
  • Type: java.lang.String

Directory of generated model source code.


openApiSpecificationPathRequired
public java.lang.String getOpenApiSpecificationPath();
  • Type: java.lang.String

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


smithyJsonModelPathRequired
public java.lang.String getSmithyJsonModelPath();
  • Type: java.lang.String

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


SmithyShapeLibraryProject

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

Initializers

import software.aws.pdk.type_safe_api.SmithyShapeLibraryProject;

SmithyShapeLibraryProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
//  .ignoreGradleWrapper(java.lang.Boolean)
//  .ignoreSmithyBuildOutput(java.lang.Boolean)
//  .smithyBuildOptions(SmithyBuildOptions)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
ignoreGradleWrapper java.lang.Boolean Set to false if you would like to check in your gradle wrapper.
ignoreSmithyBuildOutput java.lang.Boolean Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.
smithyBuildOptions SmithyBuildOptions Smithy build options.

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


ignoreGradleWrapperOptional
  • Type: java.lang.Boolean
  • Default: true

Set to false if you would like to check in your gradle wrapper.

Do so if you would like to use a different version of gradle to the one provided by default


ignoreSmithyBuildOutputOptional
  • Type: java.lang.Boolean
  • Default: true

Set to false if you would like to check in your smithy build output or have more fine-grained control over what is checked in, eg if you add other projections to the smithy-build.json file.


smithyBuildOptionsOptional

Smithy build options.


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


addSmithyDeps
public void addSmithyDeps(SmithyBaseProject deps)

Add a dependency on other smithy projects.

depsRequired

smithyProjectDefinition
public SmithyProjectDefinition smithyProjectDefinition()

Returns the smithy project definition.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SmithyShapeLibraryProject;

SmithyShapeLibraryProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.SmithyShapeLibraryProject;

SmithyShapeLibraryProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.SmithyShapeLibraryProject;

SmithyShapeLibraryProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


definitionRequired
public SmithyProjectDefinition getDefinition();

Smithy model and build settings.


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


SnapStartFunction

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

Initializers

import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.Builder.create(Construct scope, java.lang.String id)
//  .maxEventAge(Duration)
//  .onFailure(IDestination)
//  .onSuccess(IDestination)
//  .retryAttempts(java.lang.Number)
//  .adotInstrumentation(AdotInstrumentationConfig)
//  .allowAllIpv6Outbound(java.lang.Boolean)
//  .allowAllOutbound(java.lang.Boolean)
//  .allowPublicSubnet(java.lang.Boolean)
//  .applicationLogLevel(java.lang.String)
//  .applicationLogLevelV2(ApplicationLogLevel)
//  .architecture(Architecture)
//  .codeSigningConfig(ICodeSigningConfig)
//  .currentVersionOptions(VersionOptions)
//  .deadLetterQueue(IQueue)
//  .deadLetterQueueEnabled(java.lang.Boolean)
//  .deadLetterTopic(ITopic)
//  .description(java.lang.String)
//  .environment(java.util.Map<java.lang.String, java.lang.String>)
//  .environmentEncryption(IKey)
//  .ephemeralStorageSize(Size)
//  .events(java.util.List<IEventSource>)
//  .filesystem(FileSystem)
//  .functionName(java.lang.String)
//  .initialPolicy(java.util.List<PolicyStatement>)
//  .insightsVersion(LambdaInsightsVersion)
//  .ipv6AllowedForDualStack(java.lang.Boolean)
//  .layers(java.util.List<ILayerVersion>)
//  .logFormat(java.lang.String)
//  .loggingFormat(LoggingFormat)
//  .logGroup(ILogGroup)
//  .logRetention(RetentionDays)
//  .logRetentionRetryOptions(LogRetentionRetryOptions)
//  .logRetentionRole(IRole)
//  .memorySize(java.lang.Number)
//  .paramsAndSecrets(ParamsAndSecretsLayerVersion)
//  .profiling(java.lang.Boolean)
//  .profilingGroup(IProfilingGroup)
//  .recursiveLoop(RecursiveLoop)
//  .reservedConcurrentExecutions(java.lang.Number)
//  .role(IRole)
//  .runtimeManagementMode(RuntimeManagementMode)
//  .securityGroups(java.util.List<ISecurityGroup>)
//  .snapStart(SnapStartConf)
//  .systemLogLevel(java.lang.String)
//  .systemLogLevelV2(SystemLogLevel)
//  .timeout(Duration)
//  .tracing(Tracing)
//  .vpc(IVpc)
//  .vpcSubnets(SubnetSelection)
    .code(Code)
    .handler(java.lang.String)
    .runtime(Runtime)
//  .disableSnapStart(java.lang.Boolean)
    .build();
Name Type Description
scope software.constructs.Construct No description.
id java.lang.String No description.
maxEventAge software.amazon.awscdk.Duration The maximum age of a request that Lambda sends to a function for processing.
onFailure software.amazon.awscdk.services.lambda.IDestination The destination for failed invocations.
onSuccess software.amazon.awscdk.services.lambda.IDestination The destination for successful invocations.
retryAttempts java.lang.Number The maximum number of times to retry when the function returns an error.
adotInstrumentation software.amazon.awscdk.services.lambda.AdotInstrumentationConfig Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
allowAllIpv6Outbound java.lang.Boolean Whether to allow the Lambda to send all ipv6 network traffic.
allowAllOutbound java.lang.Boolean Whether to allow the Lambda to send all network traffic (except ipv6).
allowPublicSubnet java.lang.Boolean Lambda Functions in a public subnet can NOT access the internet.
applicationLogLevel java.lang.String Sets the application log level for the function.
applicationLogLevelV2 software.amazon.awscdk.services.lambda.ApplicationLogLevel Sets the application log level for the function.
architecture software.amazon.awscdk.services.lambda.Architecture The system architectures compatible with this lambda function.
codeSigningConfig software.amazon.awscdk.services.lambda.ICodeSigningConfig Code signing config associated with this function.
currentVersionOptions software.amazon.awscdk.services.lambda.VersionOptions Options for the lambda.Version resource automatically created by the fn.currentVersion method.
deadLetterQueue software.amazon.awscdk.services.sqs.IQueue The SQS queue to use if DLQ is enabled.
deadLetterQueueEnabled java.lang.Boolean Enabled DLQ.
deadLetterTopic software.amazon.awscdk.services.sns.ITopic The SNS topic to use as a DLQ.
description java.lang.String A description of the function.
environment java.util.Map Key-value pairs that Lambda caches and makes available for your Lambda functions.
environmentEncryption software.amazon.awscdk.services.kms.IKey The AWS KMS key that's used to encrypt your function's environment variables.
ephemeralStorageSize software.amazon.awscdk.Size The size of the function’s /tmp directory in MiB.
events java.util.List Event sources for this function.
filesystem software.amazon.awscdk.services.lambda.FileSystem The filesystem configuration for the lambda function.
functionName java.lang.String A name for the function.
initialPolicy java.util.List Initial policy statements to add to the created Lambda Role.
insightsVersion software.amazon.awscdk.services.lambda.LambdaInsightsVersion Specify the version of CloudWatch Lambda insights to use for monitoring.
ipv6AllowedForDualStack java.lang.Boolean Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
layers java.util.List A list of layers to add to the function's execution environment.
logFormat java.lang.String Sets the logFormat for the function.
loggingFormat software.amazon.awscdk.services.lambda.LoggingFormat Sets the loggingFormat for the function.
logGroup software.amazon.awscdk.services.logs.ILogGroup The log group the function sends logs to.
logRetention software.amazon.awscdk.services.logs.RetentionDays The number of days log events are kept in CloudWatch Logs.
logRetentionRetryOptions software.amazon.awscdk.services.lambda.LogRetentionRetryOptions When log retention is specified, a custom resource attempts to create the CloudWatch log group.
logRetentionRole software.amazon.awscdk.services.iam.IRole The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
memorySize java.lang.Number The amount of memory, in MB, that is allocated to your Lambda function.
paramsAndSecrets software.amazon.awscdk.services.lambda.ParamsAndSecretsLayerVersion Specify the configuration of Parameters and Secrets Extension.
profiling java.lang.Boolean Enable profiling.
profilingGroup software.amazon.awscdk.services.codeguruprofiler.IProfilingGroup Profiling Group.
recursiveLoop software.amazon.awscdk.services.lambda.RecursiveLoop Sets the Recursive Loop Protection for Lambda Function.
reservedConcurrentExecutions java.lang.Number The maximum of concurrent executions you want to reserve for the function.
role software.amazon.awscdk.services.iam.IRole Lambda execution role.
runtimeManagementMode software.amazon.awscdk.services.lambda.RuntimeManagementMode Sets the runtime management configuration for a function's version.
securityGroups java.util.List The list of security groups to associate with the Lambda's network interfaces.
snapStart software.amazon.awscdk.services.lambda.SnapStartConf Enable SnapStart for Lambda Function.
systemLogLevel java.lang.String Sets the system log level for the function.
systemLogLevelV2 software.amazon.awscdk.services.lambda.SystemLogLevel Sets the system log level for the function.
timeout software.amazon.awscdk.Duration The function execution time (in seconds) after which Lambda terminates the function.
tracing software.amazon.awscdk.services.lambda.Tracing Enable AWS X-Ray Tracing for Lambda Function.
vpc software.amazon.awscdk.services.ec2.IVpc VPC network to place Lambda network interfaces.
vpcSubnets software.amazon.awscdk.services.ec2.SubnetSelection Where to place the network interfaces within the VPC.
code software.amazon.awscdk.services.lambda.Code The source code of your Lambda function.
handler java.lang.String The name of the method within your code that Lambda calls to execute your function.
runtime software.amazon.awscdk.services.lambda.Runtime The runtime environment for the Lambda function that you are uploading.
disableSnapStart java.lang.Boolean When true, disable snap start.

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

maxEventAgeOptional
  • Type: software.amazon.awscdk.Duration
  • Default: Duration.hours(6)

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

Minimum: 60 seconds Maximum: 6 hours


onFailureOptional
  • Type: software.amazon.awscdk.services.lambda.IDestination
  • Default: no destination

The destination for failed invocations.


onSuccessOptional
  • Type: software.amazon.awscdk.services.lambda.IDestination
  • Default: no destination

The destination for successful invocations.


retryAttemptsOptional
  • Type: java.lang.Number
  • Default: 2

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

Minimum: 0 Maximum: 2


adotInstrumentationOptional
  • Type: software.amazon.awscdk.services.lambda.AdotInstrumentationConfig
  • Default: No ADOT instrumentation

Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.

https://aws-otel.github.io/docs/getting-started/lambda


allowAllIpv6OutboundOptional
  • Type: java.lang.Boolean
  • Default: false

Whether to allow the Lambda to send all ipv6 network traffic.

If set to true, there will only be a single egress rule which allows all outbound ipv6 traffic. If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets using ipv6.

Do not specify this property if the securityGroups or securityGroup property is set. Instead, configure allowAllIpv6Outbound directly on the security group.


allowAllOutboundOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to allow the Lambda to send all network traffic (except ipv6).

If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.

Do not specify this property if the securityGroups or securityGroup property is set. Instead, configure allowAllOutbound directly on the security group.


allowPublicSubnetOptional
  • Type: java.lang.Boolean
  • Default: false

Lambda Functions in a public subnet can NOT access the internet.

Use this property to acknowledge this limitation and still place the function in a public subnet.

https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841


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

  • Type: java.lang.String

  • Default: "INFO"

Sets the application log level for the function.


applicationLogLevelV2Optional
  • Type: software.amazon.awscdk.services.lambda.ApplicationLogLevel
  • Default: ApplicationLogLevel.INFO

Sets the application log level for the function.


architectureOptional
  • Type: software.amazon.awscdk.services.lambda.Architecture
  • Default: Architecture.X86_64

The system architectures compatible with this lambda function.


codeSigningConfigOptional
  • Type: software.amazon.awscdk.services.lambda.ICodeSigningConfig
  • Default: Not Sign the Code

Code signing config associated with this function.


currentVersionOptionsOptional
  • Type: software.amazon.awscdk.services.lambda.VersionOptions
  • Default: default options as described in VersionOptions

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


deadLetterQueueOptional
  • Type: software.amazon.awscdk.services.sqs.IQueue
  • Default: SQS queue with 14 day retention period if deadLetterQueueEnabled is true

The SQS queue to use if DLQ is enabled.

If SNS topic is desired, specify deadLetterTopic property instead.


deadLetterQueueEnabledOptional
  • Type: java.lang.Boolean
  • Default: false unless deadLetterQueue is set, which implies DLQ is enabled.

Enabled DLQ.

If deadLetterQueue is undefined, an SQS queue with default options will be defined for your Function.


deadLetterTopicOptional
  • Type: software.amazon.awscdk.services.sns.ITopic
  • Default: no SNS topic

The SNS topic to use as a DLQ.

Note that if deadLetterQueueEnabled is set to true, an SQS queue will be created rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.


descriptionOptional
  • Type: java.lang.String
  • Default: No description.

A description of the function.


environmentOptional
  • Type: java.util.Map
  • Default: No environment variables.

Key-value pairs that Lambda caches and makes available for your Lambda functions.

Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code.


environmentEncryptionOptional
  • Type: software.amazon.awscdk.services.kms.IKey
  • Default: AWS Lambda creates and uses an AWS managed customer master key (CMK).

The AWS KMS key that's used to encrypt your function's environment variables.


ephemeralStorageSizeOptional
  • Type: software.amazon.awscdk.Size
  • Default: 512 MiB

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


eventsOptional
  • Type: java.util.List
  • Default: No event sources.

Event sources for this function.

You can also add event sources using addEventSource.


filesystemOptional
  • Type: software.amazon.awscdk.services.lambda.FileSystem
  • Default: will not mount any filesystem

The filesystem configuration for the lambda function.


functionNameOptional
  • Type: java.lang.String
  • Default: AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.

A name for the function.


initialPolicyOptional
  • Type: java.util.List
  • Default: No policy statements are added to the created Lambda role.

Initial policy statements to add to the created Lambda Role.

You can call addToRolePolicy to the created lambda to add statements post creation.


insightsVersionOptional
  • Type: software.amazon.awscdk.services.lambda.LambdaInsightsVersion
  • Default: No Lambda Insights

Specify the version of CloudWatch Lambda insights to use for monitoring.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html


ipv6AllowedForDualStackOptional
  • Type: java.lang.Boolean
  • Default: false

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

Only used if 'vpc' is supplied.


layersOptional
  • Type: java.util.List
  • Default: No layers.

A list of layers to add to the function's execution environment.

You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions.


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

  • Type: java.lang.String

  • Default: "Text"

Sets the logFormat for the function.


loggingFormatOptional
  • Type: software.amazon.awscdk.services.lambda.LoggingFormat
  • Default: LoggingFormat.TEXT

Sets the loggingFormat for the function.


logGroupOptional
  • Type: software.amazon.awscdk.services.logs.ILogGroup
  • Default: /aws/lambda/${this.functionName} - default log group created by Lambda

The log group the function sends logs to.

By default, Lambda functions send logs to an automatically created default log group named /aws/lambda/\<function name>. However you cannot change the properties of this auto-created log group using the AWS CDK, e.g. you cannot set a different log retention.

Use the logGroup property to create a fully customizable LogGroup ahead of time, and instruct the Lambda function to send logs to it.

Providing a user-controlled log group was rolled out to commercial regions on 2023-11-16. If you are deploying to another type of region, please check regional availability first.


logRetentionOptional
  • Type: software.amazon.awscdk.services.logs.RetentionDays
  • Default: logs.RetentionDays.INFINITE

The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.

This is a legacy API and we strongly recommend you move away from it if you can. Instead create a fully customizable log group with logs.LogGroup and use the logGroup property to instruct the Lambda function to send logs to it. Migrating from logRetention to logGroup will cause the name of the log group to change. Users and code and referencing the name verbatim will have to adjust.

In AWS CDK code, you can access the log group name directly from the LogGroup construct:

import * as logs from 'aws-cdk-lib/aws-logs';

declare const myLogGroup: logs.LogGroup;
myLogGroup.logGroupName;


logRetentionRetryOptionsOptional
  • Type: software.amazon.awscdk.services.lambda.LogRetentionRetryOptions
  • Default: Default AWS SDK retry options.

When log retention is specified, a custom resource attempts to create the CloudWatch log group.

These options control the retry policy when interacting with CloudWatch APIs.

This is a legacy API and we strongly recommend you migrate to logGroup if you can. logGroup allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.


logRetentionRoleOptional
  • Type: software.amazon.awscdk.services.iam.IRole
  • Default: A new role is created.

The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

This is a legacy API and we strongly recommend you migrate to logGroup if you can. logGroup allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.


memorySizeOptional
  • Type: java.lang.Number
  • Default: 128

The amount of memory, in MB, that is allocated to your Lambda function.

Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide.


paramsAndSecretsOptional
  • Type: software.amazon.awscdk.services.lambda.ParamsAndSecretsLayerVersion
  • Default: No Parameters and Secrets Extension

Specify the configuration of Parameters and Secrets Extension.

https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html


profilingOptional
  • Type: java.lang.Boolean
  • Default: No profiling.

Enable profiling.

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


profilingGroupOptional
  • Type: software.amazon.awscdk.services.codeguruprofiler.IProfilingGroup
  • Default: A new profiling group will be created if profiling is set.

Profiling Group.

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


recursiveLoopOptional
  • Type: software.amazon.awscdk.services.lambda.RecursiveLoop
  • Default: RecursiveLoop.Terminate

Sets the Recursive Loop Protection for Lambda Function.

It lets Lambda detect and terminate unintended recusrive loops.


reservedConcurrentExecutionsOptional
  • Type: java.lang.Number
  • Default: No specific limit - account limit.

The maximum of concurrent executions you want to reserve for the function.

https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html


roleOptional
  • Type: software.amazon.awscdk.services.iam.IRole
  • Default: A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling addToRolePolicy.

Lambda execution role.

This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal.

The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself.

The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole".


runtimeManagementModeOptional
  • Type: software.amazon.awscdk.services.lambda.RuntimeManagementMode
  • Default: Auto

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


securityGroupsOptional
  • Type: java.util.List
  • Default: If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.

The list of security groups to associate with the Lambda's network interfaces.

Only used if 'vpc' is supplied.


snapStartOptional
  • Type: software.amazon.awscdk.services.lambda.SnapStartConf
  • Default: No snapstart

Enable SnapStart for Lambda Function.

SnapStart is currently supported only for Java 11, 17 runtime


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

  • Type: java.lang.String

  • Default: "INFO"

Sets the system log level for the function.


systemLogLevelV2Optional
  • Type: software.amazon.awscdk.services.lambda.SystemLogLevel
  • Default: SystemLogLevel.INFO

Sets the system log level for the function.


timeoutOptional
  • Type: software.amazon.awscdk.Duration
  • Default: Duration.seconds(3)

The function execution time (in seconds) after which Lambda terminates the function.

Because the execution time affects cost, set this value based on the function's expected execution time.


tracingOptional
  • Type: software.amazon.awscdk.services.lambda.Tracing
  • Default: Tracing.Disabled

Enable AWS X-Ray Tracing for Lambda Function.


vpcOptional
  • Type: software.amazon.awscdk.services.ec2.IVpc
  • Default: Function is not placed within a VPC.

VPC network to place Lambda network interfaces.

Specify this if the Lambda function needs to access resources in a VPC. This is required when vpcSubnets is specified.


vpcSubnetsOptional
  • Type: software.amazon.awscdk.services.ec2.SubnetSelection
  • Default: the Vpc default strategy if not specified

Where to place the network interfaces within the VPC.

This requires vpc to be specified in order for interfaces to actually be placed in the subnets. If vpc is not specify, this will raise an error.

Note: Internet access for Lambda Functions requires a NAT Gateway, so picking public subnets is not allowed (unless allowPublicSubnet is set to true).


codeRequired
  • Type: software.amazon.awscdk.services.lambda.Code

The source code of your Lambda function.

You can point to a file in an Amazon Simple Storage Service (Amazon S3) bucket or specify your source code as inline text.


handlerRequired
  • Type: java.lang.String

The name of the method within your code that Lambda calls to execute your function.

The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html.

Use Handler.FROM_IMAGE when defining a function from a Docker image.

NOTE: If you specify your source code as inline text by specifying the ZipFile property within the Code property, specify index.function_name as the handler.


runtimeRequired
  • Type: software.amazon.awscdk.services.lambda.Runtime

The runtime environment for the Lambda function that you are uploading.

For valid values, see the Runtime property in the AWS Lambda Developer Guide.

Use Runtime.FROM_IMAGE when defining a function from a Docker image.


disableSnapStartOptional
  • Type: java.lang.Boolean
  • Default: false

When true, disable snap start.


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)

Apply the given removal policy to this resource.

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

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

policyRequired
  • Type: software.amazon.awscdk.RemovalPolicy

addEventSource
public void addEventSource(IEventSource source)

Adds an event source to this function.

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

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

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

sourceRequired
  • Type: software.amazon.awscdk.services.lambda.IEventSource

addEventSourceMapping
public EventSourceMapping addEventSourceMapping(java.lang.String id, EventSourceMappingOptions options)

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

idRequired
  • Type: java.lang.String

optionsRequired
  • Type: software.amazon.awscdk.services.lambda.EventSourceMappingOptions

addFunctionUrl
public FunctionUrl addFunctionUrl()
public FunctionUrl addFunctionUrl(FunctionUrlOptions options)

Adds a url to this lambda function.

optionsOptional
  • Type: software.amazon.awscdk.services.lambda.FunctionUrlOptions

addPermission
public void addPermission(java.lang.String id, Permission permission)

Adds a permission to the Lambda resource policy.

Permission for details.

idRequired
  • Type: java.lang.String

The id for the permission construct.


permissionRequired
  • Type: software.amazon.awscdk.services.lambda.Permission

The permission to grant to this Lambda function.


addToRolePolicy
public void addToRolePolicy(PolicyStatement statement)

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

statementRequired
  • Type: software.amazon.awscdk.services.iam.PolicyStatement

configureAsyncInvoke
public void configureAsyncInvoke(EventInvokeConfigOptions options)

Configures options for asynchronous invocation.

optionsRequired
  • Type: software.amazon.awscdk.services.lambda.EventInvokeConfigOptions

considerWarningOnInvokeFunctionPermissions
public void considerWarningOnInvokeFunctionPermissions(Construct scope, java.lang.String action)

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

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

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

scopeRequired
  • Type: software.constructs.Construct

actionRequired
  • Type: java.lang.String

grantInvoke
public Grant grantInvoke(IGrantable grantee)

Grant the given identity permissions to invoke this Lambda.

granteeRequired
  • Type: software.amazon.awscdk.services.iam.IGrantable

grantInvokeCompositePrincipal
public java.util.List<Grant> grantInvokeCompositePrincipal(CompositePrincipal compositePrincipal)

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

compositePrincipalRequired
  • Type: software.amazon.awscdk.services.iam.CompositePrincipal

grantInvokeLatestVersion
public Grant grantInvokeLatestVersion(IGrantable grantee)

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

granteeRequired
  • Type: software.amazon.awscdk.services.iam.IGrantable

grantInvokeUrl
public Grant grantInvokeUrl(IGrantable grantee)

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

granteeRequired
  • Type: software.amazon.awscdk.services.iam.IGrantable

grantInvokeVersion
public Grant grantInvokeVersion(IGrantable grantee, IVersion version)

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

granteeRequired
  • Type: software.amazon.awscdk.services.iam.IGrantable

versionRequired
  • Type: software.amazon.awscdk.services.lambda.IVersion

metric
public Metric metric(java.lang.String metricName)
public Metric metric(java.lang.String metricName, MetricOptions props)

Return the given named metric for this Function.

metricNameRequired
  • Type: java.lang.String

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricDuration
public Metric metricDuration()
public Metric metricDuration(MetricOptions props)

How long execution of this Lambda takes.

Average over 5 minutes

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricErrors
public Metric metricErrors()
public Metric metricErrors(MetricOptions props)

How many invocations of this Lambda fail.

Sum over 5 minutes

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricInvocations
public Metric metricInvocations()
public Metric metricInvocations(MetricOptions props)

How often this Lambda is invoked.

Sum over 5 minutes

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricThrottles
public Metric metricThrottles()
public Metric metricThrottles(MetricOptions props)

How often this Lambda is throttled.

Sum over 5 minutes

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

addAlias
public Alias addAlias(java.lang.String aliasName)
public Alias addAlias(java.lang.String aliasName, AliasOptions options)

Defines an alias for this function.

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

declare const fn: lambda.Function;

fn.addAlias('Live');

// Is equivalent to

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

The name of the alias.


optionsOptional
  • Type: software.amazon.awscdk.services.lambda.AliasOptions

Alias options.


addEnvironment
public Function addEnvironment(java.lang.String key, java.lang.String value)
public Function addEnvironment(java.lang.String key, java.lang.String value, EnvironmentOptions options)

Adds an environment variable to this Lambda function.

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

keyRequired
  • Type: java.lang.String

The environment variable key.


valueRequired
  • Type: java.lang.String

The environment variable's value.


optionsOptional
  • Type: software.amazon.awscdk.services.lambda.EnvironmentOptions

Environment variable options.


addLayers
public void addLayers(ILayerVersion layers)

Adds one or more Lambda Layers to this Lambda function.

layersRequired
  • Type: software.amazon.awscdk.services.lambda.ILayerVersion

the layers to be added.


invalidateVersionBasedOn
public void invalidateVersionBasedOn(java.lang.String x)

Mix additional information into the hash of the Version object.

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

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

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

This method may be called more than once.

xRequired
  • Type: java.lang.String

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isOwnedResource
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.isOwnedResource(IConstruct construct)

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

constructRequired
  • Type: software.constructs.IConstruct

isResource
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.isResource(IConstruct construct)

Check whether the given construct is a Resource.

constructRequired
  • Type: software.constructs.IConstruct

classifyVersionProperty
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.classifyVersionProperty(java.lang.String propertyName, java.lang.Boolean locked)

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

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

propertyNameRequired
  • Type: java.lang.String

The property to classify.


lockedRequired
  • Type: java.lang.Boolean

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


fromFunctionArn
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.fromFunctionArn(Construct scope, java.lang.String id, java.lang.String functionArn)

Import a lambda function into the CDK using its ARN.

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

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

functionArnRequired
  • Type: java.lang.String

fromFunctionAttributes
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.fromFunctionAttributes(Construct scope, java.lang.String id, FunctionAttributes attrs)

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

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

scopeRequired
  • Type: software.constructs.Construct

The parent construct.


idRequired
  • Type: java.lang.String

The name of the lambda construct.


attrsRequired
  • Type: software.amazon.awscdk.services.lambda.FunctionAttributes

the attributes of the function to import.


fromFunctionName
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.fromFunctionName(Construct scope, java.lang.String id, java.lang.String functionName)

Import a lambda function into the CDK using its name.

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

functionNameRequired
  • Type: java.lang.String

metricAll
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAll(java.lang.String metricName),SnapStartFunction.metricAll(java.lang.String metricName, MetricOptions props)

Return the given named metric for this Lambda.

metricNameRequired
  • Type: java.lang.String

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricAllConcurrentExecutions
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAllConcurrentExecutions(),SnapStartFunction.metricAllConcurrentExecutions(MetricOptions props)

Metric for the number of concurrent executions across all Lambdas.

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricAllDuration
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAllDuration(),SnapStartFunction.metricAllDuration(MetricOptions props)

Metric for the Duration executing all Lambdas.

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricAllErrors
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAllErrors(),SnapStartFunction.metricAllErrors(MetricOptions props)

Metric for the number of Errors executing all Lambdas.

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricAllInvocations
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAllInvocations(),SnapStartFunction.metricAllInvocations(MetricOptions props)

Metric for the number of invocations of all Lambdas.

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricAllThrottles
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAllThrottles(),SnapStartFunction.metricAllThrottles(MetricOptions props)

Metric for the number of throttled invocations of all Lambdas.

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

metricAllUnreservedConcurrentExecutions
import software.aws.pdk.type_safe_api.SnapStartFunction;

SnapStartFunction.metricAllUnreservedConcurrentExecutions(),SnapStartFunction.metricAllUnreservedConcurrentExecutions(MetricOptions props)

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

propsOptional
  • Type: software.amazon.awscdk.services.cloudwatch.MetricOptions

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


envRequired
public ResourceEnvironment getEnv();
  • Type: software.amazon.awscdk.ResourceEnvironment

The environment this resource belongs to.

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


stackRequired
public Stack getStack();
  • Type: software.amazon.awscdk.Stack

The stack in which this resource is defined.


architectureRequired
public Architecture getArchitecture();
  • Type: software.amazon.awscdk.services.lambda.Architecture

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


connectionsRequired
public Connections getConnections();
  • Type: software.amazon.awscdk.services.ec2.Connections

Access the Connections object.

Will fail if not a VPC-enabled Lambda Function


functionArnRequired
public java.lang.String getFunctionArn();
  • Type: java.lang.String

ARN of this function.


functionNameRequired
public java.lang.String getFunctionName();
  • Type: java.lang.String

Name of this function.


grantPrincipalRequired
public IPrincipal getGrantPrincipal();
  • Type: software.amazon.awscdk.services.iam.IPrincipal

The principal this Lambda Function is running as.


isBoundToVpcRequired
public java.lang.Boolean getIsBoundToVpc();
  • Type: java.lang.Boolean

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

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


latestVersionRequired
public IVersion getLatestVersion();
  • Type: software.amazon.awscdk.services.lambda.IVersion

The $LATEST version of this function.

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

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


permissionsNodeRequired
public Node getPermissionsNode();
  • Type: software.constructs.Node

The construct node where permissions are attached.


resourceArnsForGrantInvokeRequired
public java.util.List<java.lang.String> getResourceArnsForGrantInvoke();
  • Type: java.util.List

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


roleOptional
public IRole getRole();
  • Type: software.amazon.awscdk.services.iam.IRole

Execution role associated with this function.


currentVersionRequired
public Version getCurrentVersion();
  • Type: software.amazon.awscdk.services.lambda.Version

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

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


logGroupRequired
public ILogGroup getLogGroup();
  • Type: software.amazon.awscdk.services.logs.ILogGroup

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

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

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


runtimeRequired
public Runtime getRuntime();
  • Type: software.amazon.awscdk.services.lambda.Runtime

The runtime configured for this lambda.


deadLetterQueueOptional
public IQueue getDeadLetterQueue();
  • Type: software.amazon.awscdk.services.sqs.IQueue

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


deadLetterTopicOptional
public ITopic getDeadLetterTopic();
  • Type: software.amazon.awscdk.services.sns.ITopic

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


timeoutOptional
public Duration getTimeout();
  • Type: software.amazon.awscdk.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 software.aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuild;

TypeSafeApiAsyncModelBuild.Builder.create(Project project)
    .asyncApiSpecFile(java.lang.String)
    .parsedSpecFile(java.lang.String)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
asyncApiSpecFile java.lang.String Path to the generated AsyncAPI specification (relative to the project root).
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).

projectRequired
  • Type: io.github.cdklabs.projen.Project

asyncApiSpecFileRequired
  • Type: java.lang.String

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


parsedSpecFileRequired
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuild;

TypeSafeApiAsyncModelBuild.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.TypeSafeApiAsyncModelBuild;

TypeSafeApiAsyncModelBuild.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

TypeSafeApiModelBuild

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

Initializers

import software.aws.pdk.type_safe_api.TypeSafeApiModelBuild;

TypeSafeApiModelBuild.Builder.create(Project project)
    .parsedSpecFile(java.lang.String)
    .openApiSpecificationPath(java.lang.String)
//  .smithyJsonModelPath(java.lang.String)
    .build();
Name Type Description
project io.github.cdklabs.projen.Project No description.
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).
openApiSpecificationPath java.lang.String Path to the OpenAPI specification.
smithyJsonModelPath java.lang.String Optional path to the Smithy JSON model (for Smithy projects only).

projectRequired
  • Type: io.github.cdklabs.projen.Project

parsedSpecFileRequired
  • Type: java.lang.String

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


openApiSpecificationPathRequired
  • Type: java.lang.String

Path to the OpenAPI specification.


smithyJsonModelPathOptional
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSafeApiModelBuild;

TypeSafeApiModelBuild.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.TypeSafeApiModelBuild;

TypeSafeApiModelBuild.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.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 software.aws.pdk.type_safe_api.TypeSafeApiProject;

TypeSafeApiProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .infrastructure(InfrastructureConfiguration)
    .model(ModelConfiguration)
//  .commitGeneratedCode(java.lang.Boolean)
//  .documentation(DocumentationConfiguration)
//  .handlers(HandlersConfiguration)
//  .library(LibraryConfiguration)
//  .runtime(RuntimeConfiguration)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
infrastructure InfrastructureConfiguration Configuration for generated infrastructure.
model ModelConfiguration Configuration for the API model.
commitGeneratedCode java.lang.Boolean Whether to commit the code generated by the OpenAPI Generator.
documentation DocumentationConfiguration Configuration for generated documentation.
handlers HandlersConfiguration Configuration for lambda handlers for implementing the API.
library LibraryConfiguration Configuration for generated libraries.
runtime RuntimeConfiguration Configuration for generated runtime projects (containing types, clients and server code).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


infrastructureRequired

Configuration for generated infrastructure.


modelRequired

Configuration for the API model.


commitGeneratedCodeOptional
  • Type: java.lang.Boolean
  • Default: false

Whether to commit the code generated by the OpenAPI Generator.


documentationOptional

Configuration for generated documentation.


handlersOptional

Configuration for lambda handlers for implementing the API.


libraryOptional

Configuration for generated libraries.

Libraries are projects which are generated from your model, but are not fully-fledged runtimes, for example react hooks or clients in languages that aren't supported as runtimes.


runtimeOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSafeApiProject;

TypeSafeApiProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.TypeSafeApiProject;

TypeSafeApiProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.TypeSafeApiProject;

TypeSafeApiProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


allRequired
public ProjectCollections getAll();

Collections of all sub-projects managed by this project.


documentationRequired
public GeneratedDocumentationProjects getDocumentation();

Generated documentation projects.

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


handlersRequired
public GeneratedCodeProjects getHandlers();

Lambda handlers projects.

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


infrastructureRequired
public GeneratedCodeProjects getInfrastructure();

Generated infrastructure projects.

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


libraryRequired
public GeneratedLibraryProjects getLibrary();

Generated library projects.

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


modelRequired
public ModelProject getModel();

Project for the api model.


runtimeRequired
public GeneratedCodeProjects getRuntime();

Generated runtime projects.

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


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


TypeSafeRestApi

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

Initializers

import software.aws.pdk.type_safe_api.TypeSafeRestApi;

TypeSafeRestApi.Builder.create(Construct scope, java.lang.String id)
//  .cloudWatchRole(java.lang.Boolean)
//  .cloudWatchRoleRemovalPolicy(RemovalPolicy)
//  .deploy(java.lang.Boolean)
//  .deployOptions(StageOptions)
//  .description(java.lang.String)
//  .disableExecuteApiEndpoint(java.lang.Boolean)
//  .domainName(DomainNameOptions)
//  .endpointExportName(java.lang.String)
//  .endpointTypes(java.util.List<EndpointType>)
//  .failOnWarnings(java.lang.Boolean)
//  .parameters(java.util.Map<java.lang.String, java.lang.String>)
//  .policy(PolicyDocument)
//  .restApiName(java.lang.String)
//  .retainDeployments(java.lang.Boolean)
    .integrations(java.util.Map<java.lang.String, TypeSafeApiIntegration>)
    .operationLookup(java.util.Map<java.lang.String, OperationDetails>)
//  .apiKeyOptions(ApiKeyOptions)
//  .corsOptions(CorsOptions)
//  .defaultAuthorizer(Authorizer)
    .specPath(java.lang.String)
//  .minCompressionSize(Size)
//  .outputSpecBucket(IBucket)
//  .webAclOptions(TypeSafeApiWebAclOptions)
    .build();
Name Type Description
scope software.constructs.Construct No description.
id java.lang.String No description.
cloudWatchRole java.lang.Boolean Automatically configure an AWS CloudWatch role for API Gateway.
cloudWatchRoleRemovalPolicy software.amazon.awscdk.RemovalPolicy The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.
deploy java.lang.Boolean Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
deployOptions software.amazon.awscdk.services.apigateway.StageOptions Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.
description java.lang.String A description of the RestApi construct.
disableExecuteApiEndpoint java.lang.Boolean Specifies whether clients can invoke the API using the default execute-api endpoint.
domainName software.amazon.awscdk.services.apigateway.DomainNameOptions Configure a custom domain name and map it to this API.
endpointExportName java.lang.String Export name for the CfnOutput containing the API endpoint.
endpointTypes java.util.List A list of the endpoint types of the API.
failOnWarnings java.lang.Boolean Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters java.util.Map Custom header parameters for the request.
policy software.amazon.awscdk.services.iam.PolicyDocument A policy document that contains the permissions for this RestApi.
restApiName java.lang.String A name for the API Gateway RestApi resource.
retainDeployments java.lang.Boolean Retains old deployment resources when the API changes.
integrations java.util.MapTypeSafeApiIntegration\> A mapping of API operation to its integration.
operationLookup java.util.MapOperationDetails\> Details about each operation.
apiKeyOptions ApiKeyOptions Options for API keys.
corsOptions software.amazon.awscdk.services.apigateway.CorsOptions Cross Origin Resource Sharing options for the API.
defaultAuthorizer Authorizer The default authorizer to use for your api.
specPath java.lang.String Path to the JSON open api spec.
minCompressionSize software.amazon.awscdk.Size A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
outputSpecBucket software.amazon.awscdk.services.s3.IBucket By default, the spec is prepared and outputted into the CDK assets bucket.
webAclOptions TypeSafeApiWebAclOptions Options for the AWS WAF v2 WebACL associated with the api.

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

cloudWatchRoleOptional
  • Type: java.lang.Boolean
  • Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

Automatically configure an AWS CloudWatch role for API Gateway.


cloudWatchRoleRemovalPolicyOptional
  • Type: software.amazon.awscdk.RemovalPolicy
  • Default: RemovalPolicy.RETAIN

The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.

Requires cloudWatchRole to be enabled.


deployOptional
  • Type: java.lang.Boolean
  • Default: true

Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.

Since API Gateway deployments are immutable, When this option is enabled (by default), an AWS::ApiGateway::Deployment resource will automatically created with a logical ID that hashes the API model (methods, resources and options). This means that when the model changes, the logical ID of this CloudFormation resource will change, and a new deployment will be created.

If this is set, latestDeployment will refer to the Deployment object and deploymentStage will refer to a Stage that points to this deployment. To customize the stage options, use the deployOptions property.

A CloudFormation Output will also be defined with the root URL endpoint of this REST API.


deployOptionsOptional
  • Type: software.amazon.awscdk.services.apigateway.StageOptions
  • Default: Based on defaults of StageOptions.

Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.

If deploy is disabled, this value cannot be set.


descriptionOptional
  • Type: java.lang.String
  • Default: 'Automatically created by the RestApi construct'

A description of the RestApi construct.


disableExecuteApiEndpointOptional
  • Type: java.lang.Boolean
  • Default: false

Specifies whether clients can invoke the API using the default execute-api endpoint.

To require that clients use a custom domain name to invoke the API, disable the default endpoint.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html


domainNameOptional
  • Type: software.amazon.awscdk.services.apigateway.DomainNameOptions
  • Default: no domain name is defined, use addDomainName or directly define a DomainName.

Configure a custom domain name and map it to this API.


endpointExportNameOptional
  • Type: java.lang.String
  • Default: when no export name is given, output will be created without export

Export name for the CfnOutput containing the API endpoint.


endpointTypesOptional
  • Type: java.util.List
  • Default: EndpointType.EDGE

A list of the endpoint types of the API.

Use this property when creating an API.


failOnWarningsOptional
  • Type: java.lang.Boolean
  • Default: false

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


parametersOptional
  • Type: java.util.Map
  • Default: No parameters.

Custom header parameters for the request.

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


policyOptional
  • Type: software.amazon.awscdk.services.iam.PolicyDocument
  • Default: No policy.

A policy document that contains the permissions for this RestApi.


restApiNameOptional
  • Type: java.lang.String
  • Default: ID of the RestApi construct.

A name for the API Gateway RestApi resource.


retainDeploymentsOptional
  • Type: java.lang.Boolean
  • Default: false

Retains old deployment resources when the API changes.

This allows manually reverting stages to point to old deployments via the AWS Console.


integrationsRequired
  • Type: java.util.MapTypeSafeApiIntegration\>

A mapping of API operation to its integration.


operationLookupRequired
  • Type: java.util.MapOperationDetails\>

Details about each operation.


apiKeyOptionsOptional

Options for API keys.


corsOptionsOptional
  • Type: software.amazon.awscdk.services.apigateway.CorsOptions

Cross Origin Resource Sharing options for the API.


defaultAuthorizerOptional

The default authorizer to use for your api.

When omitted, no default authorizer is used. Authorizers specified at the integration level will override this for that operation.


specPathRequired
  • Type: java.lang.String

Path to the JSON open api spec.


minCompressionSizeOptional
  • Type: software.amazon.awscdk.Size
  • Default: Compression is disabled.

A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.


outputSpecBucketOptional
  • Type: software.amazon.awscdk.services.s3.IBucket

By default, the spec is prepared and outputted into the CDK assets bucket.

If this is undesired, use this option to specify the output bucket.


webAclOptionsOptional

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
toString Returns a string representation of this construct.

toString
public java.lang.String toString()

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import software.aws.pdk.type_safe_api.TypeSafeRestApi;

TypeSafeRestApi.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


Properties

Name Type Description
node software.constructs.Node The tree node.
api software.amazon.awscdk.services.apigateway.SpecRestApi Underlying API Gateway API construct.
extendedApiSpecification java.lang.Object The OpenAPI specification with applied API gateway extensions.
ipSet software.amazon.awscdk.services.wafv2.CfnIPSet Reference to the IP set if created.
webAcl software.amazon.awscdk.services.wafv2.CfnWebACL Reference to the webacl, if created.
webAclAssociation software.amazon.awscdk.services.wafv2.CfnWebACLAssociation Reference to the web acl association if created.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


apiRequired
public SpecRestApi getApi();
  • Type: software.amazon.awscdk.services.apigateway.SpecRestApi

Underlying API Gateway API construct.


extendedApiSpecificationRequired
public java.lang.Object getExtendedApiSpecification();
  • Type: java.lang.Object

The OpenAPI specification with applied API gateway extensions.


ipSetOptional
public CfnIPSet getIpSet();
  • Type: software.amazon.awscdk.services.wafv2.CfnIPSet

Reference to the IP set if created.


webAclOptional
public CfnWebACL getWebAcl();
  • Type: software.amazon.awscdk.services.wafv2.CfnWebACL

Reference to the webacl, if created.


webAclAssociationOptional
public CfnWebACLAssociation getWebAclAssociation();
  • Type: software.amazon.awscdk.services.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 software.aws.pdk.type_safe_api.TypeSafeWebsocketApi;

TypeSafeWebsocketApi.Builder.create(Construct scope, java.lang.String id)
//  .apiKeySelectionExpression(WebSocketApiKeySelectionExpression)
//  .apiName(java.lang.String)
//  .description(java.lang.String)
    .integrations(java.util.Map<java.lang.String, TypeSafeWebsocketApiIntegration>)
    .operationLookup(java.util.Map<java.lang.String, WebsocketOperationDetails>)
    .specPath(java.lang.String)
//  .authorizer(IWebSocketRouteAuthorizer)
//  .connect(TypeSafeWebsocketApiIntegration)
//  .disableAccessLogging(java.lang.Boolean)
//  .disableGrantManagementAccessToLambdas(java.lang.Boolean)
//  .disableMockIntegrationResponses(java.lang.Boolean)
//  .disconnect(TypeSafeWebsocketApiIntegration)
//  .stageProps(WebSocketStageProps)
    .build();
Name Type Description
scope software.constructs.Construct No description.
id java.lang.String No description.
apiKeySelectionExpression software.amazon.awscdk.services.apigatewayv2.WebSocketApiKeySelectionExpression An API key selection expression.
apiName java.lang.String Name for the WebSocket API resource.
description java.lang.String The description of the API.
integrations java.util.MapTypeSafeWebsocketApiIntegration\> WebSocket routes and their corresponding integrations.
operationLookup java.util.MapWebsocketOperationDetails\> Details about each operation.
specPath java.lang.String Path to the websocket api specification json file.
authorizer software.amazon.awscdk.services.apigatewayv2.IWebSocketRouteAuthorizer Authorizer to use for the API (applied to the $connect route).
connect TypeSafeWebsocketApiIntegration Integration for the $connect route (invoked when a new client connects).
disableAccessLogging java.lang.Boolean Disable access logging.
disableGrantManagementAccessToLambdas java.lang.Boolean By default, all lambda integrations are granted management API access for the websocket API to send messages, disconnect clients, etc.
disableMockIntegrationResponses java.lang.Boolean By default, all mock integrations will automatically be configured with integration responses such that the integration is considered successful.
disconnect TypeSafeWebsocketApiIntegration Integration for the $disconnect route (invoked when a client disconnects).
stageProps WebSocketStageProps Options for the default stage.

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

apiKeySelectionExpressionOptional
  • Type: software.amazon.awscdk.services.apigatewayv2.WebSocketApiKeySelectionExpression
  • Default: Key is not required to access these APIs

An API key selection expression.

Providing this option will require an API Key be provided to access the API.


apiNameOptional
  • Type: java.lang.String
  • Default: id of the WebSocketApi construct.

Name for the WebSocket API resource.


descriptionOptional
  • Type: java.lang.String
  • Default: none

The description of the API.


integrationsRequired
  • Type: java.util.MapTypeSafeWebsocketApiIntegration\>

WebSocket routes and their corresponding integrations.


operationLookupRequired
  • Type: java.util.MapWebsocketOperationDetails\>

Details about each operation.


specPathRequired
  • Type: java.lang.String

Path to the websocket api specification json file.


authorizerOptional
  • Type: software.amazon.awscdk.services.apigatewayv2.IWebSocketRouteAuthorizer
  • Default: NONE

Authorizer to use for the API (applied to the $connect route).


connectOptional

Integration for the $connect route (invoked when a new client connects).


disableAccessLoggingOptional
  • Type: java.lang.Boolean
  • Default: false

Disable access logging.


disableGrantManagementAccessToLambdasOptional
  • Type: java.lang.Boolean
  • Default: false

By default, all lambda integrations are granted management API access for the websocket API to send messages, disconnect clients, etc.

Set to true if you would like to manage these permissions manually.


disableMockIntegrationResponsesOptional
  • Type: java.lang.Boolean
  • Default: false

By default, all mock integrations will automatically be configured with integration responses such that the integration is considered successful.

Set to true to disable this (mock integrations will respond with errors)


disconnectOptional

Integration for the $disconnect route (invoked when a client disconnects).


stagePropsOptional

Options for the default stage.


Methods

Name Description
toString Returns a string representation of this construct.

toString
public java.lang.String toString()

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import software.aws.pdk.type_safe_api.TypeSafeWebsocketApi;

TypeSafeWebsocketApi.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


Properties

Name Type Description
node software.constructs.Node The tree node.
api software.amazon.awscdk.services.apigatewayv2.WebSocketApi Reference to the websocket API.
defaultStage software.amazon.awscdk.services.apigatewayv2.WebSocketStage Reference to the default deploy stage.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


apiRequired
public WebSocketApi getApi();
  • Type: software.amazon.awscdk.services.apigatewayv2.WebSocketApi

Reference to the websocket API.


defaultStageRequired
public WebSocketStage getDefaultStage();
  • Type: software.amazon.awscdk.services.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 software.aws.pdk.type_safe_api.TypeSafeWebSocketApiProject;

TypeSafeWebSocketApiProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
    .infrastructure(WebSocketInfrastructureConfiguration)
    .model(TypeSafeWebSocketApiModelConfiguration)
//  .documentation(WebSocketDocumentationConfiguration)
//  .handlers(WebSocketHandlersConfiguration)
//  .library(WebSocketLibraryConfiguration)
//  .runtime(WebSocketRuntimeConfiguration)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
infrastructure WebSocketInfrastructureConfiguration Configuration for generated infrastructure.
model TypeSafeWebSocketApiModelConfiguration Configuration for the API model.
documentation WebSocketDocumentationConfiguration Configuration for generated documentation.
handlers WebSocketHandlersConfiguration Configuration for lambda handlers for implementing the API.
library WebSocketLibraryConfiguration Configuration for generated libraries.
runtime WebSocketRuntimeConfiguration Configuration for generated runtime projects (containing types, clients and server code).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


infrastructureRequired

Configuration for generated infrastructure.


modelRequired

Configuration for the API model.


documentationOptional

Configuration for generated documentation.


handlersOptional

Configuration for lambda handlers for implementing the API.


libraryOptional

Configuration for generated libraries.

These include clients for interacting with your websocket API


runtimeOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String _pattern)

Exclude these files from the bundled package.

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

_patternRequired
  • Type: java.lang.String

The glob pattern to exclude.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String _glob)

Consider a set of files as "generated".

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

_globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

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

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSafeWebSocketApiProject;

TypeSafeWebSocketApiProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.TypeSafeWebSocketApiProject;

TypeSafeWebSocketApiProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.TypeSafeWebSocketApiProject;

TypeSafeWebSocketApiProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


allRequired
public ProjectCollections getAll();

Collections of all sub-projects managed by this project.


documentationRequired
public GeneratedWebSocketDocumentationProjects getDocumentation();

Generated documentation projects.

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


handlersRequired
public GeneratedCodeProjects getHandlers();

Lambda handlers projects.

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


infrastructureRequired
public GeneratedCodeProjects getInfrastructure();

Generated infrastructure projects.

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


libraryRequired
public GeneratedWebSocketLibraryProjects getLibrary();

Generated library projects.

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


modelRequired
public WebSocketModelProject getModel();

Project for the api model.


runtimeRequired
public GeneratedCodeProjects getRuntime();

Generated runtime projects.

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


Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


TypeSpecAsyncDefinition

The TypeSpec model definition for an async api.

Initializers

import software.aws.pdk.type_safe_api.TypeSpecAsyncDefinition;

TypeSpecAsyncDefinition.Builder.create(NodeProject project)
    .typeSpecOptions(TypeSpecModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .build();
Name Type Description
project io.github.cdklabs.projen.javascript.NodeProject No description.
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).

projectRequired
  • Type: io.github.cdklabs.projen.javascript.NodeProject

typeSpecOptionsRequired

TypeSpec model options.


handlerLanguagesOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSpecAsyncDefinition;

TypeSpecAsyncDefinition.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isComponent
import software.aws.pdk.type_safe_api.TypeSpecAsyncDefinition;

TypeSpecAsyncDefinition.isComponent(java.lang.Object x)

Test whether the given construct is a component.

xRequired
  • Type: java.lang.Object

Properties

Name Type Description
node software.constructs.Node The tree node.
project io.github.cdklabs.projen.Project No description.
openApiSpecificationPath java.lang.String Path to the generated OpenAPI specification.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


projectRequired
public Project getProject();
  • Type: io.github.cdklabs.projen.Project

openApiSpecificationPathRequired
public java.lang.String getOpenApiSpecificationPath();
  • Type: java.lang.String

Path to the generated OpenAPI specification.


TypeSpecAsyncModelProject

Model project for defining a WebSocket API in TypeSpec.

Initializers

import software.aws.pdk.type_safe_api.TypeSpecAsyncModelProject;

TypeSpecAsyncModelProject.Builder.create()
    .name(java.lang.String)
//  .commitGenerated(java.lang.Boolean)
//  .gitIgnoreOptions(IgnoreFileOptions)
//  .gitOptions(GitOptions)
//  .logging(LoggerOptions)
//  .outdir(java.lang.String)
//  .parent(Project)
//  .projenCommand(java.lang.String)
//  .projenrcJson(java.lang.Boolean)
//  .projenrcJsonOptions(ProjenrcJsonOptions)
//  .renovatebot(java.lang.Boolean)
//  .renovatebotOptions(RenovatebotOptions)
//  .autoApproveOptions(AutoApproveOptions)
//  .autoMerge(java.lang.Boolean)
//  .autoMergeOptions(AutoMergeOptions)
//  .clobber(java.lang.Boolean)
//  .devContainer(java.lang.Boolean)
//  .github(java.lang.Boolean)
//  .githubOptions(GitHubOptions)
//  .gitpod(java.lang.Boolean)
//  .mergify(java.lang.Boolean)
//  .mergifyOptions(MergifyOptions)
//  .projectType(ProjectType)
//  .projenCredentials(GithubCredentials)
//  .projenTokenSecret(java.lang.String)
//  .readme(SampleReadmeProps)
//  .stale(java.lang.Boolean)
//  .staleOptions(StaleOptions)
//  .vscode(java.lang.Boolean)
//  .allowLibraryDependencies(java.lang.Boolean)
//  .authorEmail(java.lang.String)
//  .authorName(java.lang.String)
//  .authorOrganization(java.lang.Boolean)
//  .authorUrl(java.lang.String)
//  .autoDetectBin(java.lang.Boolean)
//  .bin(java.util.Map<java.lang.String, java.lang.String>)
//  .bugsEmail(java.lang.String)
//  .bugsUrl(java.lang.String)
//  .bundledDeps(java.util.List<java.lang.String>)
//  .codeArtifactOptions(CodeArtifactOptions)
//  .deps(java.util.List<java.lang.String>)
//  .description(java.lang.String)
//  .devDeps(java.util.List<java.lang.String>)
//  .entrypoint(java.lang.String)
//  .homepage(java.lang.String)
//  .keywords(java.util.List<java.lang.String>)
//  .license(java.lang.String)
//  .licensed(java.lang.Boolean)
//  .maxNodeVersion(java.lang.String)
//  .minNodeVersion(java.lang.String)
//  .npmAccess(NpmAccess)
//  .npmProvenance(java.lang.Boolean)
//  .npmRegistry(java.lang.String)
//  .npmRegistryUrl(java.lang.String)
//  .npmTokenSecret(java.lang.String)
//  .packageManager(NodePackageManager)
//  .packageName(java.lang.String)
//  .peerDependencyOptions(PeerDependencyOptions)
//  .peerDeps(java.util.List<java.lang.String>)
//  .pnpmVersion(java.lang.String)
//  .repository(java.lang.String)
//  .repositoryDirectory(java.lang.String)
//  .scopedPackagesOptions(java.util.List<ScopedPackagesOptions>)
//  .scripts(java.util.Map<java.lang.String, java.lang.String>)
//  .stability(java.lang.String)
//  .yarnBerryOptions(YarnBerryOptions)
//  .jsiiReleaseVersion(java.lang.String)
//  .majorVersion(java.lang.Number)
//  .minMajorVersion(java.lang.Number)
//  .npmDistTag(java.lang.String)
//  .postBuildSteps(java.util.List<JobStep>)
//  .prerelease(java.lang.String)
//  .publishDryRun(java.lang.Boolean)
//  .publishTasks(java.lang.Boolean)
//  .releasableCommits(ReleasableCommits)
//  .releaseBranches(java.util.Map<java.lang.String, BranchOptions>)
//  .releaseEveryCommit(java.lang.Boolean)
//  .releaseFailureIssue(java.lang.Boolean)
//  .releaseFailureIssueLabel(java.lang.String)
//  .releaseSchedule(java.lang.String)
//  .releaseTagPrefix(java.lang.String)
//  .releaseTrigger(ReleaseTrigger)
//  .releaseWorkflowName(java.lang.String)
//  .releaseWorkflowSetupSteps(java.util.List<JobStep>)
//  .versionrcOptions(java.util.Map<java.lang.String, java.lang.Object>)
//  .workflowContainerImage(java.lang.String)
//  .workflowRunsOn(java.util.List<java.lang.String>)
//  .workflowRunsOnGroup(GroupRunnerOptions)
    .defaultReleaseBranch(java.lang.String)
//  .artifactsDirectory(java.lang.String)
//  .autoApproveUpgrades(java.lang.Boolean)
//  .buildWorkflow(java.lang.Boolean)
//  .buildWorkflowOptions(BuildWorkflowOptions)
//  .buildWorkflowTriggers(Triggers)
//  .bundlerOptions(BundlerOptions)
//  .checkLicenses(LicenseCheckerOptions)
//  .codeCov(java.lang.Boolean)
//  .codeCovTokenSecret(java.lang.String)
//  .copyrightOwner(java.lang.String)
//  .copyrightPeriod(java.lang.String)
//  .dependabot(java.lang.Boolean)
//  .dependabotOptions(DependabotOptions)
//  .depsUpgrade(java.lang.Boolean)
//  .depsUpgradeOptions(UpgradeDependenciesOptions)
//  .gitignore(java.util.List<java.lang.String>)
//  .jest(java.lang.Boolean)
//  .jestOptions(JestOptions)
//  .mutableBuild(java.lang.Boolean)
//  .npmignore(java.util.List<java.lang.String>)
//  .npmignoreEnabled(java.lang.Boolean)
//  .npmIgnoreOptions(IgnoreFileOptions)
//  .package(java.lang.Boolean)
//  .prettier(java.lang.Boolean)
//  .prettierOptions(PrettierOptions)
//  .projenDevDependency(java.lang.Boolean)
//  .projenrcJs(java.lang.Boolean)
//  .projenrcJsOptions(ProjenrcOptions)
//  .projenVersion(java.lang.String)
//  .pullRequestTemplate(java.lang.Boolean)
//  .pullRequestTemplateContents(java.util.List<java.lang.String>)
//  .release(java.lang.Boolean)
//  .releaseToNpm(java.lang.Boolean)
//  .releaseWorkflow(java.lang.Boolean)
//  .workflowBootstrapSteps(java.util.List<JobStep>)
//  .workflowGitIdentity(GitIdentity)
//  .workflowNodeVersion(java.lang.String)
//  .workflowPackageCache(java.lang.Boolean)
    .typeSpecOptions(TypeSpecModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .asyncApiSpecFile(java.lang.String)
    .parsedSpecFile(java.lang.String)
    .build();
Name Type Description
name java.lang.String This is the name of your project.
commitGenerated java.lang.Boolean Whether to commit the managed files by default.
gitIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions io.github.cdklabs.projen.GitOptions Configuration options for git.
logging io.github.cdklabs.projen.LoggerOptions Configure logging options such as verbosity.
outdir java.lang.String The root directory of the project.
parent io.github.cdklabs.projen.Project The parent project, if this project is part of a bigger project.
projenCommand java.lang.String The shell command to use in order to run the projen CLI.
projenrcJson java.lang.Boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions io.github.cdklabs.projen.ProjenrcJsonOptions Options for .projenrc.json.
renovatebot java.lang.Boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions io.github.cdklabs.projen.RenovatebotOptions Options for renovatebot.
autoApproveOptions io.github.cdklabs.projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoMerge java.lang.Boolean Enable automatic merging on GitHub.
autoMergeOptions io.github.cdklabs.projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
clobber java.lang.Boolean Add a clobber task which resets the repo to origin.
devContainer java.lang.Boolean Add a VSCode development environment (used for GitHub Codespaces).
github java.lang.Boolean Enable GitHub integration.
githubOptions io.github.cdklabs.projen.github.GitHubOptions Options for GitHub integration.
gitpod java.lang.Boolean Add a Gitpod development environment.
mergify java.lang.Boolean Whether mergify should be enabled on this repository or not.
mergifyOptions io.github.cdklabs.projen.github.MergifyOptions Options for mergify.
projectType io.github.cdklabs.projen.ProjectType Which type of project this is (library/app).
projenCredentials io.github.cdklabs.projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenTokenSecret java.lang.String The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
readme io.github.cdklabs.projen.SampleReadmeProps The README setup.
stale java.lang.Boolean Auto-close of stale issues and pull request.
staleOptions io.github.cdklabs.projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode java.lang.Boolean Enable VSCode integration.
allowLibraryDependencies java.lang.Boolean Allow the project to include peerDependencies and bundledDependencies.
authorEmail java.lang.String Author's e-mail.
authorName java.lang.String Author's name.
authorOrganization java.lang.Boolean Is the author an organization.
authorUrl java.lang.String Author's URL / Website.
autoDetectBin java.lang.Boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
bin java.util.Map Binary programs vended with your module.
bugsEmail java.lang.String The email address to which issues should be reported.
bugsUrl java.lang.String The url to your project's issue tracker.
bundledDeps java.util.List List of dependencies to bundle into this module.
codeArtifactOptions io.github.cdklabs.projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps java.util.List Runtime dependencies of this module.
description java.lang.String The description is just a string that helps people understand the purpose of the package.
devDeps java.util.List Build dependencies for this module.
entrypoint java.lang.String Module entrypoint (main in package.json).
homepage java.lang.String Package's Homepage / Website.
keywords java.util.List Keywords to include in package.json.
license java.lang.String License's SPDX identifier.
licensed java.lang.Boolean Indicates if a license should be added.
maxNodeVersion java.lang.String Minimum node.js version to require via engines (inclusive).
minNodeVersion java.lang.String Minimum Node.js version to require via package.json engines (inclusive).
npmAccess io.github.cdklabs.projen.javascript.NpmAccess Access level of the npm package.
npmProvenance java.lang.Boolean Should provenance statements be generated when the package is published.
npmRegistry java.lang.String The host name of the npm registry to publish to.
npmRegistryUrl java.lang.String The base URL of the npm package registry.
npmTokenSecret java.lang.String GitHub secret which contains the NPM token to use when publishing packages.
packageManager io.github.cdklabs.projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName java.lang.String The "name" in package.json.
peerDependencyOptions io.github.cdklabs.projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps java.util.List Peer dependencies for this module.
pnpmVersion java.lang.String The version of PNPM to use if using PNPM as a package manager.
repository java.lang.String The repository is the location where the actual code for your package lives.
repositoryDirectory java.lang.String If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
scopedPackagesOptions java.util.List Options for privately hosted scoped packages.
scripts java.util.Map npm scripts to include.
stability java.lang.String Package's Stability.
yarnBerryOptions io.github.cdklabs.projen.javascript.YarnBerryOptions Options for Yarn Berry.
jsiiReleaseVersion java.lang.String Version requirement of publib which is used to publish modules to npm.
majorVersion java.lang.Number Major version to release from the default branch.
minMajorVersion java.lang.Number Minimal Major version to release.
npmDistTag java.lang.String The npmDistTag to use when publishing from the default branch.
postBuildSteps java.util.List Steps to execute after build as part of the release workflow.
prerelease java.lang.String Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun java.lang.Boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks java.lang.Boolean Define publishing tasks that can be executed manually as well as workflows.
releasableCommits io.github.cdklabs.projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
releaseBranches java.util.Map Defines additional release branches.
releaseEveryCommit java.lang.Boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue java.lang.Boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel java.lang.String The label to apply to issues indicating publish failures.
releaseSchedule java.lang.String CRON schedule to trigger new releases.
releaseTagPrefix java.lang.String Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger io.github.cdklabs.projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflowName java.lang.String The name of the default release workflow.
releaseWorkflowSetupSteps java.util.List A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions java.util.Map Custom configuration used when creating changelog with standard-version package.
workflowContainerImage java.lang.String Container image to use for GitHub workflows.
workflowRunsOn java.util.List Github Runner selection labels.
workflowRunsOnGroup io.github.cdklabs.projen.GroupRunnerOptions Github Runner Group selection options.
defaultReleaseBranch java.lang.String The name of the main release branch.
artifactsDirectory java.lang.String A directory which will contain build artifacts.
autoApproveUpgrades java.lang.Boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow java.lang.Boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions io.github.cdklabs.projen.javascript.BuildWorkflowOptions Options for PR build workflow.
buildWorkflowTriggers io.github.cdklabs.projen.github.workflows.Triggers Build workflow triggers.
bundlerOptions io.github.cdklabs.projen.javascript.BundlerOptions Options for Bundler.
checkLicenses io.github.cdklabs.projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
codeCov java.lang.Boolean Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.
codeCovTokenSecret java.lang.String Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner java.lang.String License copyright owner.
copyrightPeriod java.lang.String The copyright years to put in the LICENSE file.
dependabot java.lang.Boolean Use dependabot to handle dependency upgrades.
dependabotOptions io.github.cdklabs.projen.github.DependabotOptions Options for dependabot.
depsUpgrade java.lang.Boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions io.github.cdklabs.projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore java.util.List Additional entries to .gitignore.
jest java.lang.Boolean Setup jest unit tests.
jestOptions io.github.cdklabs.projen.javascript.JestOptions Jest options.
mutableBuild java.lang.Boolean Automatically update files modified during builds to pull-request branches.
npmignore java.util.List Additional entries to .npmignore.
npmignoreEnabled java.lang.Boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions io.github.cdklabs.projen.IgnoreFileOptions Configuration options for .npmignore file.
package java.lang.Boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier java.lang.Boolean Setup prettier.
prettierOptions io.github.cdklabs.projen.javascript.PrettierOptions Prettier options.
projenDevDependency java.lang.Boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs java.lang.Boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions io.github.cdklabs.projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenVersion java.lang.String Version of projen to install.
pullRequestTemplate java.lang.Boolean Include a GitHub pull request template.
pullRequestTemplateContents java.util.List The contents of the pull request template.
release java.lang.Boolean Add release management to this project.
releaseToNpm java.lang.Boolean Automatically release to npm when new versions are introduced.
releaseWorkflow java.lang.Boolean DEPRECATED: renamed to release.
workflowBootstrapSteps java.util.List Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity io.github.cdklabs.projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion java.lang.String The node version to use in GitHub workflows.
workflowPackageCache java.lang.Boolean Enable Node.js package cache in GitHub workflows.
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).
asyncApiSpecFile java.lang.String Path to the generated AsyncAPI specification (relative to the project root).
parsedSpecFile java.lang.String Path of the parsed/bundled OpenAPI specification (relative to the project root).

nameRequired
  • Type: java.lang.String
  • Default: $BASEDIR

This is the name of your project.


commitGeneratedOptional
  • Type: java.lang.Boolean
  • Default: true

Whether to commit the managed files by default.


gitIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
  • Type: io.github.cdklabs.projen.GitOptions

Configuration options for git.


loggingOptional
  • Type: io.github.cdklabs.projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


outdirOptional
  • Type: java.lang.String
  • Default: "."

The root directory of the project.

Relative to this directory, all files are synthesized.

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


parentOptional
  • Type: io.github.cdklabs.projen.Project

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


projenCommandOptional
  • Type: java.lang.String
  • Default: "npx projen"

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

Can be used to customize in special environments.


projenrcJsonOptional
  • Type: java.lang.Boolean
  • Default: false

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


projenrcJsonOptionsOptional
  • Type: io.github.cdklabs.projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


renovatebotOptional
  • Type: java.lang.Boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
  • Type: io.github.cdklabs.projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


autoApproveOptionsOptional
  • Type: io.github.cdklabs.projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoMergeOptional
  • Type: java.lang.Boolean
  • Default: true

Enable automatic merging on GitHub.

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


autoMergeOptionsOptional
  • Type: io.github.cdklabs.projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

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


clobberOptional
  • Type: java.lang.Boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


devContainerOptional
  • Type: java.lang.Boolean
  • Default: false

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


githubOptional
  • Type: java.lang.Boolean
  • Default: true

Enable GitHub integration.

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


githubOptionsOptional
  • Type: io.github.cdklabs.projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitpodOptional
  • Type: java.lang.Boolean
  • Default: false

Add a Gitpod development environment.


~~mergify~~Optional
  • Deprecated: use githubOptions.mergify instead

  • Type: java.lang.Boolean

  • Default: true

Whether mergify should be enabled on this repository or not.


~~mergifyOptions~~Optional
  • Deprecated: use githubOptions.mergifyOptions instead

  • Type: io.github.cdklabs.projen.github.MergifyOptions

  • Default: default options

Options for mergify.


~~projectType~~Optional
  • Deprecated: no longer supported at the base project level

  • Type: io.github.cdklabs.projen.ProjectType

  • Default: ProjectType.UNKNOWN

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


projenCredentialsOptional
  • Type: io.github.cdklabs.projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

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


~~projenTokenSecret~~Optional
  • Deprecated: use projenCredentials

  • Type: java.lang.String

  • Default: "PROJEN_GITHUB_TOKEN"

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

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


readmeOptional
  • Type: io.github.cdklabs.projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


Example

"{ filename: 'readme.md', contents: '# title' }"
staleOptional
  • Type: java.lang.Boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
  • Type: io.github.cdklabs.projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
  • Type: java.lang.Boolean
  • Default: true

Enable VSCode integration.

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


allowLibraryDependenciesOptional
  • Type: java.lang.Boolean
  • Default: true

Allow the project to include peerDependencies and bundledDependencies.

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


authorEmailOptional
  • Type: java.lang.String

Author's e-mail.


authorNameOptional
  • Type: java.lang.String

Author's name.


authorOrganizationOptional
  • Type: java.lang.Boolean

Is the author an organization.


authorUrlOptional
  • Type: java.lang.String

Author's URL / Website.


autoDetectBinOptional
  • Type: java.lang.Boolean
  • Default: true

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


binOptional
  • Type: java.util.Map

Binary programs vended with your module.

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


bugsEmailOptional
  • Type: java.lang.String

The email address to which issues should be reported.


bugsUrlOptional
  • Type: java.lang.String

The url to your project's issue tracker.


bundledDepsOptional
  • Type: java.util.List

List of dependencies to bundle into this module.

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

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


codeArtifactOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.CodeArtifactOptions
  • Default: undefined

Options for npm packages using AWS CodeArtifact.

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


depsOptional
  • Type: java.util.List
  • Default: []

Runtime dependencies of this module.

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


Example

[ 'express', 'lodash', 'foo@^2' ]
descriptionOptional
  • Type: java.lang.String

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

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


devDepsOptional
  • Type: java.util.List
  • Default: []

Build dependencies for this module.

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

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


Example

[ 'typescript', '@types/express' ]
entrypointOptional
  • Type: java.lang.String
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

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


homepageOptional
  • Type: java.lang.String

Package's Homepage / Website.


keywordsOptional
  • Type: java.util.List

Keywords to include in package.json.


licenseOptional
  • Type: java.lang.String
  • Default: "Apache-2.0"

License's SPDX identifier.

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


licensedOptional
  • Type: java.lang.Boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
  • Type: java.lang.String
  • Default: no max

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


minNodeVersionOptional
  • Type: java.lang.String
  • Default: no "engines" specified

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


npmAccessOptional
  • Type: io.github.cdklabs.projen.javascript.NpmAccess
  • Default: for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.

Access level of the npm package.


npmProvenanceOptional
  • Type: java.lang.Boolean
  • Default: true for public packages, false otherwise

Should provenance statements be generated when the package is published.

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

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

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


~~npmRegistry~~Optional
  • Deprecated: use npmRegistryUrl instead

  • Type: java.lang.String

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional

The base URL of the npm package registry.

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


npmTokenSecretOptional
  • Type: java.lang.String
  • Default: "NPM_TOKEN"

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


packageManagerOptional
  • Type: io.github.cdklabs.projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


packageNameOptional
  • Type: java.lang.String
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.PeerDependencyOptions

Options for peerDeps.


peerDepsOptional
  • Type: java.util.List
  • Default: []

Peer dependencies for this module.

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

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

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


pnpmVersionOptional
  • Type: java.lang.String
  • Default: "7"

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


repositoryOptional
  • Type: java.lang.String

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

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


repositoryDirectoryOptional
  • Type: java.lang.String

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


scopedPackagesOptionsOptional
  • Type: java.util.List
  • Default: fetch all scoped packages from the public npm registry

Options for privately hosted scoped packages.


~~scripts~~Optional
  • Deprecated: use project.addTask() or package.setScript()

  • Type: java.util.Map

  • Default: {}

npm scripts to include.

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


stabilityOptional
  • Type: java.lang.String

Package's Stability.


yarnBerryOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.


jsiiReleaseVersionOptional
  • Type: java.lang.String
  • Default: "latest"

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


majorVersionOptional
  • Type: java.lang.Number
  • Default: Major version is not enforced.

Major version to release from the default branch.

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


minMajorVersionOptional
  • Type: java.lang.Number
  • Default: No minimum version is being enforced

Minimal Major version to release.

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

Can not be set together with majorVersion.


npmDistTagOptional
  • Type: java.lang.String
  • Default: "latest"

The npmDistTag to use when publishing from the default branch.

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


postBuildStepsOptional
  • Type: java.util.List
  • Default: []

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


prereleaseOptional
  • Type: java.lang.String
  • Default: normal semantic versions

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


publishDryRunOptional
  • Type: java.lang.Boolean
  • Default: false

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


publishTasksOptional
  • Type: java.lang.Boolean
  • Default: false

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

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


releasableCommitsOptional
  • Type: io.github.cdklabs.projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

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


releaseBranchesOptional
  • Type: java.util.Map
  • Default: no additional branches are used for release. you can use addBranch() to add additional branches.

Defines additional release branches.

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


~~releaseEveryCommit~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead

  • Type: java.lang.Boolean

  • Default: true

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


releaseFailureIssueOptional
  • Type: java.lang.Boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
  • Type: java.lang.String
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


~~releaseSchedule~~Optional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead

  • Type: java.lang.String

  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseTagPrefixOptional
  • Type: java.lang.String
  • Default: "v"

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

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


releaseTriggerOptional
  • Type: io.github.cdklabs.projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


releaseWorkflowNameOptional
  • Type: java.lang.String
  • Default: "release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional
  • Type: java.util.List

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


versionrcOptionsOptional
  • Type: java.util.Map
  • Default: standard configuration applicable for GitHub repositories

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

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


workflowContainerImageOptional
  • Type: java.lang.String
  • Default: default image

Container image to use for GitHub workflows.


workflowRunsOnOptional
  • Type: java.util.List
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflowRunsOnGroupOptional
  • Type: io.github.cdklabs.projen.GroupRunnerOptions

Github Runner Group selection options.


defaultReleaseBranchRequired
  • Type: java.lang.String
  • Default: "main"

The name of the main release branch.


artifactsDirectoryOptional
  • Type: java.lang.String
  • Default: "dist"

A directory which will contain build artifacts.


autoApproveUpgradesOptional
  • Type: java.lang.Boolean
  • Default: true

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

Throw if set to true but autoApproveOptions are not defined.


buildWorkflowOptional
  • Type: java.lang.Boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


buildWorkflowOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


~~buildWorkflowTriggers~~Optional
  • Deprecated: - Use buildWorkflowOptions.workflowTriggers

  • Type: io.github.cdklabs.projen.github.workflows.Triggers

  • Default: "{ pullRequest: {}, workflowDispatch: {} }"

Build workflow triggers.


bundlerOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.BundlerOptions

Options for Bundler.


checkLicensesOptional
  • Type: io.github.cdklabs.projen.javascript.LicenseCheckerOptions
  • Default: no license checks are run during the build and all licenses will be accepted

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

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


codeCovOptional
  • Type: java.lang.Boolean
  • Default: false

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


codeCovTokenSecretOptional
  • Type: java.lang.String
  • Default: if this option is not specified, only public repositories are supported

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


copyrightOwnerOptional
  • Type: java.lang.String
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyrightPeriodOptional
  • Type: java.lang.String
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
  • Type: java.lang.Boolean
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabotOptionsOptional
  • Type: io.github.cdklabs.projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsUpgradeOptional
  • Type: java.lang.Boolean
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


depsUpgradeOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


gitignoreOptional
  • Type: java.util.List

Additional entries to .gitignore.


jestOptional
  • Type: java.lang.Boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.JestOptions
  • Default: default options

Jest options.


~~mutableBuild~~Optional
  • Deprecated: - Use buildWorkflowOptions.mutableBuild

  • Type: java.lang.Boolean

  • Default: true

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

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

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


~~npmignore~~Optional
  • Deprecated: - use project.addPackageIgnore

  • Type: java.util.List

Additional entries to .npmignore.


npmignoreEnabledOptional
  • Type: java.lang.Boolean
  • Default: true

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


npmIgnoreOptionsOptional
  • Type: io.github.cdklabs.projen.IgnoreFileOptions

Configuration options for .npmignore file.


packageOptional
  • Type: java.lang.Boolean
  • Default: true

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


prettierOptional
  • Type: java.lang.Boolean
  • Default: false

Setup prettier.


prettierOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projenDevDependencyOptional
  • Type: java.lang.Boolean
  • Default: true if not a subproject

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


projenrcJsOptional
  • Type: java.lang.Boolean
  • Default: true if projenrcJson is false

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


projenrcJsOptionsOptional
  • Type: io.github.cdklabs.projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenVersionOptional
  • Type: java.lang.String
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
  • Type: java.lang.Boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
  • Type: java.util.List
  • Default: default content

The contents of the pull request template.


releaseOptional
  • Type: java.lang.Boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
  • Type: java.lang.Boolean
  • Default: false

Automatically release to npm when new versions are introduced.


~~releaseWorkflow~~Optional
  • Deprecated: see release.

  • Type: java.lang.Boolean

  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
  • Type: java.util.List
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowGitIdentityOptional
  • Type: io.github.cdklabs.projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflowNodeVersionOptional
  • Type: java.lang.String
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


workflowPackageCacheOptional
  • Type: java.lang.Boolean
  • Default: false

Enable Node.js package cache in GitHub workflows.


typeSpecOptionsRequired

TypeSpec model options.


handlerLanguagesOptional

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


asyncApiSpecFileRequired
  • Type: java.lang.String

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


parsedSpecFileRequired
  • Type: java.lang.String

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

addExcludeFromCleanup
public void addExcludeFromCleanup(java.lang.String globs)

Exclude the matching files from pre-synth cleanup.

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

globsRequired
  • Type: java.lang.String

The glob patterns to match.


addGitIgnore
public void addGitIgnore(java.lang.String pattern)

Adds a .gitignore pattern.

patternRequired
  • Type: java.lang.String

The glob pattern to ignore.


addPackageIgnore
public void addPackageIgnore(java.lang.String pattern)

Adds patterns to be ignored by npm.

patternRequired
  • Type: java.lang.String

The pattern to ignore.


addTask
public Task addTask(java.lang.String name)
public Task addTask(java.lang.String name, TaskOptions props)

Adds a new task to this project.

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

nameRequired
  • Type: java.lang.String

The task name to add.


propsOptional
  • Type: io.github.cdklabs.projen.TaskOptions

Task properties.


~~addTip~~
public void addTip(java.lang.String message)

Prints a "tip" message during synthesis.

messageRequired
  • Type: java.lang.String

The message.


annotateGenerated
public void annotateGenerated(java.lang.String glob)

Marks the provided file(s) as being generated.

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

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

globRequired
  • Type: java.lang.String

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


postSynthesize
public void postSynthesize()

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before all components are synthesized.

removeTask
public Task removeTask(java.lang.String name)

Removes a task from a project.

nameRequired
  • Type: java.lang.String

The name of the task to remove.


runTaskCommand
public java.lang.String runTaskCommand(Task task)

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

This will typically be npx projen TASK.

taskRequired
  • Type: io.github.cdklabs.projen.Task

The task for which the command is required.


synth
public void synth()

Synthesize all project files into outdir.

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

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

filePathRequired
  • Type: java.lang.String

The file path.

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


~~tryFindJsonFile~~
public JsonFile tryFindJsonFile(java.lang.String filePath)

Finds a json file by name.

filePathRequired
  • Type: java.lang.String

The file path.


tryFindObjectFile
public ObjectFile tryFindObjectFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.


tryRemoveFile
public FileBase tryRemoveFile(java.lang.String filePath)

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

filePathRequired
  • Type: java.lang.String

The file path.

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


addBins
public void addBins(java.util.Map<java.lang.String, java.lang.String> bins)
binsRequired
  • Type: java.util.Map

addBundledDeps
public void addBundledDeps(java.lang.String deps)

Defines bundled dependencies.

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

depsRequired
  • Type: java.lang.String

Names modules to install.

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


~~addCompileCommand~~
public void addCompileCommand(java.lang.String commands)

DEPRECATED.

commandsRequired
  • Type: java.lang.String

addDeps
public void addDeps(java.lang.String deps)

Defines normal dependencies.

depsRequired
  • Type: java.lang.String

Names modules to install.

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


addDevDeps
public void addDevDeps(java.lang.String deps)

Defines development/test dependencies.

depsRequired
  • Type: java.lang.String

Names modules to install.

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


addFields
public void addFields(java.util.Map<java.lang.String, java.lang.Object> fields)

Directly set fields in package.json.

fieldsRequired
  • Type: java.util.Map

The fields to set.


addKeywords
public void addKeywords(java.lang.String keywords)

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: java.lang.String

The keywords to add.


addPeerDeps
public void addPeerDeps(java.lang.String deps)

Defines peer dependencies.

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

depsRequired
  • Type: java.lang.String

Names modules to install.

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


addScripts
public void addScripts(java.util.Map<java.lang.String, java.lang.String> scripts)

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: java.util.Map

The scripts to set.


~~addTestCommand~~
public void addTestCommand(java.lang.String commands)

DEPRECATED.

commandsRequired
  • Type: java.lang.String

~~hasScript~~
public java.lang.Boolean hasScript(java.lang.String name)

Indicates if a script by the name name is defined.

nameRequired
  • Type: java.lang.String

The name of the script.


removeScript
public void removeScript(java.lang.String name)

Removes the npm script (always successful).

nameRequired
  • Type: java.lang.String

The name of the script.


renderWorkflowSetup
public java.util.List<JobStep> renderWorkflowSetup()
public java.util.List<JobStep> renderWorkflowSetup(RenderWorkflowSetupOptions options)

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

optionsOptional
  • Type: io.github.cdklabs.projen.javascript.RenderWorkflowSetupOptions

Options.


setScript
public void setScript(java.lang.String name, java.lang.String command)

Replaces the contents of an npm package.json script.

nameRequired
  • Type: java.lang.String

The script name.


commandRequired
  • Type: java.lang.String

The command to execute.


Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSpecAsyncModelProject;

TypeSpecAsyncModelProject.isConstruct(java.lang.Object x)

Checks if x is a construct.

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

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

xRequired
  • Type: java.lang.Object

Any object.


isProject
import software.aws.pdk.type_safe_api.TypeSpecAsyncModelProject;

TypeSpecAsyncModelProject.isProject(java.lang.Object x)

Test whether the given construct is a project.

xRequired
  • Type: java.lang.Object

of
import software.aws.pdk.type_safe_api.TypeSpecAsyncModelProject;

TypeSpecAsyncModelProject.of(IConstruct construct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: software.constructs.IConstruct

Properties

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

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


buildTaskRequired
public Task getBuildTask();
  • Type: io.github.cdklabs.projen.Task

commitGeneratedRequired
public java.lang.Boolean getCommitGenerated();
  • Type: java.lang.Boolean

Whether to commit the managed files by default.


compileTaskRequired
public Task getCompileTask();
  • Type: io.github.cdklabs.projen.Task

componentsRequired
public java.util.List<Component> getComponents();
  • Type: java.util.List

Returns all the components within this project.


depsRequired
public Dependencies getDeps();
  • Type: io.github.cdklabs.projen.Dependencies

Project dependencies.


ejectedRequired
public java.lang.Boolean getEjected();
  • Type: java.lang.Boolean

Whether or not the project is being ejected.


filesRequired
public java.util.List<FileBase> getFiles();
  • Type: java.util.List

All files in this project.


gitattributesRequired
public GitAttributesFile getGitattributes();
  • Type: io.github.cdklabs.projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public IgnoreFile getGitignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

.gitignore.


loggerRequired
public Logger getLogger();
  • Type: io.github.cdklabs.projen.Logger

Logging utilities.


nameRequired
public java.lang.String getName();
  • Type: java.lang.String

Project name.


outdirRequired
public java.lang.String getOutdir();
  • Type: java.lang.String

Absolute output directory of this project.


packageTaskRequired
public Task getPackageTask();
  • Type: io.github.cdklabs.projen.Task

postCompileTaskRequired
public Task getPostCompileTask();
  • Type: io.github.cdklabs.projen.Task

preCompileTaskRequired
public Task getPreCompileTask();
  • Type: io.github.cdklabs.projen.Task

projectBuildRequired
public ProjectBuild getProjectBuild();
  • Type: io.github.cdklabs.projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public java.lang.String getProjenCommand();
  • Type: java.lang.String

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


rootRequired
public Project getRoot();
  • Type: io.github.cdklabs.projen.Project

The root project.


subprojectsRequired
public java.util.List<Project> getSubprojects();
  • Type: java.util.List

Returns all the subprojects within this project.


tasksRequired
public Tasks getTasks();
  • Type: io.github.cdklabs.projen.Tasks

Project tasks.


testTaskRequired
public Task getTestTask();
  • Type: io.github.cdklabs.projen.Task

defaultTaskOptional
public Task getDefaultTask();
  • Type: io.github.cdklabs.projen.Task

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

Undefined if the project is being ejected.


initProjectOptional
public InitProject getInitProject();
  • Type: io.github.cdklabs.projen.InitProject

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

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


parentOptional
public Project getParent();
  • Type: io.github.cdklabs.projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
public ProjectType getProjectType();
  • Type: io.github.cdklabs.projen.ProjectType

autoApproveOptional
public AutoApprove getAutoApprove();
  • Type: io.github.cdklabs.projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
public DevContainer getDevContainer();
  • Type: io.github.cdklabs.projen.vscode.DevContainer

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

This will be undefined if devContainer boolean is false


githubOptional
public GitHub getGithub();
  • Type: io.github.cdklabs.projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
public Gitpod getGitpod();
  • Type: io.github.cdklabs.projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
public VsCode getVscode();
  • Type: io.github.cdklabs.projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


~~allowLibraryDependencies~~Required
  • Deprecated: use package.allowLibraryDependencies
public java.lang.Boolean getAllowLibraryDependencies();
  • Type: java.lang.Boolean

artifactsDirectoryRequired
public java.lang.String getArtifactsDirectory();
  • Type: java.lang.String

The build output directory.

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


artifactsJavascriptDirectoryRequired
public java.lang.String getArtifactsJavascriptDirectory();
  • Type: java.lang.String

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


bundlerRequired
public Bundler getBundler();
  • Type: io.github.cdklabs.projen.javascript.Bundler

~~entrypoint~~Required
  • Deprecated: use package.entrypoint
public java.lang.String getEntrypoint();
  • Type: java.lang.String

~~manifest~~Required
  • Deprecated: use package.addField(x, y)
public java.lang.Object getManifest();
  • Type: java.lang.Object

npmrcRequired
public NpmConfig getNpmrc();
  • Type: io.github.cdklabs.projen.javascript.NpmConfig

The .npmrc file.


packageRequired
public NodePackage getPackage();
  • Type: io.github.cdklabs.projen.javascript.NodePackage

API for managing the node package.


~~packageManager~~Required
  • Deprecated: use package.packageManager
public NodePackageManager getPackageManager();
  • Type: io.github.cdklabs.projen.javascript.NodePackageManager

The package manager to use.


runScriptCommandRequired
public java.lang.String getRunScriptCommand();
  • Type: java.lang.String

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


autoMergeOptional
public AutoMerge getAutoMerge();
  • Type: io.github.cdklabs.projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


buildWorkflowOptional
public BuildWorkflow getBuildWorkflow();
  • Type: io.github.cdklabs.projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


buildWorkflowJobIdOptional
public java.lang.String getBuildWorkflowJobId();
  • Type: java.lang.String

The job ID of the build workflow.


jestOptional
public Jest getJest();
  • Type: io.github.cdklabs.projen.javascript.Jest

The Jest configuration (if enabled).


maxNodeVersionOptional
public java.lang.String getMaxNodeVersion();
  • Type: java.lang.String

Maximum node version required by this package.


minNodeVersionOptional
public java.lang.String getMinNodeVersion();
  • Type: java.lang.String

Minimum node.js version required by this package.


npmignoreOptional
public IgnoreFile getNpmignore();
  • Type: io.github.cdklabs.projen.IgnoreFile

The .npmignore file.


prettierOptional
public Prettier getPrettier();
  • Type: io.github.cdklabs.projen.javascript.Prettier

~~publisher~~Optional
  • Deprecated: use release.publisher.
public Publisher getPublisher();
  • Type: io.github.cdklabs.projen.release.Publisher

Package publisher.

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


releaseOptional
public Release getRelease();
  • Type: io.github.cdklabs.projen.release.Release

Release management.


upgradeWorkflowOptional
public UpgradeDependencies getUpgradeWorkflow();
  • Type: io.github.cdklabs.projen.javascript.UpgradeDependencies

The upgrade workflow.


apiNameRequired
public java.lang.String getApiName();
  • Type: java.lang.String

definitionRequired
public TypeSpecAsyncDefinition getDefinition();

Constants

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

DEFAULT_TASKRequired
public java.lang.String getDefaultTask();
  • Type: java.lang.String

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

Normally this task should synthesize the project files.


TypeSpecDefinition

The TypeSpec model definition.

Initializers

import software.aws.pdk.type_safe_api.TypeSpecDefinition;

TypeSpecDefinition.Builder.create(NodeProject project)
    .typeSpecOptions(TypeSpecModelOptions)
//  .handlerLanguages(java.util.List<Language>)
    .build();
Name Type Description
project io.github.cdklabs.projen.javascript.NodeProject No description.
typeSpecOptions TypeSpecModelOptions TypeSpec model options.
handlerLanguages java.util.List<Language> The languages users have specified for handler projects (if any).

projectRequired
  • Type: io.github.cdklabs.projen.javascript.NodeProject

typeSpecOptionsRequired

TypeSpec model options.


handlerLanguagesOptional

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


Methods

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

toString
public java.lang.String toString()

Returns a string representation of this construct.

postSynthesize
public void postSynthesize()

Called after synthesis.

Order is not guaranteed.

preSynthesize
public void preSynthesize()

Called before synthesis.

synthesize
public void synthesize()

Synthesizes files to the project output directory.

Static Functions

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

isConstruct
import software.aws.pdk.type_safe_api.TypeSpecDefinition;

TypeSpecDefinition.isConstruct(<