Skip to content

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
Note, to use the load method on Blocks, you must already have a block document saved through code or saved through the UI.

Credentials Module

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.

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()
MinIOCredentials

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()
For additional examples, check out the Credentials Module under Examples Catalog.

Lambda Function Module

LambdaFunction

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()
For additional examples, check out the Lambda Function Module under Examples Catalog.

S3 Module

S3Bucket

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()
For additional examples, check out the S3 Module under Examples Catalog.

Ecs Module

ECSTask

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()
For additional examples, check out the Ecs Module under Examples Catalog.

Secrets Manager Module

AwsSecret

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()
For additional examples, check out the Secrets Manager Module under Examples Catalog.

Glue Job Module

GlueJobBlock

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()
For additional examples, check out the Glue Job Module under Examples Catalog.