@aws-cdk_cli-lib-alpha.ICloudAssemblyDirectoryProducer

interface ICloudAssemblyDirectoryProducer ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.Cli.Lib.Alpha.ICloudAssemblyDirectoryProducer
Gogithub.com/aws/aws-cdk-go/awscdkclilibalpha/v2#ICloudAssemblyDirectoryProducer
Javasoftware.amazon.awscdk.cli.lib.alpha.ICloudAssemblyDirectoryProducer
Pythonaws_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

NameTypeDescription
workingDirectory?๐Ÿ”นstringThe 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

NameDescription
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;
  }
}