Skip to content

Commit 5745e79

Browse files
authored
Use a new S3 bucket instead of mciuploads (#900)
This is being done for two reasons. First, we want to move projects away from all using the shared `mciuploads` bucket. Second, the credentials to access `mciuploads` are only available for the DB Tools Evergreen project for the `master` branch. When we make a PR off a different branch, we cannot see those credentials. That means those branches cannot interact with S3 in CI, which leads to lots of CI failures. Switching to a new bucket and using `role_arn` to access that bucket means this works on any branch. This also changes all our S3 uploads to be private, but I don't think there was any reason for these to be publicly readable. People outside MongoDB can't see Evergreen logs, so they'd have no way to find the relevant URLs anyway.
1 parent f65db3f commit 5745e79

2 files changed

Lines changed: 79 additions & 79 deletions

File tree

common.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ functions:
265265
# upload individual release artifacts to task page
266266
- command: s3.put
267267
params:
268-
aws_key: ${aws_key}
269-
aws_secret: ${aws_secret}
268+
role_arn: arn:aws:iam::391144487543:role/evergreen-project-mongo-tools
270269
local_files_include_filter:
271270
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.deb
272271
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.msi
@@ -275,8 +274,9 @@ functions:
275274
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.zip
276275
remote_file: mongo-tools/pkgs/${build_id}/
277276
content_type: application/octet-stream
278-
bucket: mciuploads
279-
permissions: public-read
277+
bucket: evergreen-project-mongo-tools-i6qg5nn6nbm
278+
permissions: private
279+
visibility: signed
280280
display_name: "Release Artifact - "
281281

282282
# pack all release artifacts into a tarball and upload them to one
@@ -291,25 +291,25 @@ functions:
291291
- mongodb-database-tools*.rpm
292292
- mongodb-database-tools*.tgz
293293
- mongodb-database-tools*.zip
294+
294295
- command: s3.put
295296
params:
296-
aws_key: ${aws_key}
297-
aws_secret: ${aws_secret}
297+
role_arn: arn:aws:iam::391144487543:role/evergreen-project-mongo-tools
298298
local_file: src/github.com/mongodb/mongo-tools/upload.tgz
299299
remote_file: mongo-tools/task/dist/${build_id}/all-release-artifacts.tgz
300300
content_type: application/x-gzip
301-
bucket: mciuploads
302-
permissions: public-read
301+
bucket: evergreen-project-mongo-tools-i6qg5nn6nbm
302+
permissions: private
303+
visibility: signed
303304
display_name: All Release Artifacts (.tgz)
304305

305306
"fetch dist release artifacts":
306307
- command: s3.get
307308
params:
308-
aws_key: ${aws_key}
309-
aws_secret: ${aws_secret}
309+
role_arn: arn:aws:iam::391144487543:role/evergreen-project-mongo-tools
310310
remote_file: mongo-tools/task/dist/${build_id}/all-release-artifacts.tgz
311311
extract_to: src/github.com/mongodb/mongo-tools/
312-
bucket: mciuploads
312+
bucket: evergreen-project-mongo-tools-i6qg5nn6nbm
313313

314314
"sign artifacts":
315315
command: shell.exec
@@ -335,10 +335,10 @@ functions:
335335
working_dir: src/github.com/mongodb/mongo-tools
336336
script: |
337337
rm -rf ./mongorestore/testdata/longcollectionname/
338+
338339
- command: s3.put
339340
params:
340-
aws_key: ${aws_key}
341-
aws_secret: ${aws_secret}
341+
role_arn: arn:aws:iam::391144487543:role/evergreen-project-mongo-tools
342342
local_files_include_filter:
343343
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.sig
344344
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.deb
@@ -347,8 +347,9 @@ functions:
347347
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.tgz
348348
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.zip
349349
remote_file: mongo-tools/task/sign/${build_id}/
350-
bucket: mciuploads
351-
permissions: public-read
350+
bucket: evergreen-project-mongo-tools-i6qg5nn6nbm
351+
permissions: private
352+
visibility: signed
352353
content_type: application/octet-stream
353354

354355
"upload release packages to s3":
@@ -366,16 +367,17 @@ functions:
366367
script: |
367368
${_set_shell_env}
368369
go run release/release.go upload-json
370+
369371
- command: s3.put
370372
params:
371-
aws_key: ${aws_key}
372-
aws_secret: ${aws_secret}
373+
role_arn: arn:aws:iam::391144487543:role/evergreen-project-mongo-tools
373374
local_file: src/github.com/mongodb/mongo-tools/release.json
374375
remote_file: mongo-tools/release/${build_id}/
375376
optional: true
376377
content_type: application/json
377-
bucket: mciuploads
378-
permissions: public-read
378+
bucket: evergreen-project-mongo-tools-i6qg5nn6nbm
379+
permissions: private
380+
visibility: signed
379381

380382
"generate full JSON feed":
381383
- command: shell.exec

0 commit comments

Comments
 (0)