Skip to content
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

feat: improve the provider configuration and init for TF version 0.13 and 0.12 #248

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 44 additions & 7 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The provider needs to be configured with the proper credentials before it can be

Use the navigation to the left to read about the available resources.

## Configuration of the provider
## Provider configuration

Requests to OVHcloud APIs require a set of secrets keys and the definition of the API end point.
See [First Steps with the API](https://docs.ovh.com/gb/en/customer/first-steps-with-ovh-api/) (or the French version, [Premiers pas avec les API OVHcloud](https://docs.ovh.com/fr/api/api-premiers-pas/)) for a detailed explanation.
Expand All @@ -23,17 +23,36 @@ These keys can be generated via the [OVH token generation page](https://api.ovh.

These parameters can be configured directly in the provider block as shown hereafter.

Terraform 0.13 and later:

```hcl
# Configure the OVHcloud Provider
terraform {
required_providers {
ovh = {
source = "ovh/ovh"
}
}
}

provider "ovh" {
endpoint = "ovh-eu"
application_key = "yyyyyy"
application_secret = "xxxxxxxxxxxxxx"
application_key = "xxxxxxxxx"
application_secret = "yyyyyyyyy"
consumer_key = "zzzzzzzzzzzzzz"
}
```

Terraform 0.12 and earlier:

```hcl
# Configure the OVHcloud Provider
provider "ovh" {
endpoint = "ovh-eu"
application_key = "xxxxxxxxx"
application_secret = "yyyyyyyyy"
consumer_key = "zzzzzzzzzzzzzz"
}

Alternatively the secret keys can be retrieved from your environment.

* `OVH_ENDPOINT`
Expand All @@ -47,9 +66,27 @@ This later method (or a similar alternative) is recommended to avoid storing sec
## Example Usage

```hcl
# Create a public cloud user
resource "ovh_cloud_project_user" "user-test" {
# ...
variable "service_name" {
default = "wwwwwww"
}

# Create an OVHcloud Managed Kubernetes cluster
resource "ovh_cloud_project_kube" "my_kube_cluster" {
service_name = var.service_name
name = "my-super-kube-cluster"
region = "GRA5"
version = "1.22"
}

# Create a Node Pool for our Kubernetes clusterx
resource "ovh_cloud_project_kube_nodepool" "node_pool" {
service_name = var.service_name
kube_id = ovh_cloud_project_kube.my_kube_cluster.id
name = "my-pool" //Warning: "_" char is not allowed!
flavor_name = "b2-7"
desired_nodes = 3
max_nodes = 3
min_nodes = 3
}
```

Expand Down