Blocks Catalog
Below is a list of Blocks available for registration in
prefect-aws
.
To register blocks in this module to view and edit them on Prefect Cloud, first install the required packages, then
prefect block register -m prefect_aws
load
method on Blocks, you must already have a block document saved through code or saved through the UI.
Credentials Module
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.
To load the AwsCredentials:
from prefect import flow
from prefect_aws.credentials import AwsCredentials
@flow
def my_flow():
my_block = AwsCredentials.load("MY_BLOCK_NAME")
my_flow()
Block used to manage authentication with MinIO. Refer to the MinIO docs: https://docs.min.io/docs/minio-server-configuration-guide.html for more info about the possible credential configurations.
To load the MinIOCredentials:
from prefect import flow
from prefect_aws.credentials import MinIOCredentials
@flow
def my_flow():
my_block = MinIOCredentials.load("MY_BLOCK_NAME")
my_flow()
Lambda Function Module
Invoke a Lambda function. This block is part of the prefect-aws
collection. Install prefect-aws with pip install prefect-aws
to use this
block.
To load the LambdaFunction:
from prefect import flow
from prefect_aws.lambda_function import LambdaFunction
@flow
def my_flow():
my_block = LambdaFunction.load("MY_BLOCK_NAME")
my_flow()
S3 Module
Block used to store data using AWS S3 or S3-compatible object storage like MinIO.
To load the S3Bucket:
from prefect import flow
from prefect_aws.s3 import S3Bucket
@flow
def my_flow():
my_block = S3Bucket.load("MY_BLOCK_NAME")
my_flow()
Ecs Module
Run a command as an ECS task.
To load the ECSTask:
from prefect import flow
from prefect_aws.ecs import ECSTask
@flow
def my_flow():
my_block = ECSTask.load("MY_BLOCK_NAME")
my_flow()
Secrets Manager Module
Manages a secret in AWS's Secrets Manager.
To load the AwsSecret:
from prefect import flow
from prefect_aws.secrets_manager import AwsSecret
@flow
def my_flow():
my_block = AwsSecret.load("MY_BLOCK_NAME")
my_flow()
Glue Job Module
Execute a job to the AWS Glue Job service.
To load the GlueJobBlock:
from prefect import flow
from prefect_aws.glue_job import GlueJobBlock
@flow
def my_flow():
my_block = GlueJobBlock.load("MY_BLOCK_NAME")
my_flow()