Skip to content

Commit 2847715

Browse files
fix: better region handling and doc
1 parent 714035d commit 2847715

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

docs/data-sources/audit_trail_event.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ For more information refer to the [Audit Trail API documentation](https://www.sc
1313
```hcl
1414
# Retrieve all audit trail events on the default organization
1515
data "scaleway_audit_trail_event" "find_all" {
16-
region = "fr-par"
1716
}
1817
1918
# Retrieve audit trail events on a specific organization
@@ -23,7 +22,6 @@ data "scaleway_audit_trail_event" "find_by_org" {
2322
2423
# Retrieve audit trail events on a specific project
2524
data "scaleway_audit_trail_event" "find_by_project" {
26-
region = "fr-par"
2725
project_id = "11111111-1111-1111-1111-111111111111"
2826
}
2927
@@ -39,7 +37,6 @@ data "scaleway_audit_trail_event" "find_by_resource_id" {
3937
4038
# Retrieve audit trail for a specific Scaleway product
4139
data "scaleway_audit_trail_event" "find_by_product_name" {
42-
region = "nl-ams"
4340
product_name = "secret-manager"
4441
}
4542
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package audittrail
22

33
import (
4-
"fmt"
5-
"slices"
6-
74
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
85
audittrailSDK "github.com/scaleway/scaleway-sdk-go/api/audit_trail/v1alpha1"
96
"github.com/scaleway/scaleway-sdk-go/scw"
@@ -18,10 +15,6 @@ func newAPIWithRegion(d *schema.ResourceData, m any) (*audittrailSDK.API, scw.Re
1815
if err != nil {
1916
return nil, "", err
2017
}
21-
// In audit trail sdk-go so far only fr-par and nl-ams are supported
22-
if !slices.Contains(api.Regions(), region) {
23-
return nil, "", fmt.Errorf("invalid api region, expected one of %s, got: %s", api.Regions(), region)
24-
}
2518

2619
return api, region, nil
2720
}

templates/data-sources/audit_trail_event.md.tmpl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ For more information refer to the [Audit Trail API documentation](https://www.sc
1313
```hcl
1414
# Retrieve all audit trail events on the default organization
1515
data "scaleway_audit_trail_event" "find_all" {
16-
region = "fr-par"
1716
}
1817

1918
# Retrieve audit trail events on a specific organization
@@ -23,7 +22,6 @@ data "scaleway_audit_trail_event" "find_by_org" {
2322

2423
# Retrieve audit trail events on a specific project
2524
data "scaleway_audit_trail_event" "find_by_project" {
26-
region = "fr-par"
2725
project_id = "11111111-1111-1111-1111-111111111111"
2826
}
2927

@@ -39,7 +37,6 @@ data "scaleway_audit_trail_event" "find_by_resource_id" {
3937

4038
# Retrieve audit trail for a specific Scaleway product
4139
data "scaleway_audit_trail_event" "find_by_product_name" {
42-
region = "nl-ams"
4340
product_name = "secret-manager"
4441
}
4542

0 commit comments

Comments
 (0)