Mateo Merlo
01/01/2023, 8:27 PMpython blocks/ecs_task.py
I got the error on the image.from prefect_aws import AwsCredentials
from prefect_aws.ecs import ECSTask
aws_credentials_block = AwsCredentials(
aws_access_key_id="****",
aws_secret_access_key="****",
)
aws_credentials_block.save("prod", overwrite=True)
ecs = ECSTask(
aws_credentials=aws_credentials_block,
image="<http://631792532656.dkr.ecr.us-east-1.amazonaws.com/prefect2-image:latest|631792532656.dkr.ecr.us-east-1.amazonaws.com/prefect2-image:latest>", # image pushed to ECR
cpu="256",
memory="512",
stream_output=True,
configure_cloudwatch_logs=True,
cluster="prefect2EcsCluster",
execution_role_arn="arn:aws:iam::631792532656:role/prefectECSAgentTaskExecutionRole",
task_role_arn="arn:aws:iam::631792532656:role/prefectTaskRole",
)
ecs.save("prod", overwrite=True)
Anyone with this error?Ryan Peden
01/01/2023, 8:32 PMprefect-aws
0.2.1 make a difference? There were some changes in it that might help.Mateo Merlo
01/01/2023, 8:34 PMRyan Peden
01/01/2023, 8:35 PMMateo Merlo
01/01/2023, 8:38 PMRyan Peden
01/01/2023, 9:00 PMprefect
package initializes, it tries to load collections like prefect-aws
automatically. However, in this case it is raising an error if prefect-aws
is loaded first.
We will fix this if needed, but in the meantime you can do one of the following:
⢠Use the script as-is and ignore the error message.
⢠Add import prefect
to the top of your file before the prefect_aws
imports. If you use PyLint or another linter, you might need to add a comment to get it to ignore the unused import.Mateo Merlo
01/01/2023, 9:37 PMimport prefect
at the top and it works without the error. šš¼