Documentation ¶
Index ¶
- func ApplyAll(ctx *pulumi.Context, appliers ...Applier) error
- func ExportURNWithMeta[T pulumi.Resource](ctx *pulumi.Context, name string, r T)
- type Applier
- type Component
- func NewComponent[T any](name string, apply func(ctx *pulumi.Context, name string) (T, error)) *Component[T]
- func NewInactiveComponent[T any](name string) *Component[T]
- func NewPulumiComponent[R any, A any, O pulumi.ResourceOption](fn func(ctx *pulumi.Context, name string, args A, opts ...O) (R, error), ...) *Component[R]
- type ComponentWithMeta
- func NewComponentWithMeta[T any](meta Meta, apply func(ctx *pulumi.Context, name string) (T, error)) *ComponentWithMeta[T]
- func NewPulumiComponentWithMeta[R pulumi.Resource, A any, O pulumi.ResourceOption](fn func(ctx *pulumi.Context, name string, args A, opts ...O) (R, error), ...) *ComponentWithMeta[R]
- type GetComponentResponse
- type GetComponentWithMetaResponse
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Applier ¶
type Applier interface { //Apply is a function that executes using a pulumi context and that returns an error Apply(ctx *pulumi.Context) error }
Applier is an interface created for the ApplyAll function
type Component ¶
type Component[T any] struct { // contains filtered or unexported fields }
Component is a generic struct that allows for a diffent way to write Lazy and Idempotent Pulumi components.
func NewComponent ¶
func NewComponent[T any](name string, apply func(ctx *pulumi.Context, name string) (T, error)) *Component[T]
NewComponent is a generic function that takes a name and an apply function and returns a Component
func NewInactiveComponent ¶
NewInactiveComponent returns a nil internal component
func NewPulumiComponent ¶
func NewPulumiComponent[R any, A any, O pulumi.ResourceOption]( fn func(ctx *pulumi.Context, name string, args A, opts ...O) (R, error), name string, args A, opts ...O, ) *Component[R]
NewPulumiComponent is a generic function that takes a pulumi "New" function, and all its parameters and returns a component
func (*Component[T]) Apply ¶
Apply takes a pulumi context, gets the internal component and return error if any. The internal component is discarded. Can be called multiple times, because it is cached and the component is created only once
func (*Component[T]) Get ¶
func (c *Component[T]) Get(ctx *pulumi.Context) (*GetComponentResponse[T], error)
Get takes a pulumi context, gets the internal component and return error if any. The internal component is discarded. Can be called multiple times, because it is cached and the component is created only once
func (*Component[T]) GetAndThen ¶
func (c *Component[T]) GetAndThen(ctx *pulumi.Context, fn func(*GetComponentResponse[T]) error) error
GetAndThen takes a pulumi context and a function that takes a generic item, gets the internal component and apply the received function with its internal component Can be called multiple times, because it is cached and the component is created only once
type ComponentWithMeta ¶
ComponentWithMeta is a component created using a meta struct
func NewComponentWithMeta ¶
func NewComponentWithMeta[T any](meta Meta, apply func(ctx *pulumi.Context, name string) (T, error)) *ComponentWithMeta[T]
NewComponentWithMeta is a generic function that takes a name and an apply function and returns a Component
func NewPulumiComponentWithMeta ¶
func NewPulumiComponentWithMeta[R pulumi.Resource, A any, O pulumi.ResourceOption]( fn func(ctx *pulumi.Context, name string, args A, opts ...O) (R, error), meta Meta, args A, opts ...O, ) *ComponentWithMeta[R]
NewPulumiComponentWithMeta is a generic function that takes a pulumi "New" function, and all its parameters and returns a component
func (*ComponentWithMeta[T]) Apply ¶
func (c *ComponentWithMeta[T]) Apply(ctx *pulumi.Context) error
Apply takes a pulumi context, gets the internal component and return error if any. The internal component is discarded. Can be called multiple times, because it is cached and the component is created only once
func (*ComponentWithMeta[T]) GetAndThen ¶
func (c *ComponentWithMeta[T]) GetAndThen(ctx *pulumi.Context, fn func(*GetComponentWithMetaResponse[T]) error) error
GetAndThen takes a pulumi context and a function that takes a generic item, gets the internal component and apply the received function with its internal component Can be called multiple times, because it is cached and the component is created only once
type GetComponentResponse ¶
GetComponentResponse collect the name and the object of created infrastructure components
func ExportURN ¶
func ExportURN[T pulumi.Resource](ctx *pulumi.Context, r *GetComponentResponse[T]) *GetComponentResponse[T]
ExportURN exports the URN of pulumi Resource
type GetComponentWithMetaResponse ¶
type GetComponentWithMetaResponse[T any] struct { *Meta *GetComponentResponse[T] }
GetComponentWithMetaResponse collect the name and the object of created infrastructure components