Skip to content

adds new resource names following issue #23 outlines #31

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

Merged
merged 1 commit into from
May 22, 2018
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion ovh/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,26 @@ func Provider() terraform.ResourceProvider {
},

DataSourcesMap: map[string]*schema.Resource{
// New naming schema (issue #23)
"ovh_cloud_region": dataSourcePublicCloudRegion(),
"ovh_cloud_regions": dataSourcePublicCloudRegions(),
// Legacy naming schema (new datasources should not be added here)
"ovh_publiccloud_region": dataSourcePublicCloudRegion(),
"ovh_publiccloud_regions": dataSourcePublicCloudRegions(),
},

ResourcesMap: map[string]*schema.Resource{
"ovh_domain_zone_record": resourceOvhDomainZoneRecord(),
// New naming schema (issue #23)
"ovh_cloud_network_private": resourcePublicCloudPrivateNetwork(),
"ovh_cloud_network_private_subnet": resourcePublicCloudPrivateNetworkSubnet(),
"ovh_cloud_user": resourcePublicCloudUser(),
"ovh_vrack_cloudproject": resourceVRackPublicCloudAttachment(),
// Legacy naming schema (new resources should not be added here)
"ovh_publiccloud_private_network": resourcePublicCloudPrivateNetwork(),
"ovh_publiccloud_private_network_subnet": resourcePublicCloudPrivateNetworkSubnet(),
"ovh_publiccloud_user": resourcePublicCloudUser(),
"ovh_vrack_publiccloud_attachment": resourceVRackPublicCloudAttachment(),
"ovh_domain_zone_record": resourceOvhDomainZoneRecord(),
},

ConfigureFunc: configureProvider,
Expand Down
45 changes: 45 additions & 0 deletions website/docs/d/cloud_region.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: "ovh"
page_title: "OVH: cloud_region"
sidebar_current: "docs-ovh-datasource-cloud-region"
description: |-
Get information & status of a region associated with a public cloud project.
---

# cloud_region

Use this data source to retrieve information about a region associated with a
public cloud project. The region must be associated with the project.

## Example Usage

```hcl
data "ovh_cloud_region" "GRA1" {
project_id = "XXXXXX"
region = "GRA1"
}
```

## Argument Reference


* `project_id` - (Required) The id of the public cloud project. If omitted,
the `OVH_PROJECT_ID` environment variable is used.

* `region` - (Required) The name of the region associated with the public cloud
project.

## Attributes Reference

`id` is set to the ID of the project concatenated with the name of the region.
In addition, the following attributes are exported:

* `continent_code` - the code of the geographic continent the region is running.
E.g.: EU for Europe, US for America...
* `datacenter_location` - The location code of the datacenter.
E.g.: "GRA", meaning Gravelines, for region "GRA1"
* `continentCode` - (Deprecated) Use `continent_code` instead.
* `datacenterLocation` - (Deprecated) Use `datacenter_location` instead.
* `services` - The list of public cloud services running within the region
* `name` - the name of the public cloud service
* `status` - the status of the service
33 changes: 33 additions & 0 deletions website/docs/d/cloud_regions.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: "ovh"
page_title: "OVH: cloud_regions"
sidebar_current: "docs-ovh-datasource-cloud-regions"
description: |-
Get the list of regions associated with a public cloud project.
---

# cloud_regions

Use this data source to get the regions of a public cloud project.

## Example Usage

```hcl
data "ovh_cloud_regions" "regions" {
project_id = "XXXXXX"
}
```

## Argument Reference


* `project_id` - (Required) The id of the public cloud project. If omitted,
the `OVH_PROJECT_ID` environment variable is used.


## Attributes Reference

`id` is set to the ID of the project. In addition, the following attributes
are exported:

* `names` - The list of regions associated with the project
2 changes: 2 additions & 0 deletions website/docs/d/publiccloud_region.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: |-

# publiccloud\_region

__DEPRECATED__ use `ovh_cloud_region` instead.

Use this data source to retrieve information about a region associated with a
public cloud project. The region must be associated with the project.

Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/publiccloud_regions.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: |-

# publiccloud\_regions

__DEPRECATED__ use `ovh_cloud_regions` instead.

Use this data source to get the regions of a public cloud project.

## Example Usage
Expand Down
50 changes: 50 additions & 0 deletions website/docs/r/cloud_network_private.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
layout: "ovh"
page_title: "OVH: cloud_network_private"
sidebar_current: "docs-ovh-resource-cloud-network-private"
description: |-
Creates a private network in a public cloud project.
---

# ovh_cloud_network_private

Creates a private network in a public cloud project.

## Example Usage

```
resource "ovh_cloud_network_private" "net" {
project_id = "67890"
name = "admin_network"
regions = ["GRA1", "BHS1"]
}
```

## Argument Reference

The following arguments are supported:

* `project_id` - (Required) The id of the public cloud project. If omitted,
the `OVH_PROJECT_ID` environment variable is used.

* `name` - (Required) The name of the network.

* `vlan_id` - a vlan id to associate with the network.
Changing this value recreates the resource. Defaults to 0.

* `regions` - an array of valid OVH public cloud region ID in which the network
will be available. Ex.: "GRA1". Defaults to all public cloud regions.

## Attributes Reference

The following attributes are exported:

* `project_id` - See Argument Reference above.
* `name` - See Argument Reference above.
* `vlan_id` - See Argument Reference above.
* `regions` - See Argument Reference above.
* `regions_status` - A map representing the status of the network per region.
* `regions_status/region` - The id of the region.
* `regions_status/status` - The status of the network in the region.
* `status` - the status of the network. should be normally set to 'ACTIVE'.
* `type` - the type of the network. Either 'private' or 'public'.
77 changes: 77 additions & 0 deletions website/docs/r/cloud_network_private_subnet.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
layout: "ovh"
page_title: "OVH: cloud_network_private_subnet"
sidebar_current: "docs-ovh-resource-cloud-network-private-subnet"
description: |-
Creates a subnet in a private network of a public cloud project.
---

# ovh_cloud_network_private_subnet

Creates a subnet in a private network of a public cloud project.

## Example Usage

```
resource "ovh_cloud_network_private_subnet" "subnet" {
project_id = "67890"
network_id = "0234543"
region = "GRA1"
start = "192.168.168.100"
end = "192.168.168.200"
network = "192.168.168.0/24"
dhcp = true
no_gateway = false
}
```

## Argument Reference

The following arguments are supported:

* `project_id` - (Required) The id of the public cloud project. If omitted,
the `OVH_PROJECT_ID` environment variable is used.
Changing this forces a new resource to be created.

* `network_id` - (Required) The id of the network.
Changing this forces a new resource to be created.

* `dhcp` - (Optional) Enable DHCP.
Changing this forces a new resource to be created. Defaults to false.
_
* `start` - (Required) First ip for this region.
Changing this value recreates the subnet.

* `end` - (Required) Last ip for this region.
Changing this value recreates the subnet.

* `network` - (Required) Global network in CIDR format.
Changing this value recreates the subnet

* `region` - The region in which the network subnet will be created.
Ex.: "GRA1". Changing this value recreates the resource.

* `no_gateway` - Set to true if you don't want to set a default gateway IP.
Changing this value recreates the resource. Defaults to false.

## Attributes Reference

The following attributes are exported:

* `project_id` - See Argument Reference above.
* `network_id` - See Argument Reference above.
* `dhcp_id` - See Argument Reference above.
* `start` - See Argument Reference above.
* `end` - See Argument Reference above.
* `network` - See Argument Reference above.
* `region` - See Argument Reference above.
* `gateway_ip` - The IP of the gateway
* `no_gateway` - See Argument Reference above.
* `cidr` - Ip Block representing the subnet cidr.
* `ip_pools` - List of ip pools allocated in the subnet.
* `ip_pools/network` - Global network with cidr.
* `ip_pools/region` - Region where this subnet is created.
* `ip_pools/dhcp` - DHCP enabled.
* `ip_pools/end` - Last ip for this region.
* `ip_pools/start` - First ip for this region.

44 changes: 44 additions & 0 deletions website/docs/r/cloud_user.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
layout: "ovh"
page_title: "OVH: ovh_cloud_user"
sidebar_current: "docs-ovh-resource-cloud-user"
description: |-
Creates a user in a public cloud project.
---

# ovh_cloud_user

Creates a user in a public cloud project.

## Example Usage

```
resource "ovh_cloud_user" "user1" {
project_id = "67890"
}
```

## Argument Reference

The following arguments are supported:

* `project_id` - (Required) The id of the public cloud project. If omitted,
the `OVH_PROJECT_ID` environment variable is used.

* `description` - A description associated with the user.

## Attributes Reference

The following attributes are exported:

* `project_id` - See Argument Reference above.
* `description` - See Argument Reference above.
* `username` - the username generated for the user. This username can be used with
the Openstack API.
* `password` - (Sensitive) the password generated for the user. The password can
be used with the Openstack API. This attribute is sensitive and will only be
retrieve once during creation.
* `status` - the status of the user. should be normally set to 'ok'.
* `creation_date` - the date the user was created.
* `openstack_rc` - a convenient map representing an openstack_rc file.
Note: no password nor sensitive token is set in this map.
1 change: 1 addition & 0 deletions website/docs/r/publiccloud_private_network.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: |-

# ovh_publiccloud\_private_network

__DEPRECATED__ use `ovh_cloud_network_private` instead.
Creates a private network in a public cloud project.

## Example Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: |-

# ovh_publiccloud\_private_network\_subnet

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

## Example Usage
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/publiccloud_user.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: |-

# ovh_publiccloud\_user

__DEPRECATED__ use `ovh_cloud_user` instead.
Creates a user in a public cloud project.

## Example Usage
Expand Down
46 changes: 46 additions & 0 deletions website/docs/r/vrack_cloudproject.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: "ovh"
page_title: "OVH: vrack_cloudproject"
sidebar_current: "docs-ovh-resource-vrack-cloudproject"
description: |-
Attach an existing public cloud project to an existing VRack.
---

# ovh_vrack_cloudproject

Attach an existing public cloud project to an existing VRack.

## Example Usage

```
resource "ovh_vrack_cloudproject" "attach" {
vrack_id = "12345"
project_id = "67890"
}
```

## Argument Reference

The following arguments are supported:

* `vrack_id` - (Required) The id of the vrack. If omitted, the `OVH_VRACK_ID`
environment variable is used.

* `project_id` - (Required) The id of the public cloud project. If omitted,
the `OVH_PROJECT_ID` environment variable is used.

## Attributes Reference

The following attributes are exported:

* `vrack_id` - See Argument Reference above.
* `project_id` - See Argument Reference above.

## Notes

The vrack attachment isn't a proper resource with an ID. As such, the resource id will
be forged from the vrack and project ids and there's no correct way to import the
resource in terraform. When the resource is created by terraform, it first checks if the
attachment already exists within OVH infrastructure; if it exists it set the resource id
without modifying anything. Otherwise, it will try to attach the vrack with the public
cloud project.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: |-

# ovh_vrack\_publiccloud\_attachment

__DEPRECATED__ use `ovh_vrack_cloudproject` instead.
Attach an existing PublicCloud project to an existing VRack.

## Example Usage
Expand Down