Output

besom.internal.Output
See theOutput companion object
class Output[+A]

Output is a wrapper for a monadic effect used to model async execution that allows Pulumi to track information about dependencies between resources and properties of data (whether it's known or a secret for instance).

Invariant: dataResult has to be registered in TaskTracker by the time it reaches the constructor here.

Value parameters

ctx

the Besom Context

dataResult

Effect of type Result[A]

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Turns a secret into a plaintext! Only use if you know what you're doing.

Turns a secret into a plaintext! Only use if you know what you're doing.

THIS IS UNSAFE AND SHOULD BE USED WITH EXTREME CAUTION.

Attributes

Returns

a plaintext Output, the value is no longer a secret

def asSecret: Output[A]

Turns a plaintext into a secret.

Turns a plaintext into a secret.

This is useful when you have a value that is sensitive in nature, such as a password or cryptographic key, that you don't want to be exposed.

Attributes

Returns

a secret Output, the value is now a secret

def flatMap[B](f: A => Output[B]): Output[B]

Flat-maps the value of the Output using the given function.

Flat-maps the value of the Output using the given function.

Type parameters

B

the type of the value

Value parameters

f

the function to apply to the value

Attributes

Returns

an Output with the flat-mapped value

See also

flatMap(A => F[B]) for flat-mapping with an effectful function

def flatMap[F[_] : ToFuture, B](f: A => F[B]): Output[B]

Flat-maps the value of the Output using the given effectful function.

Flat-maps the value of the Output using the given effectful function.

Type parameters

B

the type of the value

F

the effect type

Value parameters

f

the effectful function to apply to the value

Attributes

Returns

an Output with the flat-mapped value

See also

flatMap(A => Output[B]) for flat-mapping with Output-returning function

inline def flatMap[B](f: A => B): Nothing

Mock variant of flatMap that will fail at compile time if used with a function that returns a value instead of an Output.

Mock variant of flatMap that will fail at compile time if used with a function that returns a value instead of an Output.

Value parameters

f

function to apply to the value of the Output

Attributes

def flatten[B](using ev: A <:< Output[B]): Output[B]

Creates an un-nested Output from an Output of an Output.

Creates an un-nested Output from an Output of an Output.

Type parameters

B

the type of the inner Output

Value parameters

ev

evidence that the type of the inner Output is the same as the type of the outer Output

Attributes

Returns

an Output with the value of the inner Output

def map[B](f: A => B): Output[B]

Maps the value of the Output using the given function.

Maps the value of the Output using the given function.

Value parameters

f

the function to apply to the value

Attributes

Returns

an Output with the mapped value

def recover[B >: A](f: Throwable => B): Output[B]

Recovers from a failed Output by applying the given function to the Throwable.

Recovers from a failed Output by applying the given function to the Throwable.

Value parameters

f

the function to apply to the Throwable

Attributes

Returns

an Output with the recovered value

def recoverWith[B >: A](f: Throwable => Output[B]): Output[B]

Recovers from a failed Output by applying the given effectful function to the Throwable. Can be used to recover with another property of the same type.

Recovers from a failed Output by applying the given effectful function to the Throwable. Can be used to recover with another property of the same type.

Type parameters

F

the effect type

Value parameters

f

the effectful function to apply to the Throwable

Attributes

Returns

an Output with the recovered value

def recoverWith[B >: A, F[_] : ToFuture](f: Throwable => F[B]): Output[B]

Recovers from a failed Output by applying the given effectful function to the Throwable. Can be used to recover with an effect of a different type.

Recovers from a failed Output by applying the given effectful function to the Throwable. Can be used to recover with an effect of a different type.

Type parameters

B

the type of the recovered value

F

the effect type

Value parameters

f

the effectful function to apply to the Throwable

Attributes

Returns

an Output with the recovered value

def tap(f: A => Output[Unit]): Output[A]

Applies the given function to the value of the Output and discards the result. Useful for logging or other side effects.

Applies the given function to the value of the Output and discards the result. Useful for logging or other side effects.

Value parameters

f

the function to apply to the value

Attributes

Returns

an Output with the original value

Applies the given functions to the value and error of the Output and discards the results. Useful for logging or other side effects. Only one of the functions will be called, depending on whether the Output is a success or a failure.

Applies the given functions to the value and error of the Output and discards the results. Useful for logging or other side effects. Only one of the functions will be called, depending on whether the Output is a success or a failure.

Value parameters

f

the function to apply to the value

onError

the function to apply to the error

Attributes

Returns

an Output with the original value

Applies the given function to the error of the Output and discards the result. Useful for logging or other side effects.

Applies the given function to the error of the Output and discards the result. Useful for logging or other side effects.

Value parameters

f

the function to apply to the error

Attributes

Returns

an Output with the original value

def void: Output[Unit]

Discards the value of the Output and replaces it with Unit. Useful for ignoring the value of an Output but preserving the metadata about dependencies, secrecy.

Discards the value of the Output and replaces it with Unit. Useful for ignoring the value of an Output but preserving the metadata about dependencies, secrecy.

Attributes

Returns

an Output with the value of Unit

def zip[B](that: => Output[B])(using z: Zippable[A, B]): Output[Out]

Combines Output with the given Output using the given Zippable, the default implementation results in a Tuple.

Combines Output with the given Output using the given Zippable, the default implementation results in a Tuple.

Type parameters

B

the type of the other Output

Value parameters

that

the other Output to combine with this one

z

the Zippable instance that determines the behavior and the result type of the zip operation

Attributes

Returns

an Output with the zipped value, by default a Tuple