-
-
Notifications
You must be signed in to change notification settings - Fork 46
feat: Add create_scheduling_policy option to job_queue #3
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
Conversation
|
Hey @bryantbiggs @antonbabenko can I get this added as well? I want to add job queues that don't have scheduling policies. |
|
Hey @bryantbiggs, did you see my comment? |
|
yes, I started to take a look and haven't come up with a solution that seems reasonable yet |
|
It's tricky, we need a way to say we don't want the scheduling policy, and it has to be at the queue level. Curious to see what you come up with |
main.tf
Outdated
| state = each.value.state | ||
| priority = each.value.priority | ||
| scheduling_policy_arn = try(each.value.scheduling_policy_arn, aws_batch_scheduling_policy.this[each.key].arn) | ||
| scheduling_policy_arn = lookup(each.value, "attach_scheduling_policy", true) ? try(each.value.scheduling_policy_arn, aws_batch_scheduling_policy.this[each.key].arn) : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets change this to
| scheduling_policy_arn = lookup(each.value, "attach_scheduling_policy", true) ? try(each.value.scheduling_policy_arn, aws_batch_scheduling_policy.this[each.key].arn) : null | |
| scheduling_policy_arn = try(each.value.create_scheduling_policy, true) ? aws_batch_scheduling_policy.this[each.key].arn : try(each.value.scheduling_policy_arn, null) |
then down on line 237 (can't comment on lines not in diff) - lets change line 237 to
for_each = { for k, v in var.job_queues : k => v if var.create && var.create_job_queues && try(v.create_scheduling_policy, true) }There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, I didn't actually know you could use values in the for_each
|
@bryantbiggs I actually found a workaround, you can supply |
With this, someone can use attach_scheduling_policy in their job_queue definition to skip over scheduling policy attachment.
|
@bryantbiggs done and ready |
bryantbiggs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @mattaltberg !
## [1.2.0](v1.1.2...v1.2.0) (2022-07-19) ### Features * Add create_scheduling_policy option to job_queue ([#3](#3)) ([86546af](86546af))
|
This PR is included in version 1.2.0 🎉 |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
With this, someone can use attach_scheduling_policy in their job_queue definition to skip over scheduling policy attachment.
Description
Right now, a scheduling policy is auto-attached to all job queues. Adding "attach_scheduling_policy" when defining people's job queues will override the default behaviour.
Motivation and Context
I don't want to always have a scheduling policy for my queues.
Breaking Changes
No, it uses lookup, and defaults to the original behaviour
How Has This Been Tested?
examples/*to demonstrate and validate my change(s)examples/*projectspre-commit run -aon my pull request