Show / Hide Table of Contents

Class StackReference

Manages a reference to a Pulumi stack and provides access to the referenced stack's outputs.

Inheritance
object
Resource
CustomResource
StackReference
Inherited Members
CustomResource.Id
Resource.Urn
Resource.GetResourceType()
Resource.GetResourceName()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Pulumi
Assembly: Pulumi.dll
Syntax
public class StackReference : CustomResource

Constructors

View Source

StackReference(string, StackReferenceArgs?, CustomResourceOptions?)

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.
Declaration
public StackReference(string name, StackReferenceArgs? args = null, CustomResourceOptions? options = null)
Parameters
Type Name Description
string name

The unique name of the stack reference.

StackReferenceArgs args

The arguments to use to populate this resource's properties.

CustomResourceOptions options

A bag of options that control this resource's behavior.

Properties

View Source

Name

The name of the referenced stack.

Declaration
[Output("name")]
public Output<string> Name { get; }
Property Value
Type Description
Output<string>
View Source

Outputs

The outputs of the referenced stack.

Declaration
[Output("outputs")]
public Output<ImmutableDictionary<string, object>> Outputs { get; }
Property Value
Type Description
Output<ImmutableDictionary<string, object>>
View Source

SecretOutputNames

The names of any stack outputs which contain secrets.

Declaration
[Output("secretOutputNames")]
public Output<ImmutableArray<string>> SecretOutputNames { get; }
Property Value
Type Description
Output<ImmutableArray<string>>

Methods

View Source

GetOutput(Input<string>)

Fetches the value of the named stack output, or null if the stack output was not found.

Declaration
public Output<object?> GetOutput(Input<string> name)
Parameters
Type Name Description
Input<string> name

The name of the stack output to fetch.

Returns
Type Description
Output<object>

An Output<T> containing the requested value.

View Source

GetOutputDetailsAsync(string)

Fetches the value of the named stack output and builds a object from it.

The returned object has its Value or SecretValue field set depending on whether the output is a secret. Neither field is set if the output is not found.
Declaration
public Task<StackReferenceOutputDetails> GetOutputDetailsAsync(string name)
Parameters
Type Name Description
string name

The name of the stack output to fetch.

Returns
Type Description
Task<StackReferenceOutputDetails>

StackReferenceOutputDetails object containing the output.

View Source

GetValueAsync(Input<string>)

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.
Declaration
public Task<object?> GetValueAsync(Input<string> name)
Parameters
Type Name Description
Input<string> name

The name of the stack output to fetch.

Returns
Type Description
Task<object>

The value of the referenced stack output.

View Source

RequireOutput(Input<string>)

Fetches the value of the named stack output, or throws an error if the output was not found.

Declaration
public Output<object> RequireOutput(Input<string> name)
Parameters
Type Name Description
Input<string> name

The name of the stack output to fetch.

Returns
Type Description
Output<object>

An Output<T> containing the requested value.

View Source

RequireValueAsync(Input<string>)

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.
Declaration
public Task<object> RequireValueAsync(Input<string> name)
Parameters
Type Name Description
Input<string> name

The name of the stack output to fetch.

Returns
Type Description
Task<object>

The value of the referenced stack output.

  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.