parent
ad5eec56fb
commit
55ed6475bc
@ -0,0 +1,10 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# This currently will only import aws_route53_records - and it will output the commands to be run |
||||||
|
# Please only use this as a last resort |
||||||
|
grep -A 100000 "Terraform will perform the following actions:" $1|grep -B 1000000 "Plan:"|sed 's/\e\[\d*(;\d+)*m//g'| \ |
||||||
|
awk \ |
||||||
|
'$1 == "+" && $2 ~ /aws_route53_record/ { active = 1; record = $2 }; |
||||||
|
$1 == "name:" { name = $2; }; |
||||||
|
$1 == "zone_id:" { id = $2; }; |
||||||
|
$1 == "type:" { type = $2; }; |
||||||
|
$0 == "" { if (active) print "terraform import " record " " id "_" name "_" type; active = 0; }'| sed 's/"//g' |
Loading…
Reference in new issue