Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"outscale_snapshot_attributes" resource cannot be updated #263

Open
outscale-mzi opened this issue Dec 8, 2022 · 0 comments
Open

"outscale_snapshot_attributes" resource cannot be updated #263

outscale-mzi opened this issue Dec 8, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@outscale-mzi
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants