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

required image_id conflicts with AMI auto update task #503

Open
msvechla opened this issue Feb 27, 2024 · 0 comments
Open

required image_id conflicts with AMI auto update task #503

msvechla opened this issue Feb 27, 2024 · 0 comments
Assignees
Labels
kind/bug Categorizes an issue or PR as related to a bug.

Comments

@msvechla
Copy link

Affected Resource(s)

  • spotinst_ocean_aws

Terraform Configuration Files

resource "spotinst_ocean_aws" "ocean_eks" {
...
  image_id                    = var.eks_ami

  scheduled_task {
    tasks {
      is_enabled      = true
      cron_expression = var.spotinst_ami_auto_update_schedule
      task_type       = "amiAutoUpdate"
      parameters {
        ami_auto_update {
          apply_roll = true
          ami_auto_update_cluster_roll {
            comment                      = "spot ami auto update"
            batch_min_healthy_percentage = 100
            batch_size_percentage        = 20
            respect_pdb                  = true
          }
          minor_version = true
          patch         = true
        }
      }
    }
  }

  lifecycle {
    ignore_changes = [
      image_id          # image_id is a dynamic value that is modified by Spotinst. It should only be set initially
    ]
  }
}

Expected Behavior

image_id should not be required when using the AMI auto update feature, as it would conflict with values auto-updated by spot.io.

Actual Behavior

image_id is required

Additional Info

Can you elaborate on how AMI auto update should be used with this terraform provider? It seems like the required image_id will conflict with changes that are done automatically by the AMI auto update feature.

As a temporary workaround we added lifecycle ignore_changes to the image_id value, however if we want to make the AMI auto update feature a toggle, this would not be possible, as conditionals are not allowed on the lifecycle.

Of course there are some other workarounds, but it feels like this is a design issue that should be solved on the provider level.

What do you think? Thanks a lot for your support!

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.
@msvechla msvechla added the kind/bug Categorizes an issue or PR as related to a bug. label Feb 27, 2024
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