Automated Cleanup of Unused AWS Cloud Formation Resources Using AWS Resource Tags and Lambda Functions


Authors : Prudhveer Reddy Kankar

Volume/Issue : Volume 10 - 2025, Issue 1 - January


Google Scholar : https://tinyurl.com/2hp8dfmf

Scribd : https://tinyurl.com/3yttwxb4

DOI : https://doi.org/10.5281/zenodo.14885967


Abstract : The AWS cloud platform has experienced rapid growth due to its expanding features and support for on-demand access to compute, storage, networking, and virtualization. AWS CloudFormation is a service that enables developers and busi- nesses to create, provision, and manage a collection of related AWS and third-party resources in an orderly and predictable manner. AWS CodePipeline can be utilized to deploy AWS CloudFormation stacks, enhancing continuous integration and continuous delivery (CI/CD) capabilities. Companies often use multiple AWS accounts for different environments and deploy resources across them. As part of the CI/CD process, a central AWS account is used to deploy CloudFormation stacks to other accounts using AWS CodePipeline. However, when an application is no longer needed, there is no straightforward way to use the centralized account to delete the unused CloudFormation resources. While CloudFormation stacks can be updated and modified from the central account using AWS CodePipeline, deleting them remains a challenge. This paper discusses an approach to address this issue using CloudFormation tags and AWS Lambda.

Keywords : AWS Code Pipeline, AWS Lambda, CI/CD, Cloud Resource Management, Tags, Automation, AWS Cleanup Processes, Software Development Processes.

References :

  1. AWS Documentation. "Tagging AWS Resources." Available: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html, Accessed: Jan. 23, 2021.
  2. S. S. Gill, I. Chana, M. Singh, and R. Buyya, "Efficient Management and Allocation of Resources in Serverless," IEEE Transactions on Cloud Computing, vol. 7, no. 4, pp. 1006-1019, 2019.
  3. S. S. Gill, I. Chana, and R. Buyya, "Modeling and Optimization of Performance and Cost of Serverless Computing," IEEE Transactions on Cloud Computing, vol. 9, no. 3, pp. 964-977, 2021.
  4. AWS Documentation. "Error Retries and Exponential Backoff in AWS."Available:https://docs.aws.amazon.com/general/latest/gr/api-retries.html, Accessed: Jan. 23, 2021.
  5. J. Li, L. Yu, J. Zhang, and Z. Li, "A Survey of Security in Cloud Computing," IEEE Access, vol. 6, pp. 64724-64736, 2019.
  6. M. Ali, A. R. Butt, and M. F. Younis, "Resource Management and Allocation in Multi-Cloud Environments: A Survey," IEEE Access, vol. 8, pp. 23524-23542, 2020.

The AWS cloud platform has experienced rapid growth due to its expanding features and support for on-demand access to compute, storage, networking, and virtualization. AWS CloudFormation is a service that enables developers and busi- nesses to create, provision, and manage a collection of related AWS and third-party resources in an orderly and predictable manner. AWS CodePipeline can be utilized to deploy AWS CloudFormation stacks, enhancing continuous integration and continuous delivery (CI/CD) capabilities. Companies often use multiple AWS accounts for different environments and deploy resources across them. As part of the CI/CD process, a central AWS account is used to deploy CloudFormation stacks to other accounts using AWS CodePipeline. However, when an application is no longer needed, there is no straightforward way to use the centralized account to delete the unused CloudFormation resources. While CloudFormation stacks can be updated and modified from the central account using AWS CodePipeline, deleting them remains a challenge. This paper discusses an approach to address this issue using CloudFormation tags and AWS Lambda.

Keywords : AWS Code Pipeline, AWS Lambda, CI/CD, Cloud Resource Management, Tags, Automation, AWS Cleanup Processes, Software Development Processes.

Never miss an update from Papermashup

Get notified about the latest tutorials and downloads.

Subscribe by Email

Get alerts directly into your inbox after each post and stay updated.
Subscribe
OR

Subscribe by RSS

Add our RSS to your feedreader to get regular updates from us.
Subscribe