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

[AD-1318] Sync sentry terraform provider with upstream #44

Merged
merged 4 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ jobs:
timeout-minutes: 30
strategy:
fail-fast: false
max-parallel: 1
matrix:
terraform:
- "1.4.*"
- "1.5.*"
- "1.6.*"
- "1.7.*"
- "1.8.*"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -87,6 +90,9 @@ jobs:
env:
TF_ACC: "1"
SENTRY_TEST_ORGANIZATION: ${{ secrets.SENTRY_TEST_ORGANIZATION }}
SENTRY_TEST_PAGERDUTY_ORGANIZATION: ${{ secrets.SENTRY_TEST_PAGERDUTY_ORGANIZATION }}
SENTRY_TEST_OPSGENIE_ORGANIZATION: ${{ secrets.SENTRY_TEST_OPSGENIE_ORGANIZATION }}
SENTRY_TEST_OPSGENIE_INTEGRATION_KEY: ${{ secrets.SENTRY_TEST_OPSGENIE_INTEGRATION_KEY }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
go test -v -cover -timeout 30m ./...
30 changes: 30 additions & 0 deletions .github/workflows/update-platforms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: update-platforms

on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"

permissions:
contents: write
pull-requests: write

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- run: go generate ./internal/sentryplatforms
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-sentry-platforms
commit-message: Update list of valid Sentry platforms
title: Update Sentry platforms
body: |
This PR updates the list of valid Sentry platforms.
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.

version: 2

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -57,4 +59,4 @@ release:
# Manually examine the release before it goes live:
draft: true
changelog:
skip: true
disable: true
55 changes: 55 additions & 0 deletions docs/data-sources/all_keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sentry_all_keys Data Source - terraform-provider-sentry"
subcategory: ""
description: |-
List a Project's Client Keys.
---

# sentry_all_keys (Data Source)

List a Project's Client Keys.

## Example Usage

```terraform
# List a Project's Client Keys
data "sentry_all_keys" "all" {
organization = "my-organization"
project = "web-app"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `organization` (String) The slug of the organization the resource belongs to.
- `project` (String) The slug of the project the resource belongs to.

### Optional

- `filter_status` (String) Filter client keys by `active` or `inactive`. Defaults to returning all keys if not specified.

### Read-Only

- `keys` (Attributes List) The list of client keys. (see [below for nested schema](#nestedatt--keys))

<a id="nestedatt--keys"></a>
### Nested Schema for `keys`

Read-Only:

- `dsn_csp` (String) Security header endpoint for features like CSP and Expect-CT reports.
- `dsn_public` (String) The DSN tells the SDK where to send the events to.
- `dsn_secret` (String) Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language.
- `id` (String) The ID of this resource.
- `name` (String) The name of the client key.
- `organization` (String) The slug of the organization the resource belongs to.
- `project` (String) The slug of the project the resource belongs to.
- `project_id` (String) The ID of the project that the key belongs to.
- `public` (String) The public key.
- `rate_limit_count` (Number) Number of events that can be reported within the rate limit window.
- `rate_limit_window` (Number) Length of time that will be considered when checking the rate limit.
- `secret` (String) The secret key.
45 changes: 45 additions & 0 deletions docs/data-sources/all_projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sentry_all_projects Data Source - terraform-provider-sentry"
subcategory: ""
description: |-
Return a list of projects available to the authenticated session.
---

# sentry_all_projects (Data Source)

Return a list of projects available to the authenticated session.

## Example Usage

```terraform
# Retrieve a list of projects available to the authenticated user
data "sentry_all_projects" "default" {
organization = "my-organization"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `organization` (String) The slug of the organization the resource belongs to.

### Read-Only

- `project_slugs` (Set of String) The slugs of the projects.
- `projects` (Attributes Set) The list of projects. (see [below for nested schema](#nestedatt--projects))

<a id="nestedatt--projects"></a>
### Nested Schema for `projects`

Read-Only:

- `color` (String) The color of this project.
- `date_created` (String) The date this project was created.
- `features` (Set of String) The features of this project.
- `internal_id` (String) The internal ID of this project.
- `name` (String) The name of this project.
- `platform` (String) The platform of this project.
- `slug` (String) The slug of this project.
31 changes: 19 additions & 12 deletions docs/data-sources/key.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@
page_title: "sentry_key Data Source - terraform-provider-sentry"
subcategory: ""
description: |-
Sentry Key data source.
Retrieve a Project's Client Key.
---

# sentry_key (Data Source)

Sentry Key data source.
Retrieve a Project's Client Key.

## Example Usage

```terraform
# Retrieve a project key by id
data "sentry_key" "default" {
organization = "my-organization"
project = "web-app"

id = "73e6e1c04501397c0f87f36bf48f22ea"
}

# Retrieve a project key by name
data "sentry_key" "default" {
organization = "my-organization"
Expand All @@ -35,23 +43,22 @@ data "sentry_key" "first" {

### Required

- `organization` (String) The slug of the organization the key should be created for.
- `project` (String) The slug of the project the key should be created for.
- `organization` (String) The slug of the organization the resource belongs to.
- `project` (String) The slug of the project the resource belongs to.

### Optional

- `first` (Boolean) Boolean flag indicating that we want the first key of the returned keys.
- `name` (String) The name of the key to retrieve.
- `id` (String) The ID of this resource.
- `name` (String) The name of the client key.

### Read-Only

- `dsn_csp` (String) DSN for the Content Security Policy (CSP) for the key.
- `dsn_public` (String) DSN for the key.
- `dsn_secret` (String, Deprecated)
- `id` (String) The ID of this resource.
- `is_active` (Boolean) Flag indicating the key is active.
- `dsn_csp` (String) Security header endpoint for features like CSP and Expect-CT reports.
- `dsn_public` (String) The DSN tells the SDK where to send the events to.
- `dsn_secret` (String) Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language.
- `project_id` (String) The ID of the project that the key belongs to.
- `public` (String) Public key portion of the client key.
- `public` (String) The public key.
- `rate_limit_count` (Number) Number of events that can be reported within the rate limit window.
- `rate_limit_window` (Number) Length of time that will be considered when checking the rate limit.
- `secret` (String) Secret key portion of the client key.
- `secret` (String) The secret key.
19 changes: 12 additions & 7 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sentry_project Data Source - terraform-provider-sentry"
subcategory: ""
description: |-
Sentry Project data source.
Return a list of projects available to the authenticated session.
---

# sentry_project (Data Source)

Sentry Project data source.
Return a list of projects available to the authenticated session.

## Example Usage

Expand All @@ -26,11 +26,16 @@ data "sentry_project" "default" {

### Required

- `organization` (String) The slug of the organization the project belongs to.
- `slug` (String) The unique URL slug for this project.
- `organization` (String) The slug of the organization the resource belongs to.
- `slug` (String) The slug of this project.

### Read-Only

- `id` (String) The ID of this resource.
- `internal_id` (String) The internal ID for this project.
- `is_public` (Boolean)
- `color` (String) The color of this project.
- `date_created` (String) The date this project was created.
- `features` (Set of String) The features of this project.
- `id` (String) The slug of this project.
- `internal_id` (String) The internal ID of this project.
- `is_public` (Boolean) Whether this project is public.
- `name` (String) The name of this project.
- `platform` (String) The platform of this project.
Loading