interface ICloudAssemblyDirectoryProducer
Language | Type name |
---|---|
.NET | Amazon.CDK.Cli.Lib.Alpha.ICloudAssemblyDirectoryProducer |
Go | github.com/aws/aws-cdk-go/awscdkclilibalpha/v2#ICloudAssemblyDirectoryProducer |
Java | software.amazon.awscdk.cli.lib.alpha.ICloudAssemblyDirectoryProducer |
Python | aws_cdk.cli_lib_alpha.ICloudAssemblyDirectoryProducer |
TypeScript (source) | @aws-cdk/cli-lib-alpha » ICloudAssemblyDirectoryProducer |
A class returning the path to a Cloud Assembly Directory when its produce
method is invoked with the current context AWS CDK apps might need to be synthesized multiple times with additional context values before they are ready.
When running the CLI from inside a directory, this is implemented by invoking the app multiple times.
Here the produce()
method provides this multi-pass ability.
Properties
Name | Type | Description |
---|---|---|
working | string | The working directory used to run the Cloud Assembly from. |
workingDirectory?
Type:
string
(optional, default: current working directory)
The working directory used to run the Cloud Assembly from.
This is were a cdk.context.json
files will be written.
Methods
Name | Description |
---|---|
produce(context) | Synthesize a Cloud Assembly directory for a given context. |
produce(context)
public produce(context: { [string]: any }): string
Parameters
- context
{ [string]: any }
Returns
string
Synthesize a Cloud Assembly directory for a given context.
For all features to work correctly, cdk.App()
must be instantiated with the received context values in the method body.
Usually obtained similar to this:
class MyProducer implements ICloudAssemblyDirectoryProducer {
async produce(context: Record<string, any>) {
const app = new cdk.App({ context });
// create stacks here
return app.synth().directory;
}
}