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

fix doc cloud hds #650 #651

Merged
merged 1 commit into from
May 21, 2024
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
99 changes: 54 additions & 45 deletions website/docs/r/cloud_project.html.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
subcategory : "Account Management"
subcategory: "Account Management"
---

# ovh_cloud_project
Expand All @@ -8,9 +8,9 @@ Orders a public cloud project.

## Important

-> __NOTE__ To order a product through Terraform, your account needs to have a default payment method defined. This can be done in the [OVHcloud Control Panel](https://www.ovh.com/manager/#/dedicated/billing/payment/method) or via API with the [/me/payment/method](https://api.ovh.com/console/#/me/payment/method~GET) endpoint.
-> **NOTE** To order a product through Terraform, your account needs to have a default payment method defined. This can be done in the [OVHcloud Control Panel](https://www.ovh.com/manager/#/dedicated/billing/payment/method) or via API with the [/me/payment/method](https://api.ovh.com/console/#/me/payment/method~GET) endpoint.

~> __WARNING__ `BANK_ACCOUNT` is not supported anymore, please update your default payment method to `SEPA_DIRECT_DEBIT`
~> **WARNING** `BANK_ACCOUNT` is not supported anymore, please update your default payment method to `SEPA_DIRECT_DEBIT`

## Example Usage

Expand All @@ -26,9 +26,7 @@ data "ovh_order_cart_product_plan" "cloud" {
price_capacity = "renew"
product = "cloud"
plan_code = "project.2018"
hds_plan_code = "certification.hds.2018"
# plan_code = "project" # when running in the US
# hds_plan_code = "certification.hds" # when running in the US

}

Expand All @@ -44,15 +42,26 @@ resource "ovh_cloud_project" "my_cloud_project" {
}
```

-> __WARNING__ Currently, the OVHcloud Terraform provider does not support deletion of a public cloud project in the US. Removal is possible by manually deleting the project and then manually removing the public cloud project from terraform state.
-> **WARNING** Currently, the OVHcloud Terraform provider does not support deletion of a public cloud project in the US. Removal is possible by manually deleting the project and then manually removing the public cloud project from terraform state.

## HDS Certification

If you want to add the certification HDS option at project creation (you must have a business support level on your account), you can add this configuration on the `ovh_cloud_project`.
If you want to add the certification HDS option at project creation (you must have a business support level on your account), you can add hds datasource and the plan_option configuration on the `ovh_cloud_project`.

```hcl

data "ovh_order_cart_product_options_plan" "hds" {
cart_id = data.ovh_order_cart.mycart.id
price_capacity = "renew"
product = "cloud"
plan_code = "project.2018"
options_plan_code = "certification.hds.2018"
# plan_code = "project" # when running in the US
# options_plan_code = "certification.hds" # when running in the US
}

resource "ovh_cloud_project" "my_cloud_project" {

ovh_subsidiary = data.ovh_order_cart.mycart.ovh_subsidiary
description = "my cloud project"

Expand All @@ -63,9 +72,9 @@ resource "ovh_cloud_project" "my_cloud_project" {
}

plan_option {
duration = data.ovh_order_cart_product_plan.cloud.selected_price.0.duration
plan_code = data.ovh_order_cart_product_plan.cloud.hds_plan_code
pricing_mode = data.ovh_order_cart_product_plan.cloud.selected_price.0.pricing_mode
duration = data.ovh_order_cart_product_options_plan.hds.selected_price.0.duration
plan_code = data.ovh_order_cart_product_options_plan.hds.options_plan_code
pricing_mode = data.ovh_order_cart_product_options_plan.hds.selected_price.0.pricing_mode
}

}
Expand All @@ -76,48 +85,48 @@ resource "ovh_cloud_project" "my_cloud_project" {

The following arguments are supported:

* `urn` - The URN of the cloud project
* `description` - A description associated with the user.
* `ovh_subsidiary` - (Required) OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at [/1.0/me.json under `models.nichandle.OvhSubsidiaryEnum`](https://eu.api.ovh.com/1.0/me.json)
* `plan` - (Required) Product Plan to order
* `duration` - (Required) duration
* `plan_code` - (Required) Plan code. This value must be adapted depending on your `OVH_ENDPOINT` value. It's `project.2018` for `ovh-{eu,ca}` and `project` when using `ovh-us`.
* `pricing_mode` - (Required) Pricing model identifier
* `catalog_name` - Catalog name
* `configuration` - (Optional) Representation of a configuration item for personalizing product
* `label` - (Required) Identifier of the resource
* `value` - (Required) Path to the resource in API.OVH.COM
* `plan_option` - (Optional) Product Plan to order
* `duration` - (Required) duration
* `plan_code` - (Required) Plan code
* `pricing_mode` - (Required) Pricing model identifier
* `catalog_name` - Catalog name
* `configuration` - (Optional) Representation of a configuration item for personalizing product
* `label` - (Required) Identifier of the resource
* `value` - (Required) Path to the resource in API.OVH.COM
- `urn` - The URN of the cloud project
- `description` - A description associated with the user.
- `ovh_subsidiary` - (Required) OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at [/1.0/me.json under `models.nichandle.OvhSubsidiaryEnum`](https://eu.api.ovh.com/1.0/me.json)
- `plan` - (Required) Product Plan to order
- `duration` - (Required) duration
- `plan_code` - (Required) Plan code. This value must be adapted depending on your `OVH_ENDPOINT` value. It's `project.2018` for `ovh-{eu,ca}` and `project` when using `ovh-us`.
- `pricing_mode` - (Required) Pricing model identifier
- `catalog_name` - Catalog name
- `configuration` - (Optional) Representation of a configuration item for personalizing product
- `label` - (Required) Identifier of the resource
- `value` - (Required) Path to the resource in API.OVH.COM
- `plan_option` - (Optional) Product Plan to order
- `duration` - (Required) duration
- `plan_code` - (Required) Plan code
- `pricing_mode` - (Required) Pricing model identifier
- `catalog_name` - Catalog name
- `configuration` - (Optional) Representation of a configuration item for personalizing product
- `label` - (Required) Identifier of the resource
- `value` - (Required) Path to the resource in API.OVH.COM

## Attributes Reference

`id` is set to the order Id. In addition, the following attributes are exported:

* `access` - project access right for the identity that trigger the terraform script.
* `description` - Project description
* `order` - Details about the order that was used to create the public cloud project
* `date` - date
* `order_id` - order id, the same as the `id`
* `expiration_date` - expiration date
* `details` - Information about a Bill entry
* `description` - description
* `order_detail_id` - order detail id
* `domain` - expiration date
* `quantity` - quantity
* `project_name` - openstack project name
* `project_id` - openstack project id
* `status` - project status
- `access` - project access right for the identity that trigger the terraform script.
- `description` - Project description
- `order` - Details about the order that was used to create the public cloud project
- `date` - date
- `order_id` - order id, the same as the `id`
- `expiration_date` - expiration date
- `details` - Information about a Bill entry
- `description` - description
- `order_detail_id` - order detail id
- `domain` - expiration date
- `quantity` - quantity
- `project_name` - openstack project name
- `project_id` - openstack project id
- `status` - project status

## Import

Cloud project can be imported using the `order_id` that can be retrieved in the [order page](https://www.ovh.com/manager/#/dedicated/billing/orders/orders) at the creation time of the Public Cloud project.
Cloud project can be imported using the `order_id` that can be retrieved in the [order page](https://www.ovh.com/manager/#/dedicated/billing/orders/orders) at the creation time of the Public Cloud project.

```bash
$ terraform import ovh_cloud_project.my_cloud_project order_id
Expand Down