import { Input, Output } from "./output"; import { CustomResource, CustomResourceOptions } from "./resource"; /** * Manages a reference to a Pulumi stack. The referenced stack's outputs are * available via the {@link StackReference.outputs} property or the * {@link StackReference.output} method. */ export declare class StackReference extends CustomResource { /** * The name of the referenced stack. */ readonly name: Output; /** * The outputs of the referenced stack. */ readonly outputs: Output<{ [name: string]: any; }>; /** * The names of any stack outputs which contain secrets. */ readonly secretOutputNames: Output; /** * Create a {@link StackReference} resource with the given unique name, * arguments, and options. * * If args is not specified, the name of the referenced stack will be the * name of the {@link StackReference} resource. * * @param name * The _unique_ name of the stack reference. * @param args * The arguments to use to populate this resource's properties. * @param opts * A bag of options that control this resource's behavior. */ constructor(name: string, args?: StackReferenceArgs, opts?: CustomResourceOptions); /** * Fetches the value of the named stack output, or `undefined` if the stack * output was not found. * * @param name * The name of the stack output to fetch. */ getOutput(name: Input): Output; /** * Fetches the value of the named stack output, or throws an error if the * output was not found. * * @param name * The name of the stack output to fetch. */ requireOutput(name: Input): Output; /** * Fetches the value of the named stack output and builds a * {@link StackReferenceOutputDetails} with it. * * The returned object has its `value` or `secretValue` fields set depending * on whether the output is a secret. Neither field is set if the output was * not found. * * @param name * The name of the stack output to fetch. */ getOutputDetails(name: string): Promise; /** * Fetches the value promptly of the named stack output. May return * undefined if the value is not known for some reason. * * This operation is not supported (and will throw) if the named stack * output is a secret. * * @param name * The name of the stack output to fetch. */ getOutputValue(name: string): Promise; /** * Fetches the value promptly of the named stack output. Throws an error if * the stack output is not found. * * This operation is not supported (and will throw) if the named stack * output is a secret. * * @param name * The name of the stack output to fetch. */ requireOutputValue(name: string): Promise; private readOutputValue; } /** * The set of arguments for constructing a {@link StackReference} resource. */ export interface StackReferenceArgs { /** * The name of the stack to reference. */ readonly name?: Input; } /** * Records the output of a {@link StackReference}. Exactly one of `value` or * `secretValue` will be set. */ export interface StackReferenceOutputDetails { /** * An output value returned by the {@link StackReference}. * * This is `null` if the value is a secret or it does not exist. */ readonly value?: any; /** * A secret value returned by the {@link StackReference}. * * This is `null` if the value is not a secret or it does not exist. */ readonly secretValue?: any; }