Why that works...
Since aws s3 cp {{ build.ScriptUrl.outputs.stdout }} {{ build.TempScript.outputs.stdout }} gets interpreted by bash, bash doesn't care that s3://bucketname/path/to/wonderfull/things/necessary-script.sh --region us-gov-west-1 is actually two strings, so aws s3 gets the --region ... option.
Your problem is here https://github.com/aws/aws-parallelcluster/blob/release-3.8/cli/src/pcluster/resources/imagebuilder/custom_script.yaml#L36
specifically
aws s3 cp {{ build.ScriptUrl.outputs.stdout }} {{ build.TempScript.outputs.stdout }}
The problem: region is assumed and if you are in, say
us-gov-west-1
, that fails.Confirmed work around: When you are declaring your imagebuilder yaml you need to game the system.
Why that works... Since
aws s3 cp {{ build.ScriptUrl.outputs.stdout }} {{ build.TempScript.outputs.stdout }}
gets interpreted by bash, bash doesn't care thats3://bucketname/path/to/wonderfull/things/necessary-script.sh --region us-gov-west-1
is actually two strings, soaws s3
gets the--region ...
option.This was confirmed to work in us-gov-west-1