ERROR REFERENCE
Cannot use both --resolve-s3 and --s3-bucket
The deploy was told to use SAM's managed artifact bucket
(--resolve-s3) and a specific bucket
(--s3-bucket) at the same time. The CLI refuses to
guess which one you meant — and the second one usually arrived
through samconfig.toml rather than the command line.
WHAT IT MEANS
What this error means
Flags and samconfig.toml parameters merge before
validation. A config file with resolve_s3 = true (often
written by sam deploy --guided) plus a pipeline that
passes --s3-bucket — or the reverse — trips the
conflict even though each source looks consistent on its own.
FIX
How to fix it
-
Pick one bucket source. The managed bucket
(
--resolve-s3/resolve_s3 = true) is right unless policy requires a specific bucket; then use--s3-bucketalone. -
Audit both sources of the merge:
and the pipeline's deploy command. Remove the setting from the side you are not keeping.grep -n "s3_bucket\|resolve_s3" samconfig.toml -
Keep CI and laptop config environments separate
in
samconfig.tomlso a guided run on someone's machine cannot re-introduce the conflict into the pipeline.
AUTOMATE THE TRIAGE
Diagnose this automatically
SAM Doctor recognizes the conflict message (high confidence). Runs locally; no AWS access, no log upload.
python -m pip install sam-doctor
sam-doctor diagnose deployment.log --format markdown
RELATED
Related errors
- S3 error: Access Denied (deployment bucket) — what a wrong explicit bucket often fails with next.
- Deploy this changeset? [y/N] — the other samconfig.toml default that behaves differently in CI.