Skip to content

[AS] - tf apply always needs in-place update for opentelekomcloud_as_policy_v2 #3221

@uli-schneider

Description

@uli-schneider

Terraform provider version

Terraform v1.5.7
on darwin_arm64

  • provider registry.terraform.io/hashicorp/random v3.7.2
  • provider registry.terraform.io/opentelekomcloud/opentelekomcloud v1.36.54

Affected Resource(s)

opentelekomcloud_as_policy_v2

Terraform Configuration Files

## Create Auto Scaling Policy - Scale Out
resource "opentelekomcloud_as_policy_v2" "as_policy_web_shared_scale_out" {
  scaling_policy_name   = "as-policy-web-shared-elb-scale-out-${local.dp_name}-${var.region}"
  scaling_policy_type   = "ALARM"
  scaling_resource_id   = opentelekomcloud_as_group_v1.as_group_web_shared_elb.id
  scaling_resource_type = "SCALING_GROUP"
  #
  alarm_id = opentelekomcloud_ces_alarmrule.alarm_rule_as_web_shared_elb_scale_out.id
  #
  cool_down_time = 300
  #
  scaling_policy_action {
    operation = "ADD"
    size      = 1
  }
}

Debug Output/Panic Output

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:

  # opentelekomcloud_as_policy_v2.as_policy_web_shared_scale_in will be updated in-place
  ~ resource "opentelekomcloud_as_policy_v2" "as_policy_web_shared_scale_in" {
        id                    = "45b043f9-0ade-4a83-8b64-f2eae6be3d4e"
        # (7 unchanged attributes hidden)

      - scheduled_policy {}

        # (1 unchanged block hidden)
    }

Steps to Reproduce

  1. terraform apply

Expected Behavior

As "scheduled_policy" is an optional value, it should not force an "update in-place" during terraform apply.

Actual Behavior

With each run, some unneeded changes are processed.

Important Factoids

References

Metadata

Metadata

Assignees

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