opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
100 stars 136 forks source link

Impossible to create api integrations of type email with the provider #247

Open RubenVosmeer opened 3 years ago

RubenVosmeer commented 3 years ago

Hi,

Using the provider, it is impossible to create an api integration of type Email.

Terraform Version

Affected Resource(s)

Terraform Configuration Files

 resource "opsgenie_api_integration" "email" {
   name = "email integration of team X"
   owner_team_id = opsgenie_team.team.id
   type = "Email"
   emailUsername = "X"
 }

Debug Output

With omission of emailUsername

Error: Error occurred with Status code: 422, Message: Request body is not processable. Please check the errors., Took: 0.001000, RequestId: a1304fce-6ecd-40d5-ac90-25179867fa26, Error Detail: map[emailUsername:must not be blank]

  on ../opsgenie_team/team.tf line 19, in resource "opsgenie_api_integration" "email":
  19: resource "opsgenie_api_integration" "email" {

With inclusion of emailUsername

Error: Unsupported argument

  on ../opsgenie_team/team.tf line 23, in resource "opsgenie_api_integration" "email":
  23:   emailUsername = var.team_name

An argument named "emailUsername" is not expected here.

Expected Behavior

Creation of an API integration of type email on team level.

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

Sergey-Kirgizov commented 3 years ago

Hi! You need to create opsgenie_email_integration resource instead. Here is the doc for that: https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs/resources/email_integration