Skip to main content

prefect_aws.credentials

Module handling AWS credentials

Classes

ClientType

The supported boto3 clients.

AwsCredentials

Block used to manage authentication with AWS. AWS authentication is handled via the boto3 module. Refer to the boto3 docs for more info about the possible credential configurations. Methods:

get_boto3_session

get_boto3_session(self) -> boto3.Session
Returns an authenticated boto3 session that can be used to create clients for AWS services. If assume_role_arn is provided, this method will assume the specified IAM role and return a session with the temporary credentials from the assumed role.

get_client

get_client(self, client_type: Union[str, ClientType])
Helper method to dynamically get a client type. Args:
  • client_type: The client’s service name.
Returns:
  • An authenticated client.
Raises:
  • ValueError: if the client is not supported.

get_s3_client

get_s3_client(self) -> 'S3Client'
Gets an authenticated S3 client. Returns:
  • An authenticated S3 client.

get_secrets_manager_client

get_secrets_manager_client(self) -> 'SecretsManagerClient'
Gets an authenticated Secrets Manager client. Returns:
  • An authenticated Secrets Manager client.

MinIOCredentials

Block used to manage authentication with MinIO. Refer to the MinIO docs for more info about the possible credential configurations. Attributes:
  • minio_root_user: Admin or root user.
  • minio_root_password: Admin or root password.
  • region_name: Location of server, e.g. “us-east-1”.
Methods:

get_boto3_session

get_boto3_session(self) -> boto3.Session
Returns an authenticated boto3 session that can be used to create clients and perform object operations on MinIO server.

get_client

get_client(self, client_type: Union[str, ClientType])
Helper method to dynamically get a client type. Args:
  • client_type: The client’s service name.
Returns:
  • An authenticated client.
Raises:
  • ValueError: if the client is not supported.

get_s3_client

get_s3_client(self) -> 'S3Client'
Gets an authenticated S3 client. Returns:
  • An authenticated S3 client.