From b7e6686987dba0724d90a25b3fa35eb549945cf3 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 30 Sep 2024 18:04:18 -0500 Subject: [PATCH] DEVPROD-10453 Use assume_role for s3 uploads [release/1.17] (#1824) (#1837) --- .evergreen/config.yml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 17e1e93221..61ef8d6db6 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -186,24 +186,29 @@ functions: script: | ${PREPARE_SHELL} find $MONGO_ORCHESTRATION_HOME -name \*.log | xargs tar czf mongodb-logs.tar.gz + - command: ec2.assume_role + params: + role_arn: ${assume_role_arn} - command: s3.put params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} + aws_key: ${AWS_ACCESS_KEY_ID} + aws_secret: ${AWS_SECRET_ACCESS_KEY} + aws_session_token: ${AWS_SESSION_TOKEN} local_file: mongodb-logs.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz - bucket: mciuploads + remote_file: ${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz + bucket: ${aws_bucket} permissions: public-read content_type: ${content_type|application/x-gzip} display_name: "mongodb-logs.tar.gz" - command: s3.put params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} + aws_key: ${AWS_ACCESS_KEY_ID} + aws_secret: ${AWS_SECRET_ACCESS_KEY} + aws_session_token: ${AWS_SESSION_TOKEN} optional: true local_file: ${PROJECT_DIRECTORY}/fuzz.tgz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/${task_id}-${execution}-fuzz.tgz - bucket: mciuploads + remote_file: ${build_variant}/${revision}/${version_id}/${build_id}/${task_id}-${execution}-fuzz.tgz + bucket: ${aws_bucket} permissions: public-read content_type: application/x-gzip display_name: "fuzz.tgz" @@ -216,12 +221,13 @@ functions: find . -name \*.suite | xargs tar czf test_suite.tgz - command: s3.put params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} + aws_key: ${AWS_ACCESS_KEY_ID} + aws_secret: ${AWS_SECRET_ACCESS_KEY} + aws_session_token: ${AWS_SESSION_TOKEN} local_file: src/go.mongodb.org/mongo-driver/test_suite.tgz optional: true - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-test_suite.tgz - bucket: mciuploads + remote_file: ${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-test_suite.tgz + bucket: ${aws_bucket} permissions: public-read content_type: ${content_type|text/plain} display_name: "test_suite.tgz"