<@ULVA73B9P> on prefect self hosted i'm missing se...
# ask-marvin
g
@Marvin on prefect self hosted i'm missing several block options compared to cloud version how can i introduce them
m
It sounds like you're looking to add block types in your self-hosted Prefect server that you've seen in Prefect Cloud. To introduce new block options, you can do the following: 1. Register the block from a Python module that is available in the current virtual environment by using the command:
Copy code
prefect block register --module MODULE_NAME
For example, to register all blocks found in the
credentials
module within Prefect Integrations, you would use:
Copy code
prefect block register --module prefect_aws.credentials
Registering blocks for use in Prefect UI 2. Register a block from a Python file using:
Copy code
prefect block register --file FILE_PATH.py
Replace
FILE_PATH.py
with the path to your Python file that contains your block definition. Prefect Docs - Registering blocks 3. Install relevant libraries and register the blocks they provide. For example:
Copy code
pip install -U LIBRARY_NAME
   prefect block register -m LIBRARY_NAME
Then, create the block in the Prefect UI or via code. Storage guide - How to use Blocks 4. Handling updates to custom Block types: In case your custom block needs an additional field or modification, you can edit the class definition and register the updated block type. If you have existing blocks of this type that were created before the update, you can migrate them by adding the missing values using
load
with
validate=False
. Updating custom Block types Make sure to check the documentation links for detailed steps and additional information. Remember to use these commands in the proper environment where your self-hosted Prefect server is accessible.