Skip to content

"outscale_snapshot_attributes" resource cannot be updated #263

@outscale-mzi

Description

@outscale-mzi

Terraform Version

Terraform v1.3.5
on darwin_amd64
+ provider registry.terraform.io/outscale-dev/outscale v0.7.0

Terraform Configuration Files

resource "outscale_volume" "outscale_volume" {
    subregion_name  = "${var.region}a"
    size            = 40
}

resource "outscale_snapshot" "outscale_snapshot" {
    volume_id = outscale_volume.outscale_volume.volume_id
}

resource "outscale_snapshot_attributes" "outscale_snapshot_attributes" {
    snapshot_id = outscale_snapshot.outscale_snapshot.snapshot_id

    permissions_to_create_volume_additions {
                        account_ids = ["123456789012"]
        }
}

data "outscale_snapshot" "outscale_snapshot" {
    depends_on  = [outscale_snapshot_attributes.outscale_snapshot_attributes]
    snapshot_id = outscale_snapshot.outscale_snapshot.snapshot_id
}

Updated Configuration file:

resource "outscale_volume" "outscale_volume" {
    subregion_name  = "${var.region}a"
    size            = 40
}

resource "outscale_snapshot" "outscale_snapshot" {
    volume_id = outscale_volume.outscale_volume.volume_id
}

resource "outscale_snapshot_attributes" "outscale_snapshot_attributes" {
    snapshot_id = outscale_snapshot.outscale_snapshot.snapshot_id

    permissions_to_create_volume_additions {
                        account_ids = ["123456789012","123456789010"]
        }
}

data "outscale_snapshot" "outscale_snapshot" {
    depends_on  = [outscale_snapshot_attributes.outscale_snapshot_attributes]
    snapshot_id = outscale_snapshot.outscale_snapshot.snapshot_id
}

Debug Output

# outscale_snapshot_attributes.outscale_snapshot_attributes will be updated in-place
  ~ resource "outscale_snapshot_attributes" "outscale_snapshot_attributes" {
        id          = "snap-a816c9a2"
        # (2 unchanged attributes hidden)

      ~ permissions_to_create_volume_additions {
          ~ account_ids       = [
                "123456789012",
              + "123456789010",
            ]
            # (1 unchanged attribute hidden)
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.
outscale_snapshot_attributes.outscale_snapshot_attributes: Modifying... [id=snap-a816c9a2]
╷
│ Error: doesn't support update
│ 
│   with outscale_snapshot_attributes.outscale_snapshot_attributes,
│   on TestSnaps-Attributes.tf line 12, in resource "outscale_snapshot_attributes" "outscale_snapshot_attributes":
│   12: resource "outscale_snapshot_attributes" "outscale_snapshot_attributes" {
│ 
╵

Crash Output

N/A

Expected Behavior

The resource "outscale_snapshot_attributes" is either updated or destroyed and recreated

Actual Behavior

terraform suggests to update "outscale_snapshot_attributes" resource but an error is raised.

Steps to Reproduce

  1. terraform init
  2. terraform apply
  3. update configuration file
  4. terraform apply (a second time)

Additional Context

NA

References

NA

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions