Skip to main content
Represents a cdktn application.

Initializers

import cdktn

cdktn.App(
  context: typing.Mapping[typing.Any] = None,
  hcl_output: bool = None,
  outdir: str = None,
  skip_backend_validation: bool = None,
  skip_validation: bool = None,
  stack_traces: bool = None
)
NameTypeDescription
contexttyping.Mapping[typing.Any]Additional context values for the application.
hcl_outputboolNo description.
outdirstrThe directory to output Terraform resources.
skip_backend_validationboolWhether to skip backend validation during synthesis of the app.
skip_validationboolWhether to skip all validations during synthesis of the app.
stack_tracesboolNo description.

contextOptional

  • Type: typing.Mapping[typing.Any]
  • Default: no additional context
Additional context values for the application. Context set by the CLI or the context key in cdktf.json has precedence. Context can be read from any construct using node.getContext(key).

hcl_outputOptional

  • Type: bool

outdirOptional

  • Type: str
  • Default: CDKTF_OUTDIR if defined, otherwise “cdktf.out”
The directory to output Terraform resources. If you are using the CDKTN CLI, this value is automatically set from one of the following three sources:
  • The -o / --output CLI option
  • The CDKTF_OUTDIR environment variable
  • The outdir key in cdktf.json
If you are using the CDKTN CLI and want to set a different value here, you will also need to set the same value via one of the three ways specified above. The most common case to set this value is when you are using the CDKTN library directly (e.g. when writing unit tests).

skip_backend_validationOptional

  • Type: bool
  • Default: false
Whether to skip backend validation during synthesis of the app.

skip_validationOptional

  • Type: bool
  • Default: false
Whether to skip all validations during synthesis of the app.

stack_tracesOptional

  • Type: bool

Methods

NameDescription
to_stringReturns a string representation of this construct.
cross_stack_referenceCreates a reference from one stack to another, invoked on prepareStack since it creates extra resources.
synthSynthesizes all resources to the output directory.

to_string

def to_string() -> str
Returns a string representation of this construct.

cross_stack_reference

def cross_stack_reference(
  from_stack: TerraformStack,
  to_stack: TerraformStack,
  identifier: str
) -> str
Creates a reference from one stack to another, invoked on prepareStack since it creates extra resources.

from_stackRequired


to_stackRequired


identifierRequired

  • Type: str

synth

def synth() -> None
Synthesizes all resources to the output directory.

Static Functions

NameDescription
is_constructChecks if x is a construct.
is_appNo description.
ofNo description.

is_construct

import cdktn

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

xRequired

  • Type: typing.Any
Any object.

is_app

import cdktn

cdktn.App.is_app(
  x: typing.Any
)

xRequired

  • Type: typing.Any

of

import cdktn

cdktn.App.of(
  construct: IConstruct
)

constructRequired

  • Type: constructs.IConstruct

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
hcl_outputboolNo description.
manifestManifestNo description.
outdirstrThe output directory into which resources will be synthesized.
skip_backend_validationboolWhether to skip backend validation during synthesis of the app.
skip_validationboolWhether to skip all validations during synthesis of the app.
target_stack_idstrThe stack which will be synthesized.

nodeRequired

node: Node
  • Type: constructs.Node
The tree node.

hcl_outputRequired

hcl_output: bool
  • Type: bool

manifestRequired

manifest: Manifest

outdirRequired

outdir: str
  • Type: str
The output directory into which resources will be synthesized.

skip_backend_validationRequired

skip_backend_validation: bool
  • Type: bool
Whether to skip backend validation during synthesis of the app.

skip_validationRequired

skip_validation: bool
  • Type: bool
Whether to skip all validations during synthesis of the app.

target_stack_idOptional

target_stack_id: str
  • Type: str
The stack which will be synthesized. If not set, all stacks will be synthesized.