Abyaya Lamsal
11/06/2025, 11:25 PMpull:
- prefect_aws.deployments.steps.pull_from_s3:
bucket: my-bucket
credentials: '{{ prefect.blocks.s3.my-bucket-credentials }}'
folder: my-folder
requires: prefect-aws
- prefect.deployments.steps.run_shell_script:
script: pip install -e /python-flows
why am i getting this error:
ValueError: Step has unexpected additional keys: prefect_aws.deployments.steps.pull_from_s3Marvin
11/06/2025, 11:25 PMMarvin
11/06/2025, 11:32 PMid, requires, and if live alongside that key (not inside the function’s parameter dict)
In your YAML, requires is nested under the function’s parameters. That causes the step validator to see unexpected keys and raise:
ValueError: Step has unexpected additional keys: prefect_aws.deployments.steps.pull_from_s3
Here’s a corrected version:
pull:
- prefect_aws.deployments.steps.pull_from_s3:
bucket: my-bucket
folder: my-folder
credentials: "{{ prefect.blocks.aws-credentials.my-bucket-credentials }}"
requires: prefect-aws
- prefect.deployments.steps.run_shell_script:
script: pip install -e ./python-flows
Notes:
- Move requires out to the same level as the step (as shown).
- For AWS credentials, the block type is typically aws-credentials, so use {{ prefect.blocks.aws-credentials.<your-block-slug> }}. Your prefect.blocks.s3... path looks off.
- Double-check the path in your pip install -e command. If the S3 contents land under my-folder, you may want pip install -e ./my-folder/python-flows unless your repo layout differs.
Refs:
- prefect.yaml structure
- Pull steps API
- Utility steps API
If you’re still seeing the error after moving requires, please paste the full pull: section and confirm your Prefect version so I can help further.Abyaya Lamsal
11/06/2025, 11:32 PMMarvin
11/06/2025, 11:32 PMMarvin
11/06/2025, 11:39 PMid and requires.
Your structure is almost there; two things to fix/check:
1) Use the AWS credentials block type (aws-credentials), not s3, for the credentials field.
2) Ensure indentation is correct and each step is its own list item.
Here’s a corrected 2.x example:
pull:
- prefect_aws.deployments.steps.pull_from_s3:
id: pull_code
requires: "prefect-aws>=0.3.4"
bucket: "my-bucket"
folder: "my-folder"
credentials: "{{ prefect.blocks.aws-credentials.my-bucket-credentials }}"
- prefect.deployments.steps.run_shell_script:
script: "pip install -e ./python-flows"
stream_output: true
Why you saw that error
- Prefect raises “Step has unexpected additional keys: prefect_aws.deployments.steps.pull_from_s3” when a step’s mapping isn’t shaped as “one function key + its parameters (plus optional id/requires)”. This often happens due to indentation or mixing multiple step keys under one list item. Double-check that both steps have their own dash and that there are no tabs or misaligned spaces.
Docs for Prefect 2.x
- Steps + YAML: https://docs-2.prefect.io/latest/guides/prefect-deploy/
- AWS steps: https://docs-2.prefect.io/latest/integrations/prefect-aws/deployments/steps/
If it still errors, can you paste your full pull: section (as it appears in the file) and confirm the prefect-aws version installed in the runtime environment?