Class StackReference


public class StackReference extends CustomResource
Manages a reference to a Pulumi stack and provides access to the referenced stack's outputs.
  • Constructor Details

    • StackReference

      public StackReference(String name)
      Create a StackReference resource with the given unique name.

      The name of the referenced stack will be the name of the StackReference resource.

      Parameters:
      name - The unique name of the stack reference.
      See Also:
    • StackReference

      public StackReference(String name, @Nullable StackReferenceArgs args)
      Create a StackReference resource with the given unique name, arguments.

      If args is not specified, the name of the referenced stack will be the name of the StackReference resource.

      Parameters:
      name - The unique name of the stack reference.
      args - The arguments to use to populate this resource's properties.
      See Also:
    • StackReference

      public StackReference(String name, @Nullable StackReferenceArgs args, @Nullable CustomResourceOptions options)
      Create a 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 StackReference resource.

      Parameters:
      name - The unique name of the stack reference.
      args - The arguments to use to populate this resource's properties.
      options - A bag of options that control this resource's behavior.
  • Method Details

    • name

      public Output<String> name()
      The name of the referenced stack.
      Returns:
      the stack name
    • outputs

      public Output<Map<String,Object>> outputs()
      The outputs of the referenced stack.
      Returns:
      the stack outputs
    • secretOutputNames

      public Output<List<String>> secretOutputNames()
      The secret output names of the referenced stack.
      Returns:
      the names of the secret outputs
    • output

      public Output<?> output(String name)
      Fetches the value of the named stack output, or null if the stack output was not found.
      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      An Output containing the requested value.
    • output

      public Output<?> output(Output<String> name)
      Fetches the value of the named stack output, or null if the stack output was not found.
      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      An Output containing the requested value.
    • requireOutput

      public Output<?> requireOutput(String name)
      Fetches the value of the named stack output, or throws an error if the output was not found.
      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      An Output containing the requested value.
    • requireOutput

      public Output<?> requireOutput(Output<String> name)
      Fetches the value of the named stack output, or throws an error if the output was not found.
      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      An Output containing the requested value.
    • outputDetailsAsync

      public CompletableFuture<StackReferenceOutputDetails> outputDetailsAsync(String name)
      Fetches the value of the named stack output and builds a StackReferenceOutputDetails object from it. The StackReferenceOutputDetails object has its value or secretValue set depending on whether the output is a secret or not.
    • getValueAsync

      public CompletableFuture<?> getValueAsync(String name)
      Fetches the value of the named stack output. May return null if the value is not known for some reason.

      This operation is not supported (and will throw) for secret outputs.

      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      The value of the referenced stack output.
      Throws:
      UnsupportedOperationException - if the output is secret
    • getValueAsync

      public CompletableFuture<?> getValueAsync(Output<String> name)
      Fetches the value of the named stack output. May return null if the value is not known for some reason.

      This operation is not supported (and will throw) for secret outputs.

      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      The value of the referenced stack output.
      Throws:
      UnsupportedOperationException - if the output is secret
    • requireValueAsync

      public CompletableFuture<?> requireValueAsync(String name)
      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) for secret outputs.

      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      The value of the referenced stack output.
    • requireValueAsync

      public CompletableFuture<?> requireValueAsync(Output<String> name)
      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) for secret outputs.

      Parameters:
      name - The name of the stack output to fetch.
      Returns:
      The value of the referenced stack output.