opsgenie / terraform-provider-opsgenie

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

Cannot use configuration generation tool #423

Open remyleone opened 7 months ago

remyleone commented 7 months ago

Hi there,

Terraform Version

$ terraform -version                                        
Terraform v1.7.1
on darwin_arm64

Affected Resource(s)

Terraform Configuration Files

import {
  id = "11111111-1111-1111-1111-111111111111"
  to = "opsgenie_team.devtools"
}

Debug Output

$ terraform plan -generate-config-out=generated_resources.tf
╷
│ Error: Invalid import address
│ 
│   on main.tf line 27, in import:
│   27:   to = "opsgenie_team.devtools"
│ 
│ Only managed resources can be imported.
╵
╷
│ Error: Invalid expression
│ 
│   on main.tf line 27, in import:
│   27:   to = "opsgenie_team.devtools"
│ 
│ A single static variable reference is required: only attribute access and indexing with constant keys. No calculations, function calls, template expressions, etc are allowed
│ here.

Expected Behavior

It should generate a configuration block that I can use to import easily existing ressources in terraform.

Actual Behavior

The generation is not working.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

provider "opsgenie" {
  api_url = "api.eu.opsgenie.com" #default is api.opsgenie.com
  # my api key is defined
}