How to use the @aws-cdk/cx-api.CloudAssemblyBuilder function in @aws-cdk/cx-api

To help you get started, we’ve selected a few @aws-cdk/cx-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / core / lib / construct.ts View on Github external
public static synth(root: ConstructNode, options: SynthesisOptions = { }): cxapi.CloudAssembly {
    const builder = new cxapi.CloudAssemblyBuilder(options.outdir);

    // the three holy phases of synthesis: prepare, validate and synthesize

    // prepare
    this.prepare(root);

    // validate
    const validate = options.skipValidation === undefined ? true : !options.skipValidation;
    if (validate) {
      const errors = this.validate(root);
      if (errors.length > 0) {
        const errorList = errors.map(e => `[${e.source.node.path}] ${e.message}`).join('\n  ');
        throw new Error(`Validation failed with the following errors:\n  ${errorList}`);
      }
    }
github aws / aws-cdk / packages / @aws-cdk / cdk / lib / synthesis.ts View on Github external
public synthesize(root: IConstruct, options: SynthesisOptions = { }): CloudAssembly {
    const session = new CloudAssemblyBuilder(options.outdir);

    // the three holy phases of synthesis: prepare, validate and synthesize

    // prepare
    root.node.prepareTree();

    // validate
    const validate = options.skipValidation === undefined ? true : !options.skipValidation;
    if (validate) {
      const errors = root.node.validateTree();
      if (errors.length > 0) {
        const errorList = errors.map(e => `[${e.source.node.path}] ${e.message}`).join('\n  ');
        throw new Error(`Validation failed with the following errors:\n  ${errorList}`);
      }
    }