Closed rocketnova closed 1 year ago
Noting that last night's overnight Eventbridge schedule-triggered task in dev
did not find any documents to update (log) and the document links in dev
this morning appear to all still be working. This is promising.
Noting again that last night's overnight Eventbridge schedule-triggered task in dev
did not find any documents to update (log) and the document links in dev
seem to still be working 🤞
Last night's overnight log shows that the Eventbridge schedule-triggered task in dev
finally did find some documents to update (log) and all the document links in dev
appear to be working.
This shows that the refresh script found documents to update on the correct schedule.
I'm still wary of merging this in while the pilot is running in case we run into more unexpected AWS session expiry, so I'm going to wait until it's over to merge this one.
Ticket
https://wicmtdp.atlassian.net/browse/PRP-344
Changes
Context for reviewers
According to the AWS documentation, maximum S3 presigned url expiration time for STS is tied to the maximum session duration of the assumed role (which can be 12 hours at most); whereas maximum S3 presigned url expiration time for an IAM user is 7 days.
This PR creates a machine IAM user to take advantage of the longer expiration time. It therefore also lowers the refresh frequency introduced in the previous hotfix #105. This PR changes the Eventbridge check to run once a day and update any urls that haven't been updated in the last 4 days. Important: The first time this is run, we need to refresh all the urls, so that the old expiration times are caught.
This PR also starts to add more inline code documentation to the infra codebase.
Testing
dev
environmentaws ecs run-task
to thedev
environment to refresh all the urls (see log where it updated 82 documents)