[{"data":1,"prerenderedAt":63},["ShallowReactive",2],{"pattern-ami-recycle-bin":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":26,"language":31,"level":32,"meta":33,"patternArch":34,"resources":53,"s3URL":6,"services":6,"stem":58,"testing":59,"videoId":6,"__hash__":62},"patterns\u002Fpatterns\u002Fami-recycle-bin.json","AMI de-registration with AWS Lambda and retention in Amazon EC2 Recycle Bin",null,{"text":8},[9],"terraform destroy",[11],"content\u002Fcontributors\u002Fdivya-vijendra-girase.json",{"text":13},[14,15,16],"terraform init","terraform plan","terraform apply","This project demonstrates a pattern to deregister and retain expired AMI and its snapshot with AWS Lambda and Amazon EC2 Recycle Bin","json","Terraform",{"template":21},{"repoURL":22,"templateURL":23,"projectFolder":24,"templateFile":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fami-recycle-bin","serverless-patterns\u002Fami-recycle-bin","ami-recycle-bin","main.tf",{"headline":27,"text":28},"How it works",[29,30],"In this pattern an Amazon EventBridge rule triggers an AWS Lambda function which deregisters an Amazon Machine Image (AMI), deletes the associated snapshot and moves them to the Recycle Bin for retention.","The AWS Lambda function automates the expiration of Amazon Machine Images (AMIs) by moving the AMIs and their associated snapshots to Recycle Bin. Recycle Bin is a feature of Amazon Elastic Compute Cloud (EC2) that allows you to retain AMIs that you have de-registered for a specified retention period, providing an opportunity to recover them if needed. To recover the deleted AMI, its associated snapshot should be recovered first. The Lambda function also adds corresponding tags to both, the AMI and the EBS snapshot, before moving them to Recycle Bin.","Python","200",{},{"icon1":35,"icon2":40,"icon3":43,"line1":47,"line2":51},{"x":36,"y":37,"service":38,"label":39},20,50,"eventbridge","Amazon EventBridge rule",{"x":37,"y":37,"service":41,"label":42},"lambda","AWS Lambda",{"x":44,"y":37,"service":45,"label":46},80,"ec2","Amazon EC2",{"from":48,"to":49,"label":50},"icon1","icon2","",{"from":49,"to":52,"label":50},"icon3",{"bullets":54},[55],{"text":56,"link":57},"Recover deleted Amazon EBS snapshots and EBS-backed AMIs with Recycle Bin","https:\u002F\u002Fdocs.aws.amazon.com\u002Febs\u002Flatest\u002Fuserguide\u002Frecycle-bin.html","patterns\u002Fami-recycle-bin",{"text":60},[61],"See the Github repo for detailed testing instructions.","5hdrvMunWslvOaHCDVQKgsylplx_9NiNbw1WL1l_igg",1779273331528]