hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
249 stars 114 forks source link

awscc_lightsail_disk: subsequent applies without change leads to plan/apply stuck on modification #1868

Open quixoticmonk opened 2 months ago

quixoticmonk commented 2 months ago

Community Note

Terraform CLI and Terraform AWS Cloud Control Provider Version

tf -version
Terraform v1.9.0
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.57.0
+ provider registry.terraform.io/hashicorp/awscc v1.4.0
+ provider registry.terraform.io/hashicorp/null v3.2.2

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_lightsail_disk" "example" {
  disk_name         = "example-disk"
  size_in_gb        = "32"
  availability_zone = "us-east-1a"
}

Debug Output

Panic Output

Expected Behavior

Terraform and the provider should manage the idempotency in subsequent applies without changes.

Actual Behavior

A subsequent terraform apply lead to below changes identified by plan and apply.


Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # awscc_lightsail_disk.example will be updated in-place
  ~ resource "awscc_lightsail_disk" "example" {
        id                = "example-disk"
      + tags              = (known after apply)
        # (14 unchanged attributes hidden)
    }

Steps to Reproduce

  1. terraform apply
  2. terraform apply

Important Factoids

This is not reproducible on the below example.

resource "awscc_lightsail_disk" "example" {
  disk_name  = "example-disk"
  size_in_gb = "32"
  add_ons = [{
    add_on_type = "AutoSnapshot"
    auto_snapshot_add_on_request = {
      snapshot_time_of_day = "06:00"
    }
  }]
  availability_zone = "us-east-1a"
}

References

hanscg commented 2 months ago

I noticed a similar problem with difference resource awscc_chatbot_slack_channel_configuration.

I upgraded from 0.78.0 to 1.4.0, plan shows change only in tags, but when applying the changes it gets stuck at Still modifying until the AWS credentials expire.

I tried downgrading the provider and it seems to happen starting from 1.1.0. Downgrading the provider to 1.0.0 shows no change in plan.

quixoticmonk commented 2 months ago

@hanscg You may want to add details from your case into https://github.com/hashicorp/terraform-provider-awscc/issues/1841. I have tried to reproduce this across multiple versions for the slack config and was unable to. If you can provide some additional debug logs in that issue thread, it would help us to what is being proposed in the subsequent applies.