I love #regex based tools like sed
.
Customer wanted me to set up some automation to capture what it was they had previously been doing by hand. One of those hand-jammed components was a custom #RDS parameter-group that they'd attached to their reference (#postgresql) database. There were a couple-hundred settings in it, so I wasn't jazzed about trying to hand-capture that into a #Terraform or #Ansible workflow.
However, I was able to automate ganking their hand-jammed content and replicate it in a #Terraform template. First, I combined a couple, nested aws rds …
queries to fetch the data. The I wrote a multi-line sed
filter to reformat the aws rds …
queries' JSON output into TF-compatible config stanzas. Ran the resulting TF module through terraform fmt
, terraform validate
and then a terraform apply
and I suddenly had a new RDS parameter-group in my dev-account that seemingly mirrors what was in the customer's production account. All told, took about half an hour to get the aws
queries and, especially, the sed
commands worked out. It had initially looked like it might have taken me all day (had I not been able to pipeline it).