-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_automation_job_schedule
needs to be recreated after azurerm_automation_runbook
is updated
#7555
azurerm_automation_job_schedule
needs to be recreated after azurerm_automation_runbook
is updated
#7555
Conversation
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.
Hi @yupwei68, thanks for this fix. It mostly LGTM, but I think we will need to add some tests to cover this case - i.e. something like: create runbook, create schedule, create job_schedule, import, update runbook, import
It's probably also worth mentioning in the docs that job_schedule_id
can change when not explicitly configured.
Hi @manicminer , it seems that Terraform doesn't have |
Ah I see, thanks for clarifying. Attempting consistency across a single apply is important and this approach doesn't feel right to me. Given that there can only be one |
Hi @manicminer Thanks for your comments. Corresponding changes have been pushed. Please continue reviewing. === RUN TestAccAzureRMAutomationJobSchedule_basic |
Thanks @yupwei68, this looks great! |
This has been released in version 2.21.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.21.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fix: #7130
Local test the issue scenario with pass.
Job_schedule is a link from runbook to schedule. Once runbook has been updated, all its related job_schedule will update all linked job schedule id.
First terraform apply, one change to update runbook, terraform apply with success.
Second terraform apply, one create to create job_schedule, (Because job schedule id has been updated, the job schedule reading from its elder job schedule id doesn't exist any more. Here we delete its linked job schedule and recreate this job schedule ), terraform apply with success.