Terraform is declarative IaC, but sometimes you need to write an imperative fix using, e.g, aws cli, I have terraform project which is maintained by CI/CD pipelines and works fine by maintaining the infrastructure in the main Region we work on.
But the time comes to do something that the Terraform is not yet ready to handle, like enable Aws Config in all AWS regions across tons of accounts.
Since Terraform is declarative and deployed by CI/CD, you don't have any issue adding/changing additional modules, commit, and the CI/CD will take care of the rest.
But what's the corresponding best practice solution for maintaining, say, bash scripts with aws cli commands, and each time new script is created should be run once?
I have a lot of manual solutions, like create a repo and keep updating it with removing applied scripts/adding new script each time. Or build new tool for maintaining the state of which scripts already done and just run new scripts each time. But I'm asking if there is already a best practice solution whether from AWS, 3rd party or there is no.