hugo deploy fails with 'Failed to create deployment target' on S3 despite valid credentials
0 reputation · 02 Feb 2024, 21:51 UTC
0 reputation · 02 Feb 2024, 21:51 UTC
The hugo deploy command returns 'Failed to create deployment target' when attempting to deploy to an S3 bucket, even though AWS credentials are properly configured and the bucket exists with correct permissions. This error occurs consistently across multiple Hugo versions (0.80+) when using the standard S3 deployment target configuration in config.toml.
The deployment configuration includes the required [deployment] section with S3 target parameters, environment variables for credentials are properly expanded, and the same credentials work for manual AWS CLI deployments to the same bucket. Running hugo config shows the deployment settings are being parsed correctly, and hugo deploy --verbose confirms the target creation step fails without additional diagnostic information.
This suggests the issue may be related to how Hugo validates or initializes deployment targets, potentially involving credential resolution timing, region configuration, or a mismatch between Hugo's deployment target expectations and the actual S3 bucket configuration.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.