<@ULVA73B9P> I I want to make a copy of my ECS wor...
# ask-marvin
o
@Marvin I I want to make a copy of my ECS work pool that has the name ecs-pool. how do I do that?
m
thought for 522.7 seconds
Short answer: there isn’t a built-in “copy pool” command. You’ll recreate a new pool with the same type and base job template, then (optionally) copy concurrency limits and queues. Here’s a reliable way to clone
ecs-pool
to a new pool (e.g.,
ecs-pool-copy
). 1) Get the current pool’s details (type + base job template)
Copy code
prefect work-pool inspect "ecs-pool"
- Note the pool
type
(for ECS it’s typically
ecs
). - Copy the “Base job template” section into a file, e.g.
ecs-base.json
. Tip: If you prefer to export it programmatically, you can use the client:
Copy code
import asyncio, json
from prefect.client.orchestration import get_client

async def main():
    async with get_client() as client:
        pool = await client.read_work_pool_by_name("ecs-pool")
        with open("ecs-base.json", "w") as f:
            json.dump(pool.base_job_template, f, indent=2)
        print("type:", pool.type)
        print("concurrency_limit:", pool.concurrency_limit)
        print("description:", pool.description)

asyncio.run(main())
2) Create the new pool with the same type and base job template
Copy code
prefect work-pool create "ecs-pool-copy" --type ecs --base-job-template ecs-base.json
- If your local environment doesn’t recognize the ECS type, run with AWS extras installed:
Copy code
uv run --with 'prefect[aws]' prefect work-pool create "ecs-pool-copy" --type ecs --base-job-template ecs-base.json
3) Copy over limits/metadata (if you use them)
Copy code
prefect work-pool update "ecs-pool-copy" --concurrency-limit <LIMIT> --description "..."
4) (Optional) Recreate the queues from the old pool - List queues on the original pool:
Copy code
prefect work-queue ls -p "ecs-pool" --verbose
- For each queue you want to copy, create it in the new pool (preserving limits/priority if needed):
Copy code
prefect work-queue create "<queue-name>" -p "ecs-pool-copy" --limit <LIMIT> --priority <PRIORITY>
5) Start a worker for the new pool when you’re ready
Copy code
prefect worker start --pool "ecs-pool-copy"
Would you like me to provide a small script that copies the pool and all its queues end-to-end? If so, what would you like the new pool to be named?