Skip to main content

Init

Initializes a singleton AWS Client if one has not been initialized yet.

def Init(
ctx: context.Context,
cfg: *Config
) - > error

Initializes a singleton AWS Client if one has not been initialized yet. This ensures that only one instance of the AWS client is created and used throughout the application.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used to carry deadlines, cancellation signals, and other request-scoped values across API boundaries.
cfg*ConfigThe configuration object containing settings required to create the AWS client.

Returns

TypeDescription
errorAn error if the client could not be initialized, otherwise nil.