Skip to content

Commit

Permalink
Add the region flag to the imagebuilder component custom script downl…
Browse files Browse the repository at this point in the history
…oad action (#6424)
  • Loading branch information
dreambeyondorange committed Sep 9, 2024
1 parent 0c71f5e commit 8d736f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/src/pcluster/resources/imagebuilder/custom_script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ phases:
set -v
mkdir /tmp/parallelcluster/
temp_file=$(mktemp -p /tmp/parallelcluster/)
echo "${temp_file}"
echo "$temp_file"
# Download script
- name: Download
Expand All @@ -33,7 +33,7 @@ phases:
if [[ {{ build.ScriptUrlScheme.outputs.stdout }} == "https" ]]; then
curl --retry 3 -L -o {{ build.TempScript.outputs.stdout }} {{ build.ScriptUrl.outputs.stdout }}
elif [[ {{ build.ScriptUrlScheme.outputs.stdout }} == "s3" ]]; then
aws s3 cp {{ build.ScriptUrl.outputs.stdout }} {{ build.TempScript.outputs.stdout }}
aws s3 cp {{ build.ScriptUrl.outputs.stdout }} {{ build.TempScript.outputs.stdout }} --region ${AWS::Region}
else
echo "Invalid script url"
exit {{ build.Fail.outputs.stdout }}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/pcluster/templates/imagebuilder_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ def _add_custom_components(self, components, policy_statements, components_resou
description="This component is custom component for script, script name is {0}, script url is "
"{1}".format(component_script_name, custom_component.value),
platform="Linux",
data=wrap_script_to_component(custom_component.value),
data=Fn.sub(wrap_script_to_component(custom_component.value)),
)
components.append(
imagebuilder.CfnImageRecipe.ComponentConfigurationProperty(component_arn=Fn.ref(component_id))
Expand Down

0 comments on commit 8d736f9

Please sign in to comment.