Hey Community - are there any examples out there f...
# prefect-community
l
Hey Community - are there any examples out there for how to use the AWSClientWaitTask? (https://docs.prefect.io/api/latest/tasks/aws.html#awsclientwait). Specifically I’m trying to wait on an AWS Batch job to finish. It’s not clear to me how to pass the job name or job id into the task. Thanks!
d
Hey @Lee Mendelowitz! I think that might get passed to the
waiter_definition
but I’m unsure. Curious to see what others in the community think
l
Figured it out! It’s through
waiter_kwargs
:
Copy code
from prefect.tasks.aws.client_waiter import AWSClientWait
batch_waiter = AWSClientWait(client = 'batch', waiter_name = 'JobComplete')
batch_waiter.run(waiter_kwargs = {'jobs' : ["<jobId>"]})
It seems that the
waiter_kwargs
maps to the arguments for the
boto3
batch client call to `describe_jobs`:
Copy code
import boto3
client = boto3.client('batch')
res = client.describe_jobs(jobs = ["<jobId"])
d
Nice!