Prefect Blocks are a typed, versioned secret and configuration management system that provides the Prefect equivalent of Airflow Connections. A Block stores credentials and connection parameters in the Prefect server (Cloud or self-hosted) and exposes them to flow and task code via a named, typed Python object. Blocks are reusable across multiple flows and deployments — a `PostgresCredentials` block named `ipl-postgres-prod` can be used by every flow that needs to connect to the production database, and rotating the credentials requires only updating the block once rather than modifying every flow.
Blocks serve two purposes: credentials management (storing secrets that tasks need to authenticate with external systems) and infrastructure configuration (defining the execution environment for deployments). A `S3Bucket` block stores AWS credentials and a bucket name; loading it returns a Python object with methods like `.upload_from_path()` and `.download_object_to_path()` that abstract away the boto3 API. An `AWSCredentials` block stores access keys or role ARNs and can be referenced by any infrastructure block that needs AWS authentication.