Skip to content

Commit 5414b10

Browse files
authored
Merge pull request #1136 from ovh/dev/aamstutz/data-domain-zone-record
feat: Add domain zone record datasources
2 parents aa21925 + b4a1d5c commit 5414b10

23 files changed

+510
-31
lines changed

.cds/terraform-provider-ovh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ workflow:
695695
environment: acctests
696696
one_at_a_time: true
697697
parameters:
698-
testargs: -run TestAccIam
698+
testargs: -run 'TestAccIam|TestAccResourceIam'
699699
skipthispipeline: "{{.workflow.terraform-provider-ovh.pip.skipthistest.iam}}"
700700
pipeline: terraform-provider-ovh-testacc
701701
when:

docs/data-sources/dedicated_server_orderable_bandwidth.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
subcategory : "Dedicated Server"
33
---
44

5-
# ovh_dedicated_server_order_bandwidth (Data Source)
5+
# ovh_dedicated_server_orderable_bandwidth (Data Source)
66

77
Use this data source to get the list of orderable additional bandwidth for a dedicated server associated with your OVHcloud Account.
88

99
## Example Usage
1010

1111
```terraform
12-
data "ovh_dedicated_server_orderable_bandwidth" "bp" {
12+
data "ovh_dedicated_server_orderable_bandwidth" "spec" {
1313
service_name = "myserver"
1414
}
1515
```
@@ -22,7 +22,7 @@ data "ovh_dedicated_server_orderable_bandwidth" "bp" {
2222

2323
The following attributes are exported:
2424

25-
* `orderable` - Wether or not additional bandwidth is orderable.
26-
* `platinium` - The list of orderable platinimum bandwidth in mbps.
27-
* `ultimate` - The list of orderable ultimate bandwidth in mbps.
28-
* `premium` - The list of orderable premium bandwidth in mbps.
25+
* `orderable` - Whether or not additional bandwidth is orderable
26+
* `platinium` - Additional orderable platinium bandwidth
27+
* `ultimate` - Additional orderable ultimate bandwidth
28+
* `premium` - Additional orderable premium bandwidth

docs/data-sources/dedicated_server_orderable_bandwidth_vrack.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
subcategory : "Dedicated Server"
33
---
44

5-
# ovh_dedicated_server_order_bandwidth_vrack (Data Source)
5+
# ovh_dedicated_server_orderable_bandwidth_vrack (Data Source)
66

7-
Use this data source to get the list of orderable additional vrack bandwidth for a dedicated server associated with your OVHcloud Account.
7+
Use this data source to get the orderable vrack bandwidth information about a dedicated server associated with your OVHcloud Account.
88

99
## Example Usage
1010

1111
```terraform
12-
data "ovh_dedicated_server_orderable_bandwidth_vrack" "bp" {
12+
data "ovh_dedicated_server_orderable_bandwidth_vrack" "spec" {
1313
service_name = "myserver"
1414
}
1515
```
@@ -22,5 +22,5 @@ data "ovh_dedicated_server_orderable_bandwidth_vrack" "bp" {
2222

2323
The following attributes are exported:
2424

25-
* `orderable` - Wether or not additional bandwidth is orderable.
26-
* `vrack` - The list of orderable vrack bandwidth in mbps.
25+
* `orderable` - Whether or not additional bandwidth is orderable
26+
* `vrack` - Additional orderable vrack bandwidth
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
subcategory : "Domain names"
3+
---
4+
5+
# ovh_domain_zone_record (Data Source)
6+
7+
Get record object properties
8+
9+
## Example Usage
10+
11+
```terraform
12+
data "ovh_domain_zone_record" "record" {
13+
zone_name = "<zone_name>"
14+
id = "<record_id>"
15+
}
16+
```
17+
18+
<!-- schema generated by tfplugindocs -->
19+
## Schema
20+
21+
### Required
22+
23+
- `id` (Number) Record ID
24+
- `zone_name` (String) Zone name
25+
26+
### Read-Only
27+
28+
- `field_type` (String) Field type
29+
- `sub_domain` (String) Record subDomain
30+
- `target` (String) Target of the record
31+
- `ttl` (Number) TTL of the record
32+
- `zone` (String) Resource record zone
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
subcategory : "Domain names"
3+
---
4+
5+
# ovh_domain_zone_records (Data Source)
6+
7+
List record
8+
9+
## Example Usage
10+
11+
```terraform
12+
data "ovh_domain_zone_records" "records" {
13+
zone_name = "<zone_name>"
14+
}
15+
```
16+
17+
<!-- schema generated by tfplugindocs -->
18+
## Schema
19+
20+
### Required
21+
22+
- `zone_name` (String) Zone name
23+
24+
### Read-Only
25+
26+
- `ids` (List of Number) IDs of the records in the zone

docs/resources/iam_resource_tags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ resource "ovh_iam_resource_tags" "project_tags" {
3131

3232
```terraform
3333
data "ovh_cloud_project" "my_project" {
34-
service_name = "cef572b51c534a8f9fee73ac81957fbd"
34+
service_name = "<public cloud project ID>"
3535
}
3636
3737
resource "ovh_iam_resource_tags" "project_tags" {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "ovh_domain_zone_record" "record" {
2+
zone_name = "<zone_name>"
3+
id = "<record_id>"
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "ovh_domain_zone_records" "records" {
2+
zone_name = "<zone_name>"
3+
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# Basic example showing how to tag a cloud project
21
data "ovh_cloud_project" "my_project" {
3-
service_name = "01234567890123456798012345678901"
2+
service_name = "<public cloud project ID>"
43
}
54

65
resource "ovh_iam_resource_tags" "project_tags" {
76
urn = data.ovh_cloud_project.my_project.iam.urn
87

98
tags = {
10-
environment = "test"
11-
team = "perso"
12-
managed_by = "opentofu"
9+
environment = "production"
10+
team = "platform"
11+
managed_by = "terraform"
1312
}
1413
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resource "ovh_iam_resource_tags" "project_tags" {
2+
urn = "urn:v1:eu:resource:cloudProject:1234567890abcdef"
3+
4+
tags = {
5+
environment = "staging"
6+
cost_center = "engineering"
7+
project = "web-app"
8+
9+
backup_policy = "daily"
10+
compliance = "gdpr"
11+
}
12+
}

0 commit comments

Comments
 (0)