diff --git a/docs/index.md b/docs/index.md index 1d3a28d3a..c7b0fac07 100644 --- a/docs/index.md +++ b/docs/index.md @@ -44,13 +44,29 @@ provider "sentry" { ## Example Usage ```terraform -# Configure the Sentry Provider +# Configure the Sentry Provider for US data storage location (default) +provider "sentry" { + token = var.sentry_auth_token + + # If you want to be explicit, you can specify the base URL for the US region. + # base_url = "https://us.sentry.io/api/" + # or + # base_url = "https://sentry.io/api/" +} + +# Configure the Sentry Provider for EU data storage location +provider "sentry" { + token = var.sentry_auth_token + + base_url = "https://de.sentry.io/api/" +} + +# Configure the Sentry Provider for self-hosted Sentry provider "sentry" { token = var.sentry_auth_token - # If you are self-hosting Sentry, set the base URL here. # The URL format must be "https://[hostname]/api/". - # base_url = "https://example.com/api/" + base_url = "https://example.com/api/" } ``` @@ -59,7 +75,7 @@ provider "sentry" { ### Optional -- `base_url` (String) The target Sentry Base API URL in the format `https://[hostname]/api/`. The default value is `https://sentry.io/api/`. The value must be provided when working with Sentry On-Premise. The value can be sourced from the `SENTRY_BASE_URL` environment variable. +- `base_url` (String) The target Sentry Base API URL follows the format `https://[hostname]/api/`. The default value is `https://sentry.io/api/`, which is an alias for `https://us.sentry.io/api/` (US data storage location). To change the data storage location to the EU, set the value to `https://de.sentry.io/api/`. This value is required for non-US storage locations or Sentry On-Premise deployments. The value can be sourced from the `SENTRY_BASE_URL` environment variable. - `token` (String, Sensitive) The authentication token used to connect to Sentry. The value can be sourced from the `SENTRY_AUTH_TOKEN` environment variable. diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 2874196c7..badffa231 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,8 +1,24 @@ -# Configure the Sentry Provider +# Configure the Sentry Provider for US data storage location (default) +provider "sentry" { + token = var.sentry_auth_token + + # If you want to be explicit, you can specify the base URL for the US region. + # base_url = "https://us.sentry.io/api/" + # or + # base_url = "https://sentry.io/api/" +} + +# Configure the Sentry Provider for EU data storage location +provider "sentry" { + token = var.sentry_auth_token + + base_url = "https://de.sentry.io/api/" +} + +# Configure the Sentry Provider for self-hosted Sentry provider "sentry" { token = var.sentry_auth_token - # If you are self-hosting Sentry, set the base URL here. # The URL format must be "https://[hostname]/api/". - # base_url = "https://example.com/api/" + base_url = "https://example.com/api/" } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index feb9ac239..3ad993790 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -43,7 +43,7 @@ func (p *SentryProvider) Schema(ctx context.Context, req provider.SchemaRequest, Sensitive: true, }, "base_url": schema.StringAttribute{ - MarkdownDescription: "The target Sentry Base API URL in the format `https://[hostname]/api/`. The default value is `https://sentry.io/api/`. The value must be provided when working with Sentry On-Premise. The value can be sourced from the `SENTRY_BASE_URL` environment variable.", + MarkdownDescription: "The target Sentry Base API URL follows the format `https://[hostname]/api/`. The default value is `https://sentry.io/api/`, which is an alias for `https://us.sentry.io/api/` (US data storage location). To change the data storage location to the EU, set the value to `https://de.sentry.io/api/`. This value is required for non-US storage locations or Sentry On-Premise deployments. The value can be sourced from the `SENTRY_BASE_URL` environment variable.", Optional: true, }, }, diff --git a/sentry/provider.go b/sentry/provider.go index 5fcdee136..457b3d021 100644 --- a/sentry/provider.go +++ b/sentry/provider.go @@ -20,17 +20,14 @@ func NewProvider(version string) func() *schema.Provider { p := &schema.Provider{ Schema: map[string]*schema.Schema{ "token": { - Description: "The authentication token used to connect to Sentry. The value can be sourced from " + - "the `SENTRY_AUTH_TOKEN` environment variable.", + Description: "The authentication token used to connect to Sentry. The value can be sourced from the `SENTRY_AUTH_TOKEN` environment variable.", Type: schema.TypeString, Optional: true, DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SENTRY_AUTH_TOKEN", "SENTRY_TOKEN"}, nil), Sensitive: true, }, "base_url": { - Description: "The target Sentry Base API URL in the format `https://[hostname]/api/`. " + - "The default value is `https://sentry.io/api/`. The value must be provided when working with " + - "Sentry On-Premise. The value can be sourced from the `SENTRY_BASE_URL` environment variable.", + Description: "The target Sentry Base API URL follows the format `https://[hostname]/api/`. The default value is `https://sentry.io/api/`, which is an alias for `https://us.sentry.io/api/` (US data storage location). To change the data storage location to the EU, set the value to `https://de.sentry.io/api/`. This value is required for non-US storage locations or Sentry On-Premise deployments. The value can be sourced from the `SENTRY_BASE_URL` environment variable.", Type: schema.TypeString, Optional: true, DefaultFunc: schema.EnvDefaultFunc("SENTRY_BASE_URL", "https://sentry.io/api/"),