Skip to content

Terraform fails when Networkgroup has more than 0 peers #337

@webFr0g

Description

@webFr0g

Terraform & provider version

$ terraform -v
Terraform v1.14.3
on linux_amd64
+ provider registry.terraform.io/clevercloud/clevercloud v1.9.0

Steps to reproduce

  1. Create a networkgroup resource
  2. Create an application in the networkgroup
  3. Push code to the application to make it a running instance, it becomes a Peer
  4. Run terraform refresh or terraform plan
resource "clevercloud_networkgroup" "vpn" {
  name = "ng-${terraform.workspace}"
  description = ""
  tags        = []
}

Expected behavior

Terraform continues plan

Observed behavior

$ terraform plan
clevercloud_networkgroup.vpn: Refreshing state... [id=ng_5b691250-bd41-053d-b07f-1e86c418a54d]

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: failed to get networkgroup
│ 
│   with clevercloud_networkgroup.vpn,
│   on main.tf line 74, in resource "clevercloud_networkgroup" "vpn":
│   74: resource "clevercloud_networkgroup" "vpn" {
│ 
│ cannot parse response body: json: cannot unmarshal object into Go struct field NetworkGroup1.peers of type models.Peer
╵

This issue renders the plan and destroy commands unusable unless -refresh=false is specified.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions