terraform-provider-sentry
terraform-provider-sentry copied to clipboard
Feature request: data source support for sentry_project
Hi, can I use data source for sentry_project?
Like:
data "sentry_project" "main" {
organization = data.sentry_organization.main.id
team = data.sentry_team.main.id
slug = "my-project"
}
Thanks!
@snowhork Yes, it is possible. Are there any particular fields you'd like to get from a project?
@jianyuan hmm... sentry_project seems not to be used for data_source. Is this document old?
https://registry.terraform.io/providers/jianyuan/sentry/latest/docs
@snowhork I think @jianyuan was saying that it is actually possible to implement, not that is it already implemented. And for that, what properties of the project you would need exposed to the data source.
For me, maybe the same properties that standard resource has is a good starting point.
Hiya @jianyuan this would be a very useful feature for our use of the provider as well. I've put together a minimal implementation of the sentry project data source and raised a PR against a forked repo for your review 🙂 https://github.com/jianyuan/terraform-provider-sentry/pull/301
That would be a great feature. Here is an example from my organization:
- We have several environments for project (dev, stage, prod)
- We manage them independently with Terraform Workspaces
- We would like to use a single Sentry project for all environments.
With current state of this provider, this means that we would have to:
- Create a project in a single Terraform workspace
- Import the project/projects for every other workspace
This basically means that deploying new environments would require some tricky steps, making disaster recovery more difficult.
We could create new Sentry project for every environment, like stage-frontend, prod-frontend, but this goes against the official guidelines.
Our desired workflow looks like this:
- A user creates a project in Sentry;
- Terraform fetches it's DSN with
data.sentry_project; - Terraform puts the value into Hashicorp Vault;
- FluxCD fetches service's configuration from Vault, including project DSN, and deploys it into desire environment.