Add Go SDK stack output helpers for String and ID (#4341)
This commit is contained in:
parent
46dababc28
commit
7382de6b5f
|
@ -29,6 +29,9 @@ CHANGELOG
|
|||
- Add overloads to Output.All in .NET
|
||||
[#4321](https://github.com/pulumi/pulumi/pull/4321)
|
||||
|
||||
- Add helper methods for stack outputs in the Go SDK
|
||||
[#4341](https://github.com/pulumi/pulumi/pull/4341)
|
||||
|
||||
- Add additional overloads to Deployment.RunAsync in .NET API.
|
||||
[#4286](https://github.com/pulumi/pulumi/pull/4286)
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ type StackReference struct {
|
|||
Outputs MapOutput `pulumi:"outputs"`
|
||||
}
|
||||
|
||||
// GetOutput returns a stack output keyed by the given name as an AnyOutput
|
||||
func (s *StackReference) GetOutput(name StringInput) AnyOutput {
|
||||
return All(name, s.Outputs).
|
||||
ApplyT(func(args []interface{}) interface{} {
|
||||
|
@ -20,6 +21,20 @@ func (s *StackReference) GetOutput(name StringInput) AnyOutput {
|
|||
}).(AnyOutput)
|
||||
}
|
||||
|
||||
// GetStringOutput returns a stack output keyed by the given name as an StringOutput
|
||||
func (s *StackReference) GetStringOutput(name StringInput) StringOutput {
|
||||
return s.GetOutput(name).ApplyString(func(v interface{}) string {
|
||||
return v.(string)
|
||||
})
|
||||
}
|
||||
|
||||
// GetIDOutput returns a stack output keyed by the given name as an IDOutput
|
||||
func (s *StackReference) GetIDOutput(name StringInput) IDOutput {
|
||||
return s.GetOutput(name).ApplyID(func(v interface{}) ID {
|
||||
return ID(v.(string))
|
||||
})
|
||||
}
|
||||
|
||||
type stackReferenceArgs struct {
|
||||
Name string `pulumi:"name"`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue