Skip to content

[Bug] Fleet APM integration resource gets broken after Elastic upgrade #943

@ArtemHarkusha

Description

@ArtemHarkusha

Describe the bug
After Elastic upgrade (8.15.2 -> 8.15.5) the apm integration fails on terraform plan. The version of the integration was upgraded accordingly

│ Error: package not found
│ 
│   with elasticstack_fleet_integration.this["apm"],
│   on main.tf line 1, in resource "elasticstack_fleet_integration" "this":
│    1: resource "elasticstack_fleet_integration" "this" {
│ 

To Reproduce
Steps to reproduce the behavior:

  1. On Elastic stack version 8.15.2. Deploy the following TF configuration
resource "elasticstack_fleet_integration" "this" {
  name         = "apm"
  version      = "8.15.2"
  force          = true
  skip_destroy = false
}
  1. Upgrade Elastic to 8.15.5 and use the following TF configuration
resource "elasticstack_fleet_integration" "this" {
  name         = "apm"
  version      = "8.15.5"
  force          = true
  skip_destroy = false
}

2 terraform plan will give the error

│ Error: package not found
│ 
│   with elasticstack_fleet_integration.this["apm"],
│   on main.tf line 1, in resource "elasticstack_fleet_integration" "this":
│    1: resource "elasticstack_fleet_integration" "this" {
│ 

Expected behavior
Provider should be able just to refresh the resource since the integration version is upgraded during Elastic Stack upgrade

Versions (please complete the following information):

  • OS: Ubuntu 22.04
  • Terraform Version: 1.9.5
  • Provider version: 0.11.11
  • Elasticsearch Version: 8.15.2 and 8.15.5

Additional context

I fount 2 workarounds:

  1. Manually update version in the state file. In this case TF plan will show no difference
  2. remove the resource from state teraform state rm elasticstack_fleet_integration.this and apply.

I think the problem is that TF tries to refresh the state and makes calls to 8.15.2 version of the integration which simply does not exists in the newer Elastic Stack version

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions