403 error ONLY from apply - Opsgenie provider

14 views
Skip to first unread message

Bryan Dady

unread,
May 24, 2021, 9:01:00 AM5/24/21
to Terraform
I have an Opsgenie module that works successfully via terraform plan, but then when I run the plan file through terraform apply, I get 403 errors. I've double-checked the API key has all privileges. Has anyone else seen (and hopefully overcome) 403 errors from the Opsgenie provider?

Thanks in advance - Bryan

Chamila

unread,
May 24, 2021, 4:14:10 PM5/24/21
to Terraform, Bryan Dady
Could you add the error output here?

With my limited knowledge on TF providers and none on Opsgenie, it may point to an access issue with any backend configuration you might have added. Although that would fail at init rather than apply.

On 25 May 2021 1:01:00 am NZST, Bryan Dady <br...@subsplash.com> wrote:
I have an Opsgenie module that works successfully via terraform plan, but then when I run the plan file through terraform apply, I get 403 errors. I've double-checked the API key has all privileges. Has anyone else seen (and hopefully overcome) 403 errors from the Opsgenie provider?

Thanks in advance - Bryan


-- Sent from my p≡p for Android.
pEpkey.asc

Bryan Dady

unread,
May 24, 2021, 5:34:06 PM5/24/21
to Terraform
Agreed. The (S3) backend appears to initialize properly in both the `plan` and `apply` jobs.

Terraform plan succeeded:
```shell
Initializing provider plugins...
- Reusing previous version of opsgenie/opsgenie from the dependency lock file
- Installing opsgenie/opsgenie v0.6.4...
- Installed opsgenie/opsgenie v0.6.4 (signed by a HashiCorp partner, key ID 5B6B0205CC3B78A6)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
Terraform has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.
Terraform has been successfully initialized!
...
Plan: 45 to add, 11 to change, 0 to destroy.
```

But then here is some of the error output from terraform apply:
```shell
opsgenie_service.Billing: Creating...
opsgenie_service.Locations: Creating...
opsgenie_service.Donations: Creating...
opsgenie_service.Chat: Creating...
opsgenie_service.Forms: Creating...
opsgenie_service.Documents: Creating...
opsgenie_service.Sales: Creating...
opsgenie_service.Files: Creating...
...
│ 
│ Error: Error occurred with Status code: 403, Message: You do not have the right to use Service API, Took: 0.001000, RequestId: {guid}
│ 
│   with opsgenie_service.Files,
│   on services.tf line 139, in resource "opsgenie_service" "Files":
│  139: resource "opsgenie_service" "Files" {
│ 
```
Reply all
Reply to author
Forward
0 new messages