mirror of
https://github.com/status-im/infra-utils.git
synced 2025-02-23 09:28:08 +00:00
15 lines
345 B
Awk
15 lines
345 B
Awk
# Script for renaming Terraform resources when changing names.
|
|
# WARNING: Use '-no-color' flag when running 'terraform plan'.
|
|
/will be/{
|
|
if ($5 == "updated") {
|
|
next
|
|
}
|
|
if ($5 == "created") {
|
|
new = $2
|
|
}
|
|
if ($5 == "destroyed") {
|
|
old = $2
|
|
printf "terraform state mv '%s' '%s'\n", old, new
|
|
}
|
|
}
|