Skip to content

Commit d0612af

Browse files
Cloud: Stop validating region slugs (#787)
We're getting more and more regions in Cloud and it's hard to keep track of them This removes the Terraform-side validation on those region slugs
1 parent 307c4ab commit d0612af

File tree

6 files changed

+12
-18
lines changed

6 files changed

+12
-18
lines changed

docs/resources/cloud_access_policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ resource "grafana_cloud_access_policy_token" "test" {
5151

5252
- `name` (String) Name of the access policy.
5353
- `realm` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--realm))
54-
- `region` (String) Region where the API is deployed. Region where the API is deployed. Generally where the stack is deployed. Valid values are 'us', 'eu', and 'au'.
54+
- `region` (String) Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/reference/cloud-api/#list-regions.
5555
- `scopes` (Set of String) Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/authentication-and-permissions/access-policies/#scopes for possible values.
5656

5757
### Optional

docs/resources/cloud_access_policy_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ resource "grafana_cloud_access_policy_token" "test" {
5151

5252
- `access_policy_id` (String) ID of the access policy for which to create a token.
5353
- `name` (String) Name of the access policy token.
54-
- `region` (String) Region of the access policy. Should be set to the same region as the access policy.
54+
- `region` (String) Region of the access policy. Should be set to the same region as the access policy. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/reference/cloud-api/#list-regions.
5555

5656
### Optional
5757

docs/resources/cloud_stack.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ available at “https://<stack_slug>.grafana.net".
3333
### Optional
3434

3535
- `description` (String) Description of stack.
36-
- `region_slug` (String) Region slug to assign to this stack.
37-
Changing region will destroy the existing stack and create a new one in the desired region.
38-
Available input au (GCP Australia), eu (GCP Belgium), us (GCP US Central), prod-ap-southeast-0 (GCP Singapore), prod-gb-south-0 (GCP UK), prod-ap-south-0 (GCP India), prod-sa-east-0 (GCP Brazil)
36+
- `region_slug` (String) Region slug to assign to this stack. Changing region will destroy the existing stack and create a new one in the desired region. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/reference/cloud-api/#list-regions.
3937
- `url` (String) Custom URL for the Grafana instance. Must have a CNAME setup to point to `.grafana.net` before creating the stack
4038
- `wait_for_readiness` (Boolean) Whether to wait for readiness of the stack after creating it. The check is a HEAD request to the stack URL (Grafana instance). Defaults to `true`.
4139
- `wait_for_readiness_timeout` (String) How long to wait for readiness (if enabled). Defaults to `5m0s`.

grafana/resource_cloud_access_policy.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ func ResourceCloudAccessPolicy() *schema.Resource {
3333

3434
Schema: map[string]*schema.Schema{
3535
"region": {
36-
Type: schema.TypeString,
37-
Required: true,
38-
ForceNew: true,
39-
Description: "Region where the API is deployed. Region where the API is deployed. Generally where the stack is deployed. Valid values are 'us', 'eu', and 'au'.",
40-
ValidateFunc: validation.StringInSlice([]string{"us", "eu", "au"}, false),
36+
Type: schema.TypeString,
37+
Required: true,
38+
ForceNew: true,
39+
Description: "Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/reference/cloud-api/#list-regions.",
4140
},
4241
"name": {
4342
Type: schema.TypeString,

grafana/resource_cloud_access_policy_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func ResourceCloudAccessPolicyToken() *schema.Resource {
4141
Type: schema.TypeString,
4242
Required: true,
4343
ForceNew: true,
44-
Description: "Region of the access policy. Should be set to the same region as the access policy.",
44+
Description: "Region of the access policy. Should be set to the same region as the access policy. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/reference/cloud-api/#list-regions.",
4545
},
4646
"name": {
4747
Type: schema.TypeString,

grafana/resource_cloud_stack.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,10 @@ available at “https://<stack_slug>.grafana.net".`,
6565
ValidateFunc: validation.StringMatch(stackSlugRegex, "must be a lowercase alphanumeric string and must start with a letter."),
6666
},
6767
"region_slug": {
68-
Type: schema.TypeString,
69-
Optional: true,
70-
ForceNew: true,
71-
Description: `Region slug to assign to this stack.
72-
Changing region will destroy the existing stack and create a new one in the desired region.
73-
Available input au (GCP Australia), eu (GCP Belgium), us (GCP US Central), prod-ap-southeast-0 (GCP Singapore), prod-gb-south-0 (GCP UK), prod-ap-south-0 (GCP India), prod-sa-east-0 (GCP Brazil)`,
74-
ValidateFunc: validation.StringInSlice([]string{"au", "eu", "us", "prod-ap-southeast-0", "prod-gb-south-0", "prod-ap-south-0", "prod-sa-east-0"}, false),
68+
Type: schema.TypeString,
69+
Optional: true,
70+
ForceNew: true,
71+
Description: `Region slug to assign to this stack. Changing region will destroy the existing stack and create a new one in the desired region. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/reference/cloud-api/#list-regions.`,
7572
},
7673
"url": {
7774
Type: schema.TypeString,

0 commit comments

Comments
 (0)