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

feat: Default to not changing autoscaling schedule values at the scheduled time #3322

Conversation

tomellis91
Copy link
Contributor

@tomellis91 tomellis91 commented Mar 17, 2025

Description

Currently when you don't set a value of desired_capacity, min_size or max_size it replaces them with 0 which end's up being an invalid parameter combination.

For example

Config block

"Scale Out" = {
  desired_size = 7
  min_size     = 7
 ...
}

Payload result

"requestParameters": {
  "autoScalingGroupName": "xyz"
  "scheduledActionName": "Scale Out",
  "minSize": 7,
  "maxSize": 0,
  "desiredCapacity": 7,
 },

The docs for the aws_autoscaling_schedule options desired_capacity, max_size and min_size explain Set to -1 if you don't want to change the ... at the scheduled time. Defaults to 0.

When a value is excluded from the Terraform config it's values shouldn't be overriden and updated to 0 it should leave them as is.

Motivation and Context

Invalid parameters going through and potentially scaling some configurations to 0.

Breaking Changes

Yes, it just overrides the defaults.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects

I haven't uploaded and example, it is pretty straightforward. I can if it is required but this is just a quick change.

  • I have executed pre-commit run -a on my pull request

@tomellis91 tomellis91 changed the title ensure aws_autoscaling_schedule values aren't set to 0 when there is no change fix aws_autoscaling_schedule values defaulting to 0 Mar 17, 2025
@tomellis91 tomellis91 force-pushed the feature/scheduled-scale-updates branch from a55cf5b to c08d4c5 Compare March 17, 2025 08:26
@tomellis91 tomellis91 changed the title fix aws_autoscaling_schedule values defaulting to 0 fix: stop aws_autoscaling_schedule values defaulting to 0 Mar 17, 2025
@tomellis91 tomellis91 changed the title fix: stop aws_autoscaling_schedule values defaulting to 0 fix: Stop aws_autoscaling_schedule values defaulting to 0 Mar 17, 2025
@tomellis91 tomellis91 force-pushed the feature/scheduled-scale-updates branch from c08d4c5 to 6bb423e Compare March 17, 2025 08:29
@tomellis91
Copy link
Contributor Author

Hey @bryantbiggs, would you he able to assign a reviewer to this if possible?

Cheers

@bryantbiggs bryantbiggs changed the title fix: Stop aws_autoscaling_schedule values defaulting to 0 feat: Default to not changing autoscaling schedule values at the scheduled time Mar 29, 2025
@bryantbiggs bryantbiggs merged commit abf76f6 into terraform-aws-modules:master Mar 29, 2025
28 checks passed
antonbabenko pushed a commit that referenced this pull request Mar 29, 2025
## [20.35.0](v20.34.0...v20.35.0) (2025-03-29)

### Features

* Default to not changing autoscaling schedule values at the scheduled time ([#3322](#3322)) ([abf76f6](abf76f6))
@antonbabenko
Copy link
Member

This PR is included in version 20.35.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants