aws-samples / aws-samples/aws-systems-manager-amazon-ebs-management
Should consider no AttachVolume, DetachVolume etc. events scenario
- Dominant language
- Python
- Stars
- 12
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
def test_1VolumeNoAttachDetach_CID(aws_credentials):
# Test case summary:
# Sharp after the cleaning days (e.g. 15 days) end, terminate the instance the volume attached to,
# before the ConfigService capturing the status changes, the cleanup tool runs
#
# Result in:
# 1) no CreateVolume, AttachVolume and DetachVolume etc. events
# 2) the state of last Config Item is "in-use" captured long time ago (when the instance created), e.g. 15 days ago
#
# Solution:
# this can be fixed by look into related instances CloudTrail events
#
cleanup = CleanupEbs()
instIds = cleanup.create_instances(count=1) # NOTE set volume delete_on_termination = false
instVolIds = cleanup.volumeIdsOf(instIds)
with freeze_time(cleanup.nDaysLater(days=15)):
cleanup.terminate_instances(instIds)
......
# NOTE: test result: the volume is deleted
Contributor guide
Assessment
This issue has not been assessed yet.