Skip to content

Commit

Permalink
fix(CLOUDDEV-414): fixed after review
Browse files Browse the repository at this point in the history
  • Loading branch information
damir.zinatullin committed Jan 12, 2024
1 parent eb0c702 commit 64c4a38
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Using the provider
```shell
$ touch ~/.terraformrc
```
For using terraform without VPN, you should configure mirror:
For using terraform without VPN, you should configure mirror in `~/.terraformrc` file:

```terraform
provider_installation {
Expand All @@ -47,7 +47,7 @@ provider_installation {
It is necessary to add provider settings according to the instructions https://developer.hashicorp.com/terraform/language/providers/requirements:
Each Terraform module must declare which providers it requires, so that Terraform can install and use them.

To use the provider, prepare configuration file provider.tf in module directory
To use the provider, prepare configuration file `provider.tf` in module directory

```terraform
terraform {
Expand All @@ -56,7 +56,7 @@ terraform {
required_providers {
edgecenter = {
source = "Edge-Center/edgecenter"
version = "{version_number}" # need to specify
version = "{version_number}" # need to specify (choose from https://github.com/Edge-Center/terraform-provider-edgecenter/releases)
}
}
}
Expand All @@ -65,7 +65,7 @@ terraform {
provider edgecenter {
edgecenter_platform_api = "https://api.edgecenter.ru/iam"
edgecenter_cloud_api = "https://api.edgecenter.ru/cloud"
permanent_api_token = "{your_permanent_token}" # need to specify
permanent_api_token = "{your_permanent_token}" # need to specify (you can create it on the page https://accounts.edgecenter.ru/profile/api-tokens)
}
```
#### Initialize working directory
Expand Down Expand Up @@ -93,8 +93,14 @@ Development

### Initialization of the project

Before initializing the project you should to set VAULT_ADDR and VAULT_TOKEN envs.

#### Setting Vault envs
Before initializing the project you should to set VAULT_ADDR and VAULT_TOKEN envs:
```bash
export VAULT_ADDR=<you can ask address from Cloud team (matermost tag: @devcloud)>
export VAULT_TOKEN=<you can generate this token in ${VAULT_ADDR} page>
```
#### Initialize
Initialize the project this command:
```sh
$ make init
```
Expand All @@ -109,7 +115,8 @@ $ make build

### Using built Terraform provider

If you want use built provider from previous step you should add dev_overrides opts to ~/.terraformrc:
If you want use built provider from previous step, or use dubug mode, you should add dev_overrides opts to
`~/.terraformrc` file:

```terraform
provider_installation {
Expand All @@ -131,6 +138,26 @@ provider_installation {
}
}
```
Then you should use `"local.edgecenter.ru/repo/edgecenter"` source in required_provider settings in `provider.tf` file:

```terraform
terraform {
required_version = ">= 0.13.0"
required_providers {
edgecenter = {
source = "local.edgecenter.ru/repo/edgecenter"
}
}
}
provider edgecenter {
edgecenter_platform_api = "https://api.edgecenter.ru/iam"
edgecenter_cloud_api = "https://api.edgecenter.ru/cloud"
permanent_api_token = "{your_permanent_token}" # need to specify (you can create it on the page https://accounts.edgecenter.ru/profile/api-tokens)
}
```

Testing
------------------
Expand Down

0 comments on commit 64c4a38

Please sign in to comment.