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

Updates to scheduled_task in spotinst_ocean_ecs resource are not correctly updated #343

Open
amenut opened this issue Aug 18, 2022 · 2 comments
Labels
kind/bug Categorizes an issue or PR as related to a bug.

Comments

@amenut
Copy link

amenut commented Aug 18, 2022

Terraform Version

terraform -v
Terraform v0.14.11

  • provider registry.terraform.io/spotinst/spotinst v1.81.0

Affected Resource(s)

  • spotinst_ocean_ecs

Terraform Configuration Files

resource "spotinst_ocean_ecs" "ocean_asg" {
  name         = redacted
  cluster_name = redacted
  region       = data.aws_region.current.name
  desired_capacity = 3
  min_size = 3
  max_size = 100

  spot_percentage = var.spot_percentage

  scheduled_task {
    tasks {
      task_type            = "clusterRoll"
      cron_expression = var.cluster_roll_cron_expression
      is_enabled          = true
    }
  }

Expected Behavior

As per run output, the scheduled task should be changed to reflect the requested state

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.environment.module.ai.spotinst_ocean_ecs.ocean_asg[0] will be updated in-place
  ~ resource "spotinst_ocean_ecs" "ocean_asg" {
        id                          = "redacted-ocean-id"
        name                        = "redacted-name"
        # (20 unchanged attributes hidden)



      - scheduled_task {
          - shutdown_hours {
              - is_enabled   = false -> null
              - time_windows = [
                  - "Wed:18:30-Tue:18:30",
                ] -> null
            }

          - tasks {
              - cron_expression = "0 19 * * 5" -> null
              - is_enabled      = true -> null
              - task_type       = "clusterRoll" -> null
            }
        }
      + scheduled_task {

          + tasks {
              + cron_expression = "0 19 * * 5"
              + is_enabled      = true
              + task_type       = "clusterRoll"
            }
        }


        # (6 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
terraform14 apply dev.tfplan
module.environment.module.ai.spotinst_ocean_ecs.ocean_asg[0]: Modifying... [id=redacted-ocean-id]
module.environment.module.ai.spotinst_ocean_ecs.ocean_asg[0]: Modifications complete after 2s [id=redacted-ocean-id]

Actual Behavior

Change not applied despite indication of success.
terraform plan shows identical output.

Steps to Reproduce

terraform plan
terraform apply

Repeat n times

References

A search of open issues didn't find anything similar.

Community Note

  • Please vote on this issue by adding a 👍 reaction to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
@amenut amenut added the kind/bug Categorizes an issue or PR as related to a bug. label Aug 18, 2022
@TamirYaariSpot
Copy link
Contributor

TamirYaariSpot commented Aug 21, 2022

Hi @amenut,

Thank you for reaching out. I tested the mentioned scenario and I can confirm that indeed the change is not applied despite indication of success.

From what I see, it seems that this problem arises only when setting the "shutdown_hours" object to null, which (please correct me if I'm mistaken) is the scenario you added. Is that correct? Did you experience the problem in any additional scenarios?

@amenut
Copy link
Author

amenut commented Aug 22, 2022

From what I see, it seems that this problem arises only when setting the "shutdown_hours" object to null, which (please correct me if I'm mistaken) is the scenario you added. Is that correct? Did you experience the problem in any additional scenarios?

Confirming I've not seen the behavior in other circumstances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes an issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants