Skip to content

Commit a218228

Browse files
authored
Merge branch 'master' into iploadbalancing_tcp_farm
2 parents 34bffdf + 66b6758 commit a218228

13 files changed

+315
-2
lines changed

ovh/provider.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,27 @@ func Provider() terraform.ResourceProvider {
4343
},
4444

4545
DataSourcesMap: map[string]*schema.Resource{
46+
// New naming schema (issue #23)
47+
"ovh_cloud_region": dataSourcePublicCloudRegion(),
48+
"ovh_cloud_regions": dataSourcePublicCloudRegions(),
49+
// Legacy naming schema (new datasources should not be added here)
4650
"ovh_publiccloud_region": dataSourcePublicCloudRegion(),
4751
"ovh_publiccloud_regions": dataSourcePublicCloudRegions(),
4852
},
4953

5054
ResourcesMap: map[string]*schema.Resource{
51-
"ovh_iploadbalancing_tcp_farm": resourceIpLoadbalancingTcpFarm(),
55+
"ovh_domain_zone_record": resourceOvhDomainZoneRecord(),
56+
"ovh_iploadbalancing_tcp_farm": resourceIpLoadbalancingTcpFarm(),
57+
// New naming schema (issue #23)
58+
"ovh_cloud_network_private": resourcePublicCloudPrivateNetwork(),
59+
"ovh_cloud_network_private_subnet": resourcePublicCloudPrivateNetworkSubnet(),
60+
"ovh_cloud_user": resourcePublicCloudUser(),
61+
"ovh_vrack_cloudproject": resourceVRackPublicCloudAttachment(),
62+
// Legacy naming schema (new resources should not be added here)
5263
"ovh_publiccloud_private_network": resourcePublicCloudPrivateNetwork(),
5364
"ovh_publiccloud_private_network_subnet": resourcePublicCloudPrivateNetworkSubnet(),
5465
"ovh_publiccloud_user": resourcePublicCloudUser(),
5566
"ovh_vrack_publiccloud_attachment": resourceVRackPublicCloudAttachment(),
56-
"ovh_domain_zone_record": resourceOvhDomainZoneRecord(),
5767
},
5868

5969
ConfigureFunc: configureProvider,
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: "ovh"
3+
page_title: "OVH: cloud_region"
4+
sidebar_current: "docs-ovh-datasource-cloud-region"
5+
description: |-
6+
Get information & status of a region associated with a public cloud project.
7+
---
8+
9+
# cloud_region
10+
11+
Use this data source to retrieve information about a region associated with a
12+
public cloud project. The region must be associated with the project.
13+
14+
## Example Usage
15+
16+
```hcl
17+
data "ovh_cloud_region" "GRA1" {
18+
project_id = "XXXXXX"
19+
region = "GRA1"
20+
}
21+
```
22+
23+
## Argument Reference
24+
25+
26+
* `project_id` - (Required) The id of the public cloud project. If omitted,
27+
the `OVH_PROJECT_ID` environment variable is used.
28+
29+
* `region` - (Required) The name of the region associated with the public cloud
30+
project.
31+
32+
## Attributes Reference
33+
34+
`id` is set to the ID of the project concatenated with the name of the region.
35+
In addition, the following attributes are exported:
36+
37+
* `continent_code` - the code of the geographic continent the region is running.
38+
E.g.: EU for Europe, US for America...
39+
* `datacenter_location` - The location code of the datacenter.
40+
E.g.: "GRA", meaning Gravelines, for region "GRA1"
41+
* `continentCode` - (Deprecated) Use `continent_code` instead.
42+
* `datacenterLocation` - (Deprecated) Use `datacenter_location` instead.
43+
* `services` - The list of public cloud services running within the region
44+
* `name` - the name of the public cloud service
45+
* `status` - the status of the service
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: "ovh"
3+
page_title: "OVH: cloud_regions"
4+
sidebar_current: "docs-ovh-datasource-cloud-regions"
5+
description: |-
6+
Get the list of regions associated with a public cloud project.
7+
---
8+
9+
# cloud_regions
10+
11+
Use this data source to get the regions of a public cloud project.
12+
13+
## Example Usage
14+
15+
```hcl
16+
data "ovh_cloud_regions" "regions" {
17+
project_id = "XXXXXX"
18+
}
19+
```
20+
21+
## Argument Reference
22+
23+
24+
* `project_id` - (Required) The id of the public cloud project. If omitted,
25+
the `OVH_PROJECT_ID` environment variable is used.
26+
27+
28+
## Attributes Reference
29+
30+
`id` is set to the ID of the project. In addition, the following attributes
31+
are exported:
32+
33+
* `names` - The list of regions associated with the project

website/docs/d/publiccloud_region.html.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ description: |-
88

99
# publiccloud\_region
1010

11+
__DEPRECATED__ use `ovh_cloud_region` instead.
12+
1113
Use this data source to retrieve information about a region associated with a
1214
public cloud project. The region must be associated with the project.
1315

website/docs/d/publiccloud_regions.html.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ description: |-
88

99
# publiccloud\_regions
1010

11+
__DEPRECATED__ use `ovh_cloud_regions` instead.
12+
1113
Use this data source to get the regions of a public cloud project.
1214

1315
## Example Usage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: "ovh"
3+
page_title: "OVH: cloud_network_private"
4+
sidebar_current: "docs-ovh-resource-cloud-network-private"
5+
description: |-
6+
Creates a private network in a public cloud project.
7+
---
8+
9+
# ovh_cloud_network_private
10+
11+
Creates a private network in a public cloud project.
12+
13+
## Example Usage
14+
15+
```
16+
resource "ovh_cloud_network_private" "net" {
17+
project_id = "67890"
18+
name = "admin_network"
19+
regions = ["GRA1", "BHS1"]
20+
}
21+
```
22+
23+
## Argument Reference
24+
25+
The following arguments are supported:
26+
27+
* `project_id` - (Required) The id of the public cloud project. If omitted,
28+
the `OVH_PROJECT_ID` environment variable is used.
29+
30+
* `name` - (Required) The name of the network.
31+
32+
* `vlan_id` - a vlan id to associate with the network.
33+
Changing this value recreates the resource. Defaults to 0.
34+
35+
* `regions` - an array of valid OVH public cloud region ID in which the network
36+
will be available. Ex.: "GRA1". Defaults to all public cloud regions.
37+
38+
## Attributes Reference
39+
40+
The following attributes are exported:
41+
42+
* `project_id` - See Argument Reference above.
43+
* `name` - See Argument Reference above.
44+
* `vlan_id` - See Argument Reference above.
45+
* `regions` - See Argument Reference above.
46+
* `regions_status` - A map representing the status of the network per region.
47+
* `regions_status/region` - The id of the region.
48+
* `regions_status/status` - The status of the network in the region.
49+
* `status` - the status of the network. should be normally set to 'ACTIVE'.
50+
* `type` - the type of the network. Either 'private' or 'public'.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
layout: "ovh"
3+
page_title: "OVH: cloud_network_private_subnet"
4+
sidebar_current: "docs-ovh-resource-cloud-network-private-subnet"
5+
description: |-
6+
Creates a subnet in a private network of a public cloud project.
7+
---
8+
9+
# ovh_cloud_network_private_subnet
10+
11+
Creates a subnet in a private network of a public cloud project.
12+
13+
## Example Usage
14+
15+
```
16+
resource "ovh_cloud_network_private_subnet" "subnet" {
17+
project_id = "67890"
18+
network_id = "0234543"
19+
region = "GRA1"
20+
start = "192.168.168.100"
21+
end = "192.168.168.200"
22+
network = "192.168.168.0/24"
23+
dhcp = true
24+
no_gateway = false
25+
}
26+
```
27+
28+
## Argument Reference
29+
30+
The following arguments are supported:
31+
32+
* `project_id` - (Required) The id of the public cloud project. If omitted,
33+
the `OVH_PROJECT_ID` environment variable is used.
34+
Changing this forces a new resource to be created.
35+
36+
* `network_id` - (Required) The id of the network.
37+
Changing this forces a new resource to be created.
38+
39+
* `dhcp` - (Optional) Enable DHCP.
40+
Changing this forces a new resource to be created. Defaults to false.
41+
_
42+
* `start` - (Required) First ip for this region.
43+
Changing this value recreates the subnet.
44+
45+
* `end` - (Required) Last ip for this region.
46+
Changing this value recreates the subnet.
47+
48+
* `network` - (Required) Global network in CIDR format.
49+
Changing this value recreates the subnet
50+
51+
* `region` - The region in which the network subnet will be created.
52+
Ex.: "GRA1". Changing this value recreates the resource.
53+
54+
* `no_gateway` - Set to true if you don't want to set a default gateway IP.
55+
Changing this value recreates the resource. Defaults to false.
56+
57+
## Attributes Reference
58+
59+
The following attributes are exported:
60+
61+
* `project_id` - See Argument Reference above.
62+
* `network_id` - See Argument Reference above.
63+
* `dhcp_id` - See Argument Reference above.
64+
* `start` - See Argument Reference above.
65+
* `end` - See Argument Reference above.
66+
* `network` - See Argument Reference above.
67+
* `region` - See Argument Reference above.
68+
* `gateway_ip` - The IP of the gateway
69+
* `no_gateway` - See Argument Reference above.
70+
* `cidr` - Ip Block representing the subnet cidr.
71+
* `ip_pools` - List of ip pools allocated in the subnet.
72+
* `ip_pools/network` - Global network with cidr.
73+
* `ip_pools/region` - Region where this subnet is created.
74+
* `ip_pools/dhcp` - DHCP enabled.
75+
* `ip_pools/end` - Last ip for this region.
76+
* `ip_pools/start` - First ip for this region.
77+
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
layout: "ovh"
3+
page_title: "OVH: ovh_cloud_user"
4+
sidebar_current: "docs-ovh-resource-cloud-user"
5+
description: |-
6+
Creates a user in a public cloud project.
7+
---
8+
9+
# ovh_cloud_user
10+
11+
Creates a user in a public cloud project.
12+
13+
## Example Usage
14+
15+
```
16+
resource "ovh_cloud_user" "user1" {
17+
project_id = "67890"
18+
}
19+
```
20+
21+
## Argument Reference
22+
23+
The following arguments are supported:
24+
25+
* `project_id` - (Required) The id of the public cloud project. If omitted,
26+
the `OVH_PROJECT_ID` environment variable is used.
27+
28+
* `description` - A description associated with the user.
29+
30+
## Attributes Reference
31+
32+
The following attributes are exported:
33+
34+
* `project_id` - See Argument Reference above.
35+
* `description` - See Argument Reference above.
36+
* `username` - the username generated for the user. This username can be used with
37+
the Openstack API.
38+
* `password` - (Sensitive) the password generated for the user. The password can
39+
be used with the Openstack API. This attribute is sensitive and will only be
40+
retrieve once during creation.
41+
* `status` - the status of the user. should be normally set to 'ok'.
42+
* `creation_date` - the date the user was created.
43+
* `openstack_rc` - a convenient map representing an openstack_rc file.
44+
Note: no password nor sensitive token is set in this map.

website/docs/r/publiccloud_private_network.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description: |-
88

99
# ovh_publiccloud\_private_network
1010

11+
__DEPRECATED__ use `ovh_cloud_network_private` instead.
1112
Creates a private network in a public cloud project.
1213

1314
## Example Usage

website/docs/r/publiccloud_private_network_subnet.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description: |-
88

99
# ovh_publiccloud\_private_network\_subnet
1010

11+
__DEPRECATED__ use `ovh_cloud_network_private_subnet` instead.
1112
Creates a subnet in a private network of a public cloud project.
1213

1314
## Example Usage

website/docs/r/publiccloud_user.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description: |-
88

99
# ovh_publiccloud\_user
1010

11+
__DEPRECATED__ use `ovh_cloud_user` instead.
1112
Creates a user in a public cloud project.
1213

1314
## Example Usage
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
layout: "ovh"
3+
page_title: "OVH: vrack_cloudproject"
4+
sidebar_current: "docs-ovh-resource-vrack-cloudproject"
5+
description: |-
6+
Attach an existing public cloud project to an existing VRack.
7+
---
8+
9+
# ovh_vrack_cloudproject
10+
11+
Attach an existing public cloud project to an existing VRack.
12+
13+
## Example Usage
14+
15+
```
16+
resource "ovh_vrack_cloudproject" "attach" {
17+
vrack_id = "12345"
18+
project_id = "67890"
19+
}
20+
```
21+
22+
## Argument Reference
23+
24+
The following arguments are supported:
25+
26+
* `vrack_id` - (Required) The id of the vrack. If omitted, the `OVH_VRACK_ID`
27+
environment variable is used.
28+
29+
* `project_id` - (Required) The id of the public cloud project. If omitted,
30+
the `OVH_PROJECT_ID` environment variable is used.
31+
32+
## Attributes Reference
33+
34+
The following attributes are exported:
35+
36+
* `vrack_id` - See Argument Reference above.
37+
* `project_id` - See Argument Reference above.
38+
39+
## Notes
40+
41+
The vrack attachment isn't a proper resource with an ID. As such, the resource id will
42+
be forged from the vrack and project ids and there's no correct way to import the
43+
resource in terraform. When the resource is created by terraform, it first checks if the
44+
attachment already exists within OVH infrastructure; if it exists it set the resource id
45+
without modifying anything. Otherwise, it will try to attach the vrack with the public
46+
cloud project.

website/docs/r/vrack_publiccloud_attachment.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description: |-
88

99
# ovh_vrack\_publiccloud\_attachment
1010

11+
__DEPRECATED__ use `ovh_vrack_cloudproject` instead.
1112
Attach an existing PublicCloud project to an existing VRack.
1213

1314
## Example Usage

0 commit comments

Comments
 (0)