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

ref: update provider docs on changing data storage location #432

Merged
Show file tree
Hide file tree
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
24 changes: 20 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
```

Expand All @@ -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.


Expand Down
22 changes: 19 additions & 3 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -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/"
}
2 changes: 1 addition & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down
7 changes: 2 additions & 5 deletions sentry/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/"),
Expand Down
Loading