We were using create_secure_bucket() utility function to create an S3 bucket and bucket policy for Job Attachment integration test, which had extraneous attributes and additional log bucket, and it felt overkill for what we actually needed.
Upon Job Attachment test completion, I encountered an issue where the CFN stack failed to delete due to lingering object versions in the bucket, despite the Bucket Versioning being suspended.
What was the solution? (How)
Replaced the usage of create_secure_bucket() with direct bucket and bucket policy creation.
Added a deletion routine that ensures all versions of objects in the bucket are deleted to prevent DELETE_FAILED state with the CFN stack.
What is the impact of this change?
Test resources for Job Attachment are a bit cleaned up.
The CFN stack for testing can be deleted successfully.
What was the problem/requirement? (What/Why)
This PR tries to address two issues:
create_secure_bucket()
utility function to create an S3 bucket and bucket policy for Job Attachment integration test, which had extraneous attributes and additional log bucket, and it felt overkill for what we actually needed.What was the solution? (How)
create_secure_bucket()
with direct bucket and bucket policy creation.DELETE_FAILED
state with the CFN stack.What is the impact of this change?
How was this change tested?
hatch run lint && hatch run test
Was this change documented?
No.
Is this a breaking change?
No.