Skip to content

TERRA-79 ⁃ Database region order leads to configuration drift #170

Open
@giannoul

Description

Terraform Version

Terraform v1.1.8
on linux_amd64

Affected Resource(s)

Please list the resources as a list, for example:

  • astra_database

Terraform Configuration Files

resource "astra_database" "current" {
  name           = var.name
  keyspace       = var.keyspace
  cloud_provider = var.cloud_provider
  regions        = var.regions

  timeouts {
    create = format("%sm", length(var.regions) * local.database_creation_delay)
  }
}

which is fed with variable values:

        name     = "test"
        keyspace = "test"
        cloud_provider = "gcp"
        regions  = ["us-central1", "us-west4", "us-east4"]

Debug Output

None

Panic Output

None

Expected Behavior

After terraform apply we should not be asked for the following change in subsequent applies:

 # module.astra_databases["joya"].astra_database.current will be updated in-place

 ~ resource "astra_database" "current" {
    id          = "111111-1111-11111-111-111111"
    name         = "test"
   ~ regions       = [
      "us-central1",
     - "us-west4",
      "us-east4",
     + "us-west4",
    ]
    # (14 unchanged attributes hidden)
    # (1 unchanged block hidden)

  }

Actual Behavior

On every apply or plan we are notified about the regions change.

Steps to Reproduce

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

  1. create a multi-region database with regions (in order) ["us-central1", "us-east4", "us-west4"]
  2. from the UI remove the region "us-east4". This will lead to the UI showing regions ["us-central1", "us-west4"]
  3. re-add the region "us-east4". This will lead to the UI showing regions ["us-central1", "us-west4", "us-east4"]
  4. In Terraform modify the regions to reflect the order in the UI like so ["us-central1", "us-west4", "us-east4"]
  5. In all subsequent applies it will keep asking for changing the regions order

Important Factoids

No

References

No

┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: TERRA-79
┆priority: Major

Metadata

Assignees

No one assigned

    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