-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add doc for share environments #193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
I left some small comments.
docs/ShareEnvironment.md
Outdated
|
||
## Get a public/private key-pair from the person who built the environment | ||
|
||
:memo: Also need all the tfsatte files when using `local` backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small spelling mistake in tfsatte
.
Expected tfstate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! fixed in e6261d1.
docs/ShareEnvironment.md
Outdated
private_key_path = "./example_key" | ||
``` | ||
|
||
- Update the output value `private_key_path` and `public_key_path` of tfsate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small spelling mistake in tfsatte
.
Expected tfstate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions on the explanation.
I have one question.
By doing this, an engineer who deployed an environment first can still have access to the environment?
In other words, is it for sharing or delegating?
docs/ShareEnvironment.md
Outdated
@@ -0,0 +1,35 @@ | |||
# How to share environment with others |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# How to share environment with others | |
# How to share environments with others |
docs/ShareEnvironment.md
Outdated
@@ -0,0 +1,35 @@ | |||
# How to share environment with others | |||
|
|||
This explanation is for multiple person operating in the same environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This explanation is for multiple person operating in the same environment. | |
Non-testing environments tend to be shared and operated with multiple DevOps engineers. | |
This document explains how to do it properly. |
docs/ShareEnvironment.md
Outdated
|
||
This explanation is for multiple person operating in the same environment. | ||
|
||
## Get a public/private key-pair from the person who built the environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Get a public/private key-pair from the person who built the environment | |
## Get a private key from the person who has built an environment. |
Since we can just generate a corresponding public key, I deleted the statement.
docs/ShareEnvironment.md
Outdated
|
||
## Get a public/private key-pair from the person who built the environment | ||
|
||
:memo: Also need all the tfstate files when using `local` backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:memo: Also need all the tfstate files when using `local` backend | |
You can generate a corresponding public key with `ssh-keygen -yf ~/.ssh/privatekey.pem > publickey.pem`. | |
If an environment is created with `local` backend, you need all the tfstate files additionally. But, as a best practice, it's better to use cloud storage backends such as AWS S3 or Azure Blob Storage for an environment that is shared among multiple engineers. |
docs/ShareEnvironment.md
Outdated
|
||
## Update the tfstate of the network module | ||
|
||
- Fix key_path of `example.tfvars` in your local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix key_path of `example.tfvars` in your local | |
Update the key paths of `tfvars` file in your local such as `example.tfvars` in the example. |
docs/ShareEnvironment.md
Outdated
|
||
## Update the tfstate of the network module | ||
|
||
- Fix key_path of `example.tfvars` in your local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's weird to talk about example
because it's not the case mostly.
docs/ShareEnvironment.md
Outdated
private_key_path = "./example_key" | ||
``` | ||
|
||
- Update the output value `private_key_path` and `public_key_path` of tfstate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Update the output value `private_key_path` and `public_key_path` of tfstate | |
Then, update tfstate file as follows. |
docs/ShareEnvironment.md
Outdated
- Update the output value `private_key_path` and `public_key_path` of tfstate | ||
|
||
``` | ||
cd example/[aws|azure]/network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd example/[aws|azure]/network | |
cd /path/to/network-module |
docs/ShareEnvironment.md
Outdated
terraform refresh -var-file=example.tfvars | ||
``` | ||
|
||
## Update the tfstate of the cassandra, scalardl and monitor modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Update the tfstate of the cassandra, scalardl and monitor modules | |
## Update the tfstate of the cassandra, scalardl, and monitor modules |
docs/ShareEnvironment.md
Outdated
|
||
## Update the tfstate of the cassandra, scalardl and monitor modules | ||
|
||
- Update the value `private_key_path` and `public_key_path` of `data.terraform_remote_state.network` in each tfstate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Update the value `private_key_path` and `public_key_path` of `data.terraform_remote_state.network` in each tfstate | |
Update the values of `private_key_path` and `public_key_path` of `data.terraform_remote_state.network` in each tfstate and do as follows. |
@tei-k I've given some suggestions but are they correct? Also, how about this?
|
@feeblefakie |
docs/ShareEnvironment.md
Outdated
|
||
## Update the tfstate of the cassandra, scalardl, and monitor modules | ||
|
||
Update the values of `private_key_path` and `public_key_path` of `data.terraform_remote_state.network` in each tfstate and do as follows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing with psim environment but I don't have tfstate file.
Do we need to pull ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tfstate file in the psim environment is on s3, so you don't need to pull it to local.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this line applies only for local
backend. How about the following commands? They need to be done whether or not local?
Anyways, I think it requires some updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They need to be done whether or not local?
Yes, This is necessary regardless of the back-end type. (not only for local)
|
||
## Get a private key from the person who has built an environment. | ||
|
||
You can generate a corresponding public key with `ssh-keygen -yf ~/.ssh/privatekey.pem > publickey.pem`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can generate a corresponding public key with `ssh-keygen -yf ~/.ssh/privatekey.pem > publickey.pem`. | |
First of all, please get a private key that is used to build an environment by the person who did it. | |
You can generate a corresponding public key with `ssh-keygen -yf ~/.ssh/privatekey.pem > publickey.pem`. | |
Here we assume we have `/path/to/privatekey.pem` and `/path/to/publickey.pub`. |
docs/ShareEnvironment.md
Outdated
Update the key paths of `tfvars` file in your local such as `example.tfvars` in the example. | ||
|
||
``` | ||
public_key_path = "./publickey.pem" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public_key_path = "./publickey.pem" | |
public_key_path = "/path/to/publickey.pem" |
docs/ShareEnvironment.md
Outdated
``` | ||
public_key_path = "./publickey.pem" | ||
|
||
private_key_path = "./privatekey.pem" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private_key_path = "./privatekey.pem" | |
private_key_path = "/path/to/privatekey.pem" |
docs/ShareEnvironment.md
Outdated
|
||
## Update the tfstate of the cassandra, scalardl, and monitor modules | ||
|
||
Update the values of `private_key_path` and `public_key_path` of `data.terraform_remote_state.network` in each tfstate and do as follows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the values of `private_key_path` and `public_key_path` of `data.terraform_remote_state.network` in each tfstate and do as follows. | |
Then, do the following to reflect the above changes to each module. |
@feeblefakie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
@ymorimo I'll merge it but please take a glance when you get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
https://scalar-labs.atlassian.net/browse/DLT-7061
Done
Added doc