feat: add AWS Translate resource support#900
Conversation
…TextTranslationJob) Add three new AWS Translate resource types enabling cleanup of Translate resources during account nuking. Follows the SDK v2 interface + gomock pattern established by the RAM resources.
ekristen
left a comment
There was a problem hiding this comment.
At a glance things look great, have one question on the filter for translation job.
Also I have to ask, have you fully tested these resources against AWS? Unfortunately I've been receiving some PRs that haven't been tested at all. Most likely done with AI, trying to avoid asking that question though, but might have to start.
-Erik
| return err | ||
| } | ||
|
|
||
| func (r *TranslateTextTranslationJob) Filter() error { |
There was a problem hiding this comment.
Due to your comment on the PR, is there a stopped JobStatus? If so we need to have a switch for it and error with so it gets filtered out as well.
There was a problem hiding this comment.
Thanks for catching that Erik! You're right — there is a STOPPED status (and STOP_REQUESTED too). I've pushed a fix that explicitly handles all terminal statuses: STOPPED, STOP_REQUESTED, COMPLETED, COMPLETED_WITH_ERROR, and FAILED — each with a descriptive error message rather than relying on the catch-all default.
Explicitly handle STOPPED, STOP_REQUESTED, COMPLETED, COMPLETED_WITH_ERROR, and FAILED statuses in the filter rather than relying on a catch-all default case.
totally valid question, yes I confess I absolutely have used AI, however has been tested with a real account. |
|
I'm a proponent of AI, I have zero issues with it, just so long as things are being actually tested against an account and mock tests are set to match. The inverse has been happening, tests are written and mocked by AI then everything fails on a real account. Not you, but other PRs I've received. I do have some OSS credits from AWS, so I can test without too much fear of a high bill, but I appreciate it. |
Fixes rangeValCopy lint errors in translate resource listers.
Summary
TranslateParallelData,TranslateTerminology, andTranslateTextTranslationJobFilter()to skip resources in terminal/non-actionable statesStopTextTranslationJob(stop, not delete) since batch jobs cannot be deletedDetails
New resources:
TranslateParallelDataListParallelDataDeleteParallelDataDELETING,FAILEDTranslateTerminologyListTerminologiesDeleteTerminologyTranslateTextTranslationJobListTextTranslationJobsStopTextTranslationJobSUBMITTED,IN_PROGRESSDesign decisions:
ListTagsForResourcecall per resource; can be added laterTargetLanguageCodesfield — array not useful for filteringTranslateAPIinterface for all three resources, matching the RAM patternNote: Translation jobs can only be stopped, not deleted. The AWS Translate API does not provide a way to remove completed/stopped job metadata — it will remain visible in the account until it ages out naturally. This is an AWS limitation, not something we can address.