From 92297d46ff74ee1ce2eddc28e2a2a26982bbb3b7 Mon Sep 17 00:00:00 2001 From: garland Date: Wed, 3 Jul 2019 15:56:20 -0700 Subject: [PATCH] Adding info on updating the terraform s3 buckets Signed-off-by: garland --- docs/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/README.md b/docs/README.md index 003da9e93..5b0afcd4e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,6 +50,34 @@ and require some kind of large scale migration or cut over. We suggest you take the `cidr-ranges.md` file as a good place to start. +# Replace all of the S3 buckets used +In the examples, S3 buckets are used for Terraform and Kops as the state store. +This allows you to not hold the state of what you launched local to your machine and +on a remote machine. This is useful if you accidentally remove the files from your +local machine or if multiple people or machines will be updating these resources. + +One problem is that S3 bucket names are global meaning only one can exist. If I +used a bucket name, that means you can not use that same name. + +For you to use this, you will need to update the bucket names in this repository +to what you want to use. We are using the bucket name `kubernetes-ops-123-terraform-state` + +The following is a way to replace all of the occurrences of `kubernetes-ops-123-terraform-state` +with `kubernetes-ops-xxxxxx-terraform-state`. A suggestion would be to replace the +`xxxxxx` with another random number. + +Linux: +``` +find . -name '*' -exec sed -i -e 's/kubernetes-ops-123-terraform-state/kubernetes-ops-xxxxxx-terraform-state/g' {} \; +``` + +OSX: +``` +find . -type f | xargs sed -i '' 's/kubernetes-ops-123-terraform-state/kubernetes-ops-xxxxx-terraform-state/g' +``` + +You can alternatively use your IDE to search and replace this string + # VPC Creation Directory: /tf-environment