Skip to content

Commit 71a2f17

Browse files
authored
Merge pull request #248 from ovh/ava-improve-doc
feat: improve the provider configuration and init for TF version 0.13 and 0.12
2 parents 4432c49 + 7ebcb99 commit 71a2f17

File tree

1 file changed

+44
-7
lines changed

1 file changed

+44
-7
lines changed

website/docs/index.html.markdown

+44-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The provider needs to be configured with the proper credentials before it can be
1313

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

16-
## Configuration of the provider
16+
## Provider configuration
1717

1818
Requests to OVHcloud APIs require a set of secrets keys and the definition of the API end point.
1919
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.
@@ -23,17 +23,36 @@ These keys can be generated via the [OVH token generation page](https://api.ovh.
2323

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

26+
Terraform 0.13 and later:
2627

2728
```hcl
28-
# Configure the OVHcloud Provider
29+
terraform {
30+
required_providers {
31+
ovh = {
32+
source = "ovh/ovh"
33+
}
34+
}
35+
}
36+
2937
provider "ovh" {
3038
endpoint = "ovh-eu"
31-
application_key = "yyyyyy"
32-
application_secret = "xxxxxxxxxxxxxx"
39+
application_key = "xxxxxxxxx"
40+
application_secret = "yyyyyyyyy"
3341
consumer_key = "zzzzzzzzzzzzzz"
3442
}
3543
```
3644

45+
Terraform 0.12 and earlier:
46+
47+
```hcl
48+
# Configure the OVHcloud Provider
49+
provider "ovh" {
50+
endpoint = "ovh-eu"
51+
application_key = "xxxxxxxxx"
52+
application_secret = "yyyyyyyyy"
53+
consumer_key = "zzzzzzzzzzzzzz"
54+
}
55+
3756
Alternatively the secret keys can be retrieved from your environment.
3857
3958
* `OVH_ENDPOINT`
@@ -47,9 +66,27 @@ This later method (or a similar alternative) is recommended to avoid storing sec
4766
## Example Usage
4867
4968
```hcl
50-
# Create a public cloud user
51-
resource "ovh_cloud_project_user" "user-test" {
52-
# ...
69+
variable "service_name" {
70+
default = "wwwwwww"
71+
}
72+
73+
# Create an OVHcloud Managed Kubernetes cluster
74+
resource "ovh_cloud_project_kube" "my_kube_cluster" {
75+
service_name = var.service_name
76+
name = "my-super-kube-cluster"
77+
region = "GRA5"
78+
version = "1.22"
79+
}
80+
81+
# Create a Node Pool for our Kubernetes clusterx
82+
resource "ovh_cloud_project_kube_nodepool" "node_pool" {
83+
service_name = var.service_name
84+
kube_id = ovh_cloud_project_kube.my_kube_cluster.id
85+
name = "my-pool" //Warning: "_" char is not allowed!
86+
flavor_name = "b2-7"
87+
desired_nodes = 3
88+
max_nodes = 3
89+
min_nodes = 3
5390
}
5491
```
5592

0 commit comments

Comments
 (0)