From 03b1c10d13dddcd572d49fe9098e70732bd7616e Mon Sep 17 00:00:00 2001 From: Sergio Garcia <38561120+sergargar@users.noreply.github.com> Date: Thu, 14 Jul 2022 07:32:01 +0200 Subject: [PATCH] fix(codebuild): expired token error using Instance Metadata Co-authored-by: sergargar --- include/aws_profile_loader | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/aws_profile_loader b/include/aws_profile_loader index 22a66708e4..8dcb7256d8 100644 --- a/include/aws_profile_loader +++ b/include/aws_profile_loader @@ -84,4 +84,6 @@ set_metadata_credentials() { export AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN=$(jq -r '.Token' <<< "${INSTANCE_METADATA}") export AWS_SESSION_TOKEN + ASSUME_AWS_SESSION_EXPIRATION=$(jq -r '.Expiration | sub("\\+00:00";"Z") | fromdateiso8601' <<< "${INSTANCE_METADATA}") + export AWS_SESSION_EXPIRATION=$ASSUME_AWS_SESSION_EXPIRATION }