Boto3 Utils

mypy-boto3-builder Index / Mypy Boto3 Builder / Utils / Boto3 Utils

Auto-generated documentation for mypy_boto3_builder.utils.boto3_utils module.

get_boto3_client

Show source in boto3_utils.py:16

Get boto3 client from session.

Arguments

  • session - boto3 session.
  • service_name - ServiceName instance.

Returns

Boto3 client.

Signature

@cache
def get_boto3_client(session: Session, service_name: ServiceName) -> BaseClient:
    ...

See also

get_boto3_resource

Show source in boto3_utils.py:31

Get boto3 resource from session.

Arguments

  • session - boto3 session.
  • service_name - ServiceName instance.

Returns

Boto3 resource or None.

Signature

@cache
def get_boto3_resource(
    session: Session, service_name: ServiceName
) -> Boto3ServiceResource | None:
    ...

See also

get_region_name_literal

Show source in boto3_utils.py:49

Get Literal with all regions.

Arguments

  • session - boto3 session.
  • service_names - All available service names.

Returns

TypeLiteral for region names.

Signature

def get_region_name_literal(
    session: Session, service_names: Iterable[ServiceName]
) -> TypeLiteral | None:
    ...

See also