Skip to content

Commit 9b5797a

Browse files
committed
adds new resource names following issue #23 outlines
1 parent cd90cf3 commit 9b5797a

9 files changed

+232
-1
lines changed

ovh/provider.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,26 @@ 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{
55+
"ovh_domain_zone_record": resourceOvhDomainZoneRecord(),
56+
// New naming schema (issue #23)
57+
"ovh_cloud_network_private": resourcePublicCloudPrivateNetwork(),
58+
"ovh_cloud_network_private_subnet": resourcePublicCloudPrivateNetworkSubnet(),
59+
"ovh_cloud_user": resourcePublicCloudUser(),
60+
"ovh_vrack_cloudproject": resourceVRackPublicCloudAttachment(),
61+
// Legacy naming schema (new resources should not be added here)
5162
"ovh_publiccloud_private_network": resourcePublicCloudPrivateNetwork(),
5263
"ovh_publiccloud_private_network_subnet": resourcePublicCloudPrivateNetworkSubnet(),
5364
"ovh_publiccloud_user": resourcePublicCloudUser(),
5465
"ovh_vrack_publiccloud_attachment": resourceVRackPublicCloudAttachment(),
55-
"ovh_domain_zone_record": resourceOvhDomainZoneRecord(),
5666
},
5767

5868
ConfigureFunc: configureProvider,
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)