feat: add built-in rate limiting policy configuration support#237
Conversation
72960e6 to
3a5b0b2
Compare
3a5b0b2 to
b5d0bed
Compare
| r.Config = ResourceConfiguration(req, resp) | ||
|
|
||
| if r.Config != nil { | ||
| resp.Diagnostics.Append(r.Config.EnsureResourceCompatibilityByVersion("built_in_rate_limiting_policy", "2026.3")...) |
There was a problem hiding this comment.
I figured this is better than looking for the feature toggle, since the feature toggle won't stick around forever.
|
|
||
| require ( | ||
| github.com/OctopusDeploy/go-octopusdeploy/v2 v2.113.1 | ||
| github.com/OctopusDeploy/go-octopusdeploy/v2 v2.114.0 |
There was a problem hiding this comment.
Bumped to pick up the prerequisite OctopusDeploy/go-octopusdeploy#428
IsaacCalligeros95
left a comment
There was a problem hiding this comment.
LGTM, one minor comment around the delete method but I haven't dealt with a resource like this before where deleting is blocked and am basing this off Dom's prior work for a similar resource.
One other call out, I'm not sure if this requires a datasource. I don't think there's much value in it, I don't see where users would want to read this and reference properties elsewhere. The one benefit is if a user does want to do that they can just read the current server state and aren't forced into managing the state in terraform. Just a heads up, I think ignoring it makes more sense.
| } | ||
|
|
||
| // Delete is a no-op as built-in rate limiting policies cannot be deleted. | ||
| func (r *builtInRateLimitingPolicyResource) Delete(_ context.Context, _ resource.DeleteRequest, _ *resource.DeleteResponse) { |
There was a problem hiding this comment.
There's some prior for resources that cannot be deleted here, it might be worth adding a warning.
There was a problem hiding this comment.
Great idea, I'll add something, thank you!
Yeah agreed. I don't intend to add something right now but if the need ever comes up, I think it should be no problem to add later 👍 |
Adds support for configuring the 3 built-in rate limiting policies via
octopusdeploy_built_in_rate_limiting_policy.Note that this is specifically for those three built-in policies which are all that exist in the initial implementation. If in future we were add support for custom rate limiting policies that could be deleted/created, they will be their own distinct resource type, because they're fundamentally different to these built-in ones which can only have a limited set of properties mutated and can never be created or deleted.