@@ -289,6 +289,27 @@ function build_and_package_template() {
289289 fi
290290}
291291
292+ # Generate list of configuration files for explicit copying
293+ function generate_config_file_list() {
294+ local config_dir=" config_library"
295+ local file_list=" "
296+
297+ # Find all files in config_library, excluding .checksum files
298+ while IFS= read -r -d ' ' file; do
299+ # Get relative path from config_library directory
300+ relative_path=" ${file# $config_dir / } "
301+ # Skip .checksum files
302+ if [[ " $relative_path " != " .checksum" && " $relative_path " != * " /.checksum" ]]; then
303+ if [[ -n " $file_list " ]]; then
304+ file_list=" $file_list ,"
305+ fi
306+ file_list=" $file_list \" $relative_path \" "
307+ fi
308+ done < <( find " $config_dir " -type f -print0)
309+
310+ echo " [$file_list ]"
311+ }
312+
292313# Upload configuration library to S3
293314function upload_config_library() {
294315 local config_dir=" config_library"
@@ -386,8 +407,8 @@ function build_main_template() {
386407 local BUILD_DATE_TIME=$( date -u +" %Y-%m-%d %H:%M:%S" )
387408 local CONFIG_LIBRARY_HASH=$( calculate_hash " config_library" )
388409
389- # Define configuration S3 base path
390- local CONFIG_BASE_PATH= " s3:// ${BUCKET} / ${PREFIX_AND_VERSION} /config_library "
410+ # Generate configuration file list for explicit copying
411+ local CONFIG_FILE_LIST= $( generate_config_file_list )
391412
392413 echo " Inline edit main template to replace:"
393414 echo " <VERSION> with: $VERSION "
@@ -397,8 +418,8 @@ function build_main_template() {
397418 echo " <ARTIFACT_PREFIX_TOKEN> with prefix: $PREFIX_AND_VERSION "
398419 echo " <WEBUI_ZIPFILE_TOKEN> with filename: $webui_zipfile "
399420 echo " <HASH_TOKEN> with: $HASH "
400- echo " <CONFIG_BASE_PATH_TOKEN> with: $CONFIG_BASE_PATH "
401421 echo " <CONFIG_LIBRARY_HASH_TOKEN> with: $CONFIG_LIBRARY_HASH "
422+ echo " <CONFIG_FILES_LIST_TOKEN> with file list: $CONFIG_FILE_LIST "
402423
403424 # Use a more reliable approach for multiple sed replacements
404425 sed -e " s|<VERSION>|$VERSION |g" \
@@ -408,8 +429,8 @@ function build_main_template() {
408429 -e " s|<ARTIFACT_PREFIX_TOKEN>|$PREFIX_AND_VERSION |g" \
409430 -e " s|<WEBUI_ZIPFILE_TOKEN>|$webui_zipfile |g" \
410431 -e " s|<HASH_TOKEN>|$HASH |g" \
411- -e " s|<CONFIG_BASE_PATH_TOKEN>|$CONFIG_BASE_PATH |g" \
412432 -e " s|<CONFIG_LIBRARY_HASH_TOKEN>|$CONFIG_LIBRARY_HASH |g" \
433+ -e " s|<CONFIG_FILES_LIST_TOKEN>|$CONFIG_FILE_LIST |g" \
413434 .aws-sam/packaged.yaml > .aws-sam/${MAIN_TEMPLATE}
414435
415436 # Upload and validate main template
@@ -500,4 +521,4 @@ set_public_acls
500521print_outputs " $TEMPLATE_URL "
501522
502523echo " Done"
503- exit 0
524+ exit 0
0 commit comments