terraform/rename.awk: simpler version of move.awk
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
b388b3510f
commit
9932ca7cea
|
@ -0,0 +1,14 @@
|
|||
# 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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue