Amplify Toolbox
    Preparing search index...

    Function getStageConfig

    • Get the current pipeline stage configuration during synthesis.

      Returns the stage config when called inside a pipeline context (i.e., during stageFactory execution). Returns undefined when not running inside a pipeline, allowing application code to work in both standalone and pipeline modes.

      Type Parameters

      • T = Record<string, unknown>

        Shape of the user-defined config field in stage configuration.

      Returns PipelineStageConfig<T> & { name: string } | undefined

      The current stage configuration including name, or undefined if not in pipeline context.

      const stageConfig = getStageConfig<{ domain: string }>();
      if (stageConfig) {
      // Running inside pipeline — use stage-specific config
      console.log(`Deploying stage: ${stageConfig.name}`);
      console.log(`Domain: ${stageConfig.config?.domain}`);
      } else {
      // Running standalone (e.g., `cdk synth`)
      }