If you replace the value "vpc-abab" with the string "vpc-cdcd" in vpc_id :

 

# search the vpc_id variable
$ grep -r "vpc_id" .
grep: ./.terraform/providers...: binary file matches
./env/an1-dev.tfvars:vpc_id                                  = "vpc-abab"
./examples/install.tfvars:vpc_id             = "vpc-abab"
./examples/add_role.tfvars:vpc_id             = "vpc-abab"
./examples/account_install.tfvars:vpc_id             = "vpc-abab"
./examples/spot_instance.tfvars:vpc_id             = "vpc-abab"
....

# replace the target value "vpc-abab" with the "vpc-cdcd" as you wish
SOYI$ find . -type f -name "*.tf*" -exec sed -i 's/vpc-abab/vpc-cdcd/g' {} +

# verify if it's correctly replaced
$ grep -r "vpc_id" .
grep: ./.terraform/providers/registry.terraform.io/...: binary file matches
./env/an1-dev.tfvars:vpc_id                                  = "vpc-cdcd"
./examples/install.tfvars:vpc_id             = "vpc-cdcd"
./examples/add_role.tfvars:vpc_id             = "vpc-cdcd"
./examples/account_install.tfvars:vpc_id             = "vpc-cdcd"
./examples/spot_instance.tfvars:vpc_id             = "vpc-cdcd"
....

 

+ Recent posts