diff --git a/hack/latest-binaries.sh b/hack/latest-binaries.sh index 246fc8dd8..eaa707586 100755 --- a/hack/latest-binaries.sh +++ b/hack/latest-binaries.sh @@ -13,7 +13,9 @@ MINOR_VERSION="${1}" # retrieve the available "VERSION/BUILD_DATE" prefixes (e.g. "1.28.1/2023-09-14") # from the binary object keys, sorted in descending semver order, and pick the first one -LATEST_BINARIES=$(aws s3api list-objects-v2 --bucket amazon-eks --prefix "${MINOR_VERSION}" --query 'Contents[*].[Key]' --output text | cut -d'/' -f-2 | sort -Vru | head -n1) +# TODO: ideally we want to use the value of $binary_bucket_region instead of hard-coding us-west-2 +# since setting the binary_bucket_region value really is the indication of where the binaries are located. +LATEST_BINARIES=$(aws s3api list-objects-v2 --bucket amazon-eks --prefix "${MINOR_VERSION}" --query 'Contents[*].[Key]' --output text --region us-west-2 --no-sign-request | cut -d'/' -f-2 | sort -Vru | head -n1) if [ "${LATEST_BINARIES}" == "None" ]; then echo >&2 "No binaries available for minor version: ${MINOR_VERSION}" diff --git a/templates/al2/provisioners/install-worker.sh b/templates/al2/provisioners/install-worker.sh index 680b74e23..48c225b0e 100644 --- a/templates/al2/provisioners/install-worker.sh +++ b/templates/al2/provisioners/install-worker.sh @@ -274,8 +274,8 @@ BINARIES=( for binary in ${BINARIES[*]}; do if [[ -n "$AWS_ACCESS_KEY_ID" ]]; then echo "AWS cli present - using it to copy binaries from s3." - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/$binary . - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/$binary.sha256 . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/$binary . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/$binary.sha256 . else echo "AWS cli missing - using wget to fetch binaries from s3. Note: This won't work for private bucket." sudo wget $S3_URL_BASE/$binary @@ -308,8 +308,8 @@ if [ "$PULL_CNI_FROM_GITHUB" = "true" ]; then else if [[ -n "$AWS_ACCESS_KEY_ID" ]]; then echo "AWS cli present - using it to copy binaries from s3." - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/${CNI_PLUGIN_FILENAME}.tgz . - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/${CNI_PLUGIN_FILENAME}.tgz.sha256 . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/${CNI_PLUGIN_FILENAME}.tgz . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/${CNI_PLUGIN_FILENAME}.tgz.sha256 . else echo "AWS cli missing - using wget to fetch cni binaries from s3. Note: This won't work for private bucket." sudo wget "$S3_URL_BASE/${CNI_PLUGIN_FILENAME}.tgz" @@ -369,7 +369,7 @@ sudo chmod +x /etc/eks/max-pods-calculator.sh ECR_CREDENTIAL_PROVIDER_BINARY="ecr-credential-provider" if [[ -n "$AWS_ACCESS_KEY_ID" ]]; then echo "AWS cli present - using it to copy ${ECR_CREDENTIAL_PROVIDER_BINARY} from s3." - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/$ECR_CREDENTIAL_PROVIDER_BINARY . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/$ECR_CREDENTIAL_PROVIDER_BINARY . else echo "AWS cli missing - using wget to fetch ${ECR_CREDENTIAL_PROVIDER_BINARY} from s3. Note: This won't work for private bucket." sudo wget "$S3_URL_BASE/$ECR_CREDENTIAL_PROVIDER_BINARY" diff --git a/templates/al2023/provisioners/install-worker.sh b/templates/al2023/provisioners/install-worker.sh index f8cf2853e..fb980d21f 100644 --- a/templates/al2023/provisioners/install-worker.sh +++ b/templates/al2023/provisioners/install-worker.sh @@ -169,8 +169,8 @@ BINARIES=( for binary in ${BINARIES[*]}; do if [[ -n "$AWS_ACCESS_KEY_ID" ]]; then echo "AWS cli present - using it to copy binaries from s3." - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/$binary . - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/$binary.sha256 . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/$binary . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/$binary.sha256 . else echo "AWS cli missing - using wget to fetch binaries from s3. Note: This won't work for private bucket." sudo wget $S3_URL_BASE/$binary @@ -191,7 +191,7 @@ ECR_CREDENTIAL_PROVIDER_BINARY="ecr-credential-provider" if [[ -n "$AWS_ACCESS_KEY_ID" ]]; then echo "AWS cli present - using it to copy ${ECR_CREDENTIAL_PROVIDER_BINARY} from s3." - aws s3 cp --region $BINARY_BUCKET_REGION $S3_PATH/$ECR_CREDENTIAL_PROVIDER_BINARY . + aws s3 cp --no-sign-request --region $BINARY_BUCKET_REGION $S3_PATH/$ECR_CREDENTIAL_PROVIDER_BINARY . else echo "AWS cli missing - using wget to fetch ${ECR_CREDENTIAL_PROVIDER_BINARY} from s3. Note: This won't work for private bucket." sudo wget "$S3_URL_BASE/$ECR_CREDENTIAL_PROVIDER_BINARY"