Skip to content

automation: split automation_module CreateUpdate into separate Create and Update#31952

Merged
katbyte merged 2 commits intomainfrom
kt/split-cu-automation-module
Mar 19, 2026
Merged

automation: split automation_module CreateUpdate into separate Create and Update#31952
katbyte merged 2 commits intomainfrom
kt/split-cu-automation-module

Conversation

@katbyte
Copy link
Copy Markdown
Collaborator

@katbyte katbyte commented Mar 12, 2026

No description provided.

… and Update

Split resourceAutomationModuleCreateUpdate into independent
resourceAutomationModuleCreate and resourceAutomationModuleUpdate functions.

Create function:
- Uses timeouts.ForCreate
- Unwraps d.IsNewResource() guard, keeps isGlobal existence check
- Uses CreateOrUpdate API
- State waiter uses TimeoutCreate
- Error message says 'creating'

Update function:
- Uses timeouts.ForUpdate
- Parses ID from d.Id()
- Uses PATCH API (ModuleUpdateParameters) instead of PUT
- HasChange guard for module_link
- State waiter uses TimeoutUpdate
- Error message says 'updating'
- No d.SetId() call
@katbyte katbyte force-pushed the kt/split-cu-automation-module branch from d30d714 to 9ebaacd Compare March 12, 2026 19:26
Copy link
Copy Markdown
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment but looks good otherwise


// the API returns 'done' but it's not actually finished provisioning yet
// tracking issue: https://github.com/Azure/azure-rest-api-specs/pull/25435
stateConf := &pluginsdk.StateChangeConf{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this block and the create block of this code into a function since it looks to be mostly copy paste outside of the timeout

Copy link
Copy Markdown
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@katbyte katbyte merged commit 98ba57d into main Mar 19, 2026
49 checks passed
@katbyte katbyte deleted the kt/split-cu-automation-module branch March 19, 2026 07:09
@github-actions github-actions bot added this to the v4.65.0 milestone Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants