Interface ICloudAssemblyDirectoryProducer

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
ICloudAssemblyDirectoryProducer.Jsii$Default
All Known Implementing Classes:
ICloudAssemblyDirectoryProducer.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:15.417Z") @Stability(Experimental) public interface ICloudAssemblyDirectoryProducer extends software.amazon.jsii.JsiiSerializable
(experimental) 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.

  • Method Details

    • getWorkingDirectory

      @Stability(Experimental) @Nullable default String getWorkingDirectory()
      (experimental) The working directory used to run the Cloud Assembly from.

      This is were a cdk.context.json files will be written.

      Default: - current working directory

    • setWorkingDirectory

      @Optional default void setWorkingDirectory(@Nullable String value)
      (experimental) The working directory used to run the Cloud Assembly from.

      This is were a cdk.context.json files will be written.

      Default: - current working directory

    • produce

      @Stability(Experimental) @NotNull String produce(@NotNull Map<String,Object> context)
      (experimental) 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:

       public class MyProducer implements ICloudAssemblyDirectoryProducer {
           public Promise produce(Map<String, Object> context) {
               App app = App.Builder.create().context(context).build();
               // create stacks here
               return app.synth().getDirectory();
           }
       }
       

      Parameters:
      context - This parameter is required.