Giter Site home page Giter Site logo

jianyuan / terraform-provider-sentry Goto Github PK

View Code? Open in Web Editor NEW
316.0 15.0 117.0 19.95 MB

Terraform provider for Sentry

Home Page: https://registry.terraform.io/providers/jianyuan/sentry/latest

License: MIT License

Go 99.77% Makefile 0.23%
terraform-provider terraform sentry

terraform-provider-sentry's Introduction

Terraform Provider Sentry

Go Report Card

Sentry Terraform

The Terraform provider for Sentry allows teams to configure and update Sentry project parameters via their command line. This provider is officially sponsored by Sentry.

Usage

Detailed documentation is available on the Terraform provider registry.

Development

If you wish to work on the provider, you will need to install Go (We use >= 1.21) on your machine.

We are currently in the process of migrating from the Terraform Plugin SDKv2 to the Terraform Plugin Framework. As part of this transition, any future resources and data sources should be implemented using the Terraform Plugin Framework, located in the internal/provider directory.

Test

In order to run the full suite of acceptance tests, run make testacc.

Make sure to set the following environment variables beforehand:

  • SENTRY_TEST_ORGANIZATION
  • SENTRY_AUTH_TOKEN

Note: Acceptance tests create real resources, and often cost money to run.

terraform-provider-sentry's People

Contributors

amanda-skilljar avatar andriusbil avatar avostap avatar cameronhall avatar chreble avatar christina-moore avatar civitaspo avatar danielpoonwj avatar dependabot[bot] avatar emcfarlane avatar geototti21 avatar gruzewski avatar hussfelt avatar jeanfred avatar jianyuan avatar johanneswuerbach avatar joshgummersall avatar julienduchesne avatar justinyeoh93 avatar jwoo0122 avatar loop0 avatar marcinwyszynski avatar mced avatar mwarkentin avatar nessex avatar rabunkosar-dd avatar renovate[bot] avatar sc3w avatar spamaps avatar taj-p avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-sentry's Issues

Missing support for Rule filters ?

I am trying to setup rules but seems like filters aren't supported.
Following is one of the alert-rule setup manually on sentry. conditions and actions are available with the provider but not filters, or may be I am missing something?

{
		"actionMatch": "all",
		"filters": [
			{
				"name": "The event's level is greater than or equal to error",
				"id": "sentry.rules.filters.level.LevelFilter",
				"match": "gte",
				"level": "40"
			},
			{
				"attribute": "stacktrace.filename",
				"value": "static_data_service.py",
				"id": "sentry.rules.filters.event_attribute.EventAttributeFilter",
				"match": "nc",
				"name": "The event's stacktrace.filename value does not contain static_data_service.py"
			}
		],
		"actions": [
			{
				"name": "Send a notification to the workspace to  and show tags [] in notification",
				"tags": "",
				"channel_id": "******",,
				"workspace": "******",,
				"id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
				"channel": "#team-backend"
			}
		],
		"dateCreated": "2019-12-18T22:41:06.744971Z",
		"frequency": 30,
		"createdBy": null,
		"id": "******",
		"projects": [
			"backend"
		],
		"name": "Pager worthy alerts",
		"type": "rule",
		"environment": "prod",
		"filterMatch": "all",
		"conditions": [
			{
				"interval": "1m",
				"name": "The issue is seen more than 10 times in 1m",
				"value": 10,
				"id": "sentry.rules.conditions.event_frequency.EventFrequencyCondition"
			}
		]
	}

Internal Error PagerDuty Integration

Getting random error when trying to rule the following rule with pagerduty integration. Running Terraform 0.14

Error: sentry: map[detail:Internal Error errorId:92d153b93ba24161bfa07c22e7db5c50]

resource "sentry_rule" "pagerduty" {
  organization = "company
  project      = "test"
  action_match = "any"
  frequency    = "1d"
  name         = "PagerDuty rule"

  conditions =  [
      {
        id   = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
        name = "A new issue is created"
      },
      {
        id       = "sentry.rules.conditions.event_frequency.EventFrequencyCondition"
        value    = "1"
        interval = "1d"
      }
    ]

  filters = []

  actions = [
    {
      id      = "sentry.integrations.pagerduty.notify_action.PagerDutyNotifyServiceAction"
      account = [Retrieved from url of pagerduty integration. https://sentry.io/settings/coalition-inc/integrations/pagerduty/XXXX/]
      service = [Name of Service under pagerduty integration settings]
    }
  ]
}

Error while creating a new Organization

resource "sentry_organization" "default" {
  name = "${var.org_name}"
}

terraform apply result in:

Terraform will perform the following actions:

  + sentry_organization.default
      id:   <computed>
      name: "XXX"
      slug: <computed>


Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

sentry_organization.default: Creating...
  name: "" => "XXX"
  slug: "" => "<computed>"

Error: Error applying plan:

1 error(s) occurred:

* sentry_organization.default: 1 error(s) occurred:

* sentry_organization.default: sentry: map[agreeTerms:[This field is required.]]

Publish provider for use in Terraform 0.13

๐Ÿ‘‹ Hi, I'm on the Terraform Providers team at HashiCorp. With the release of the Terraform 0.13 beta, users can now download and install community providers from the registry. We are inviting provider authors (especially those for popular community providers) to publish their providers in a closed beta.

To get invited to the closed beta, please email [email protected]. We need:

  • A list of GitHub usernames to add to the beta (you and any team members who will publish)
  • List of provider repositories you plan to publish
  • A GPG public key in ASCII-armor format, which you will be using to sign your provider releases

You can use one key for all of your providers, or separate keys if you prefer. If you are publishing from an organization, this key or keys will be associated with that namespace. Once in the beta, you can manage personal keys in the UI as well.

Error: invalid character '<' looking for beginning of value

Error: invalid character '<' looking for beginning of value

  on sentry.tf line 13, in resource "sentry_team" "test":
  13: resource "sentry_team" "test" {

This error occurs when missing the /api/ suffix to the Base URL. I know the Docs give an example base_url but I interpreted "base url" as the base url to my Sentry installation at first.

Maybe add this to the Docs or have the Provider first check the URL if it is valid and return a more meaningful error?

How to add member to a team

Hey! Thanks a lot for your sentry terraform provider - great stuff. I managed to setup a team. But unfortunately I couldn't figure out how to add member to it. Reading code I couldn't find anything.
So am I right this isn't currently supported? Could you give me some hints, I'm happy to implement it!

Support retrieving the DSN for a project?

It would be handy to be able to output a projects DSN after it's been created through terraform. You can get this via the /keys/ endpoint, under the dsn object.

I'm not sure how you would expose this in TF though

Project Team not updating

Hello, when I run a plan to change the team for a project, i see the changes like this:

sentry_project.serviceA team: "teamA" => "teamB"

But when applying they don't affect Sentry (I cannot see the change on their side).

I have a guess that we are missing the team information on the code here:

func resourceSentryProjectUpdate(d *schema.ResourceData, meta interface{}) error {

API errors lead to state file being wiped

On the master version of this provider (Terraform 0.12), I encountered behavior where some unknown event let to all Sentry resources disappearing from my tfstate file.

The going theory is that a problem with the Refresh/GET operation occurred on the Sentry side which instead of causing a failure caused this provider to return empty objects, leading to a success status and an empty payload.

I've seen similar behavior before when a Sentry API key is provided that doesn't have sufficient access to GET the resources from the API. Instead of erring out it succeeds and declares the resource to be non-existent, when in fact it does exist and the Provider doesn't have access to see it.

Rules vs Alert rules

Hi,

seems for me, that sentry_rule resource can manage only alert rules classified as "Issues" (Alerts->myproject->Select Alert->Issues). The rest, such as "Number of Errors", "Users Experiencing Errors",... have different structure of payloads ("type": "alert_rule" VS "type": "rule", etc).

Is it possible to manage these types of alerts with terraform?

Thank you

Release 0.5.4 is not statically linked

Hello! I got problem with new release 0.5.4 because it is not statically linked, like a previous one, causing problems with Alpine Linux (musl based distro)

Configuring PagerDuty plugin keeps giving changed resources

The below configuration keeps issuing a changed state.
The resource is configured properly in Sentry though.

# Create a plugin
resource "sentry_plugin" "default" {
    organization = "my-organization"
    project = "web-app"
    plugin = "pagerduty"
    config = {
      service_key = "pagerduty_key"
    }
}
Terraform will perform the following actions:

  ~ sentry_plugin.default
      config.service_key: "" => "pagerduty_key"

TaggedEventCondition not valid

The following sentry_rule condition returns a validation error.

conditions = [
    {
      id = "sentry.rules.conditions.tagged_event.TaggedEventCondition"
      key = "environment"
      match = "eq"
      value = "staging"
    }
  ]

Error: sentry: map[conditions:[Ensure at least one action is enabled and all required fields are filled in.]]

It looks like the underlying sentry client library doesn't support the match attribute, is that right?

Error: invalid character '<' looking for beginning of value

I'm just trying to start using this and... at the very vegining I only have the "sentry_organization" one, but it's not working?

  on sentry_organizations.tf line 1, in resource "sentry_organization" "default":
   1: resource "sentry_organization" "default" {

Code:

resource "sentry_organization" "default" {
  name        = "Sentry"
  slug        = "sentry"
  agree_terms = true
}



provider "sentry" {
  token = var.sentry_token
  base_url = var.my_sentry_load_balancer
}


Terraform v0.14.10
+ provider registry.terraform.io/anschoewe/curl v0.1.3
+ provider registry.terraform.io/hetznercloud/hcloud v1.26.0
+ provider registry.terraform.io/jianyuan/sentry v0.6.0

Your version of Terraform is out of date! The latest version
is 0.15.3. You can update by downloading from https://www.terraform.io/downloads.html

Platform not added on project creation

For some reason when adding a new project, the platform is not set in Sentry. I have to run terraform apply a second time, only then the platform is added.

Any ideas?

Is this project still maintained?

Looks like @jianyuan has gone AWOL, issues and PRs waiting for attention for months.

Meanwhile, Terraform and Sentry are a lethal combination and surely deserve a maintained module. What's the status?

Set up integration tests

I have obtained a sponsored Sentry.io account for this project.

It would be nice to actually communicate with a live Sentry.io server for testing purposes.

Environment is required to update rule but not for creation

After creating my rule, I attempt to update it w/ this plan:

        action_match = "any"
        actions      = [
            {
                "channel"   = "#sampleapp-internal"
                "id"        = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
                "name"      = "Send a notification to the mycorp Slack workspace to #sampleapp-internal and show tags [] in notification"
                "tags"      = "environment"
                "workspace" = "xxx"
            },
        ]
        conditions   = [
            {
                "id" = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
            },
            {
                "id" = "sentry.rules.conditions.regression_event.RegressionEventCondition"
            },
            {
                "id" = "sentry.rules.conditions.reappeared_event.ReappearedEventCondition"
            },
        ]
      ~ frequency    = 30 -> 60
        id           = "xxxx"
        name         = "Send a notification for new events"
        organization = "myorg"
        project      = "sampleapp"
    }

gives this result:

Error: sentry: map[environment:[This field may not be blank.]]

Projection creation if the project already exists.

Hi

If an existing project (say, "web-app") is being created via the web API, it seems that it will create one with some random string suffix ("web-app9p" for example)

Do you think it would be more appropriate to retrieve first and skip if it exists?

Auth token scopes

Hello, is there any documentation on what auth token scopes are required by the provider ?
I'm about to test this and when I'm creating the auth token I'm required to check the scopes:

  • project:read
  • project:write
  • project:admin
  • project:releases
  • team:read
  • team:write
  • team:admin
  • event:read
  • event:admin
  • org:read
  • org:write
  • org:admin
  • member:read
  • member:admin

Thanks

Actions and Conditions for rules that take arguments are failing validation

The following rule fails validation:

resource "sentry_rule" "default" {
  depends_on = [sentry_project.default]
  organization = var.organization
  project = var.app_name
  name = "Send a notification for new events"
  action_match = "any"
  frequency    = 60

  conditions =   [
    {
      id = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
    },
    {
      id = "sentry.rules.conditions.regression_event.RegressionEventCondition",
    },
    {
      id = "sentry.rules.conditions.reappeared_event.ReappearedEventCondition"
    },
    {
      interval = "1h"
      value = "1"
      id =  "sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition"
    }
  ]

  actions =  [
    {
      id = "sentry.mail.actions.NotifyEmailAction"
      target_type =  "IssueOwners"
      target_identifier = ""
    },
    {
      name = "Send a notification to the Lightmatter Slack workspace to #${var.app_name}-internal and show tags [] in notification"
      workspace = var.slack_workspace_id
      tags = "environment"
      id = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
      channel = "#${var.app_name}-internal"
    }
  ]
}

With sentry: map[actions:[Ensure at least one action is enabled and all required fields are filled in.] conditions:[Ensure at least one action is enabled and all required fields are filled in.]

Removing the EventUniqueUserFrequencyCondition and NotifyEmailAction will fix the issue.

It's worth mentioning that the condition given in the documentation EG:

conditions = [
      {
        id       = "sentry.rules.conditions.event_frequency.EventFrequencyCondition"
        value    = 500
        interval = "1h"
      }
    ]

Will trigger the condition error as well.

Terraform 0.12 support

Output from terraform 0.12checklist:

- [ ] Provider "sentry" may need to be upgraded to a newer version that supports Terraform 0.12. (Supported version information is not available for this provider.)

I can't create rule in sentry

Hello @jianyuan

I tried to create Rule, but I faced with problem and issue

My resource:

resource "sentry_rule" "default" {
  organization = data.terraform_remote_state.org.outputs.slug
  name         = "Rule Name"
  project      = "myProject"
  action_match = "any"
  frequency    = 30
  environment  = "production"

  conditions = [
    {
      id       = "sentry.rules.conditions.event_frequency.EventFrequencyCondition"
      value    = 500
      interval = "1h"
    }
  ]

  actions = [
    {
      id        = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
      channel   = "#alerts"
      workspace = "SlackWorkSpace"
      tags      = "asd"
    }
  ]
}

After terraform apply i received

Error: sentry: map[detail:Internal Error errorId:5c08e2d28846472197e92d0c51f071e0]

  on main.tf line 14, in resource "sentry_rule" "default":
  14: resource "sentry_rule" "default" {

Image1

Image2

Looks like workspace cannot be fetched cleaned_data

Could you fix it?

Installation instructions?

Hey, not sure if you're still working on this, but I was interested in trying it out.

It'd be helpful if there were some installation instructions to help get it set up (not very familiar w/ terraform plugins).

I've used another which provided a simple make install command, however a set of commands to run would be fine as well.

Thanks for your work on this!

Binary missing version as outlined in Terraform Provider naming scheme

Terraform expects a specific naming scheme to be used for the binary. This is outlined here in their Docs. When extracting the Sentry provider, the filename is missing the SemVer suffix. It should be suffixed with _v0.5.2 in this case.

Actual

$ wget https://github.com/jianyuan/terraform-provider-sentry/releases/download/v0.5.2/terraform-provider-sentry_0.5.2_linux_amd64.tar.gz
$ tar -C ./plugins -zxvf terraform-provider-sentry_0.5.2_linux_amd64.tar.gz
$ ls -luah plugins/
total 31M
drwxr-xr-x 2 root root  4.0K Dec 10 14:51 .
drwxr-xr-x 3 root root  4.0K Dec 10 14:49 ..
-rw-r--r-- 1  501 staff 1.1K Dec 10 14:52 LICENSE
-rw-r--r-- 1  501 staff 7.4K Dec 10 14:53 README.md
-rwxr-xr-x 1  501 staff  23M Dec 10 14:52 terraform-provider-sentry

Expected

$ wget https://github.com/jianyuan/terraform-provider-sentry/releases/download/v0.5.2/terraform-provider-sentry_0.5.2_linux_amd64.tar.gz
$ tar -C ./plugins -zxvf terraform-provider-sentry_0.5.2_linux_amd64.tar.gz
$ ls -luah plugins/
total 31M
drwxr-xr-x 2 root root  4.0K Dec 10 14:51 .
drwxr-xr-x 3 root root  4.0K Dec 10 14:49 ..
-rwxr-xr-x 1  501 staff  23M Dec 10 14:52 terraform-provider-sentry_v0.5.2

Support integrations (webhooks)

Sentry is great, but the barrage of emails it sends by default is less great. I'm sure many / most of us integrate with other systems e.g. ChatOps, alerting. It would be great if you would add support for integrations and webhooks.

New release anytime soon?

Hello, latest release tag and master are quite different now. There is issue - #56 which resolved, but still not in release (even patch one). Is there any possibility to expect new release any time soon? Thank you!

Wants to create resource when token has no permission to view

I have a *.tf file with a sentry_team resource.

After creating the team using terraform, If I use a SENTRY_TOKEN with no permission to read teams, then the provider assumes the team doesn't exist and wants to create a new one.

Took me a while to figure out that the problem was a permissions scope thing. I'd expected the provider to output something like a 403 error instead of silently failing.

Deprecate Team name

It seems that the Sentry team name is deprecated. Now, you just need a unique slug to create and update a team. This change is reflected in their Web UI,

Relates to #67

Error on apply

Sorry about flooding you with issues right now - just ran across something else I haven't seen before.

I've imported a sentry project, and am now trying to do an apply to change the name to follow our convention. It's giving me an error that doesn't really indicate what the problem actually is, and I'm not sure how to figure out what might be going wrong. I've done similar changes to other projects without issue previously.

Plan

  ~ module.sentry_project.sentry_project.default
      slug: "prod-payments-web-4e" => "prod-payments-web"


Plan: 0 to add, 1 to change, 0 to destroy.

Error

$ make apply app=payments-web
module.sentry_project.sentry_project.default: Modifying... (ID: prod-payments-web-4e)
  slug: "prod-payments-web-4e" => "prod-payments-web"
Error applying plan:

1 error(s) occurred:

* module.sentry_project.sentry_project.default: 1 error(s) occurred:

* sentry_project.default: sentry: map[detail:Internal Error errorId:56e87ac59c6d493d9040a1f3a445300c]

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Issue with imported projects which are "bookmarked"

I've just finished importing all of our existing sentry projects, and did prod last. I have a bunch of our prod projects starred (bookmarked in sentry API terms). It appears that this has put things in a state where a diff is always showing up when I plan. It looks like the value is updated when I apply, but it's still there on the next plan:

$ make plan app=accounting

~ module.sentry_project.sentry_project.default
      is_bookmarked: "true" => "false"


Plan: 0 to add, 1 to change, 0 to destroy.

$ make apply app=accounting
module.sentry_project.sentry_project.default: Modifying... (ID: prod-accounting)
  is_bookmarked: "true" => "false"
module.sentry_project.sentry_project.default: Modifications complete after 0s (ID: prod-accounting)

$ make plan app=accounting

~ module.sentry_project.sentry_project.default
      is_bookmarked: "true" => "false"


Plan: 0 to add, 1 to change, 0 to destroy.

Rule, environment

I'm trying to update the name of a rule already created.
And now I'm facing this issue.

Error: sentry: map[environment:[This field may not be blank.]]

Here is the snippet:

resource "sentry_rule" "rule" {
  organization = "organization"
  project      = "project"
  name         = "Managed by Terraform"
  action_match = "any"
  frequency    = 30
  environment  = null
  actions = [{
    id        = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
    channel   = "#errors",
    tags      = "environment",
    workspace = "xxxxx"
  }]

  conditions = [{
    id = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
    }, {
    id = "sentry.rules.conditions.regression_event.RegressionEventCondition"
  }]
}

I'd like a rule that triggers on all environments.

Error creating / modifying rules

I'm trying to create a new rule using this plugin but it keeps throwing below error:

  # sentry_rule.rule-name will be created
  + resource "sentry_rule" "rule-name" {
      + action_match = "any"
      + actions      = [
          + {
              + "channel"   = "#channel-name"
              + "id"        = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
              + "workspace" = "workspace-name"
            },
        ]
      + conditions   = [
          + {
              + "id" = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
            },
        ]
      + environment  = (known after apply)
      + frequency    = 5
      + id           = (known after apply)
      + name         = "rule-name"
      + organization = "org-name"
      + project      = "project-name"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

sentry_rule.rule-name: Creating...

Error: sentry: map[detail:Internal Error errorId:6488256461364f5daf84bb90df76584c]

  on main.tf line 36, in resource "sentry_rule" "rule-name":
  36: resource "sentry_rule" "rule-name" {

To overcome this issue, I have created the rule manually from sentry dashboard. Post this, I did a terraform import.

Whats weird is that when I do a terraform plan, its finding some difference in the config and state. Hence its suggesting some changes to be applied as below:

  ~ resource "sentry_rule" "rule-name" {
      + action_match = "any"
      + actions      = [
          + {
              + "channel"   = "#channel-name"
              + "id"        = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
              + "workspace" = "workspace-name"
            },
        ]
      + conditions   = [
          + {
              + "id" = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
            },
        ]
        frequency    = 5
        id           = "AXXYYZZ"
        name         = "rule-name"
        organization = "org-name"
        project      = "project-name"
    }

On terraform apply, it fails with the below error:

Error: sentry: map[detail:Internal Error errorId:7388c38cefa44e8f9d2f8f94b3b61235]

  on main.tf line 59, in resource "sentry_rule" "rule-name":
  36: resource "sentry_rule" "rule-name" {

After this error is raised, next time onwards terraform plan does not detect any changes!

I'm not able to understand this inconsistent behaviour. Can someone help me out here?

Slack notification rule: map[actions:[Ensure at least one action is enabled and all required fields are filled in.]]

Hi!

I've been trying to create new rule for the project via terraform resource

resource "sentry_plugin" "slack" {
  organization = sentry_project.this.organization
  project      = sentry_project.this.name
  plugin       = "slack"
  config = {
    webhook = "https://hooks.slack.com/services/****/****"
    channel = "#sentry"
  }
}

resource "sentry_rule" "slack" {
  organization = sentry_project.this.organization
  project      = sentry_project.this.name
  action_match = "all"
  frequency    = 5

  name = "slack"

  actions = [{
    id      = "sentry.rules.actions.notify_event_service.NotifyEventServiceAction"
    service = "slack"
  }]

  conditions = [{
    id = "sentry.rules.conditions.every_event.EveryEventCondition"
  }]
}

Please find below that for rule parameters I have used the exact payload from rule creation in UI to make sure I won't miss anything:
image
image

To my surprise it did not work, the following error was thrown:

Error: sentry: map[actions:[Ensure at least one action is enabled and all required fields are filled in.]]

  on main.tf line 177, in resource "sentry_rule" "slack":
 177: resource "sentry_rule" "slack" {

Could you please assist me in figuring out whether it is my mistake or the provider issue?

Thank you.

Option to delete project default sentry key

When you create a project, a key is created automatically behind the scenes by Sentry. In order to reference a sentry key in a declarative way, one must create a duplicate key for that project separately.

resource "sentry_project" "default" {
  organization = sentry_org.default.slug
  team = sentry_team.default.slug
  name = "default project"
}

resource "sentry_key" "default" {
  organization = sentry_org.default.slug
  project = sentry_project.default.slug
  name = "default"
}

This will result in two keys defined on the project, though. You could use a data source, but that will fail until the project and key are created (i.e. we need a way to break the cycle, or do something like the above and pollute the keys for a project).

I would like to introduce a new bool project resource parameter, remove_default_key, that removes the default project key when creating a project. It's similar in semantic meaning to the remove_default_node_pool parameter on the Terraform Google Cluster resource. The default value would be false.

Then, this would yield only a single key:

resource "sentry_project" "default" {
  organization = sentry_org.default.slug
  team = sentry_team.default.slug
  name = "default project"
  remove_default_key = true
}

resource "sentry_key" "default" {
  organization = sentry_org.default.slug
  project = sentry_project.default.slug
  name = "default"
}

Is that reasonable? I wanted to open an issue to discuss before diving in to the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.