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"
....

 

 

If you are using Windows joined to Active Directory on your AWS EC2 server and you have configured SSM for it, you can move out of the domain by entering the following commands line by line.

$securePass = ConvertTo-SecureString "******" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ("Domain\User", $securePass)
Remove-Computer -Credential $cred -Force -Verbose

 

+ Recent posts