App
A construct which represents an entire CDK app. This construct is normally the root of the construct tree.
You would normally define an 'App' instance in your program's entrypoint, then define constructs where the app is used as the parent scope.
After all the child constructs are defined within the app, you should call 'app.synth()' which will emit a "ros template" from this app into the directory specified by 'outdir'.
Initializers
import { App } from '@alicloud/ros-cdk-core'
new App(props?: AppProps)
Name | Type | Description |
---|---|---|
props |
AppProps |
initialization properties. |
props
Optional
- Type: AppProps
initialization properties.
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
synth |
Synthesize this stage into a cloud assembly. |
toString
public toString(): string
Returns a string representation of this construct.
synthesize
public synthesize(session: ISynthesisSession): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
- Type: ISynthesisSession
The synthesis session.
synth
public synth(options?: StageSynthesisOptions): CloudAssembly
Synthesize this stage into a cloud assembly.
Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.
- Type: StageSynthesisOptions
Static Functions
Name | Description |
---|---|
isConstruct |
Return whether the given object is a Construct. |
isStage |
Test whether the given construct is a stage. |
of |
Return the stage this construct is contained with, if available. |
isApp |
Checks if an object is an instance of the 'App' class. |
isConstruct
import { App } from '@alicloud/ros-cdk-core'
App.isConstruct(x: any)
Return whether the given object is a Construct.
- Type: any
isStage
import { App } from '@alicloud/ros-cdk-core'
App.isStage(x: any)
Test whether the given construct is a stage.
- Type: any
of
import { App } from '@alicloud/ros-cdk-core'
App.of(construct: IConstruct)
Return the stage this construct is contained with, if available.
If called on a nested stage, returns its parent.
- Type: IConstruct
isApp
import { App } from '@alicloud/ros-cdk-core'
App.isApp(obj: any)
Checks if an object is an instance of the 'App' class.
Returns 'true' if 'obj' is an 'App'. Param obj The object to evaluate
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
ConstructNode |
The construct tree node associated with this construct. |
artifactId |
string |
Artifact ID of the assembly if it is a nested stage. The root stage app will return an empty string. |
assetOutdir |
string |
The cloud assembly asset output directory. |
outdir |
string |
The cloud assembly output directory. |
stageName |
string |
The name of the stage. |
account |
string |
The default account for all resources defined within this stage. |
parentStage |
Stage |
The parent stage or 'undefined' if this is the app. |
region |
string |
The default region for all resources defined within this stage. |
node
Required
public readonly node: ConstructNode;
- Type: ConstructNode
The construct tree node associated with this construct.
artifactId
Required
public readonly artifactId: string;
- Type: string
Artifact ID of the assembly if it is a nested stage. The root stage app will return an empty string.
Derived from the construct path.
assetOutdir
Required
public readonly assetOutdir: string;
- Type: string
The cloud assembly asset output directory.
outdir
Required
public readonly outdir: string;
- Type: string
The cloud assembly output directory.
stageName
Required
public readonly stageName: string;
- Type: string
The name of the stage.
Based on names of the parent stages separated by hypens.
account
Optional
public readonly account: string;
- Type: string
The default account for all resources defined within this stage.
parentStage
Optional
public readonly parentStage: Stage;
- Type: Stage
The parent stage or 'undefined' if this is the app.
*
region
Optional
public readonly region: string;
- Type: string
The default region for all resources defined within this stage.