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

time_sleep ignoring depends_on clause #81

Open
DevonK3 opened this issue Mar 11, 2022 · 3 comments
Open

time_sleep ignoring depends_on clause #81

DevonK3 opened this issue Mar 11, 2022 · 3 comments

Comments

@DevonK3
Copy link

DevonK3 commented Mar 11, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/time] ~> 0.7.2
├── provider[registry.terraform.io/hashicorp/azurerm] ~> 2.94.0
├── module.vmlin
│   ├── provider[registry.terraform.io/hashicorp/azurerm]
│   └── provider[registry.terraform.io/hashicorp/time]
├── module.vmwin
│   ├── provider[registry.terraform.io/hashicorp/azurerm]
│   └── provider[registry.terraform.io/hashicorp/time]
└── module.newas
    └── provider[registry.terraform.io/hashicorp/azurerm]

/apps/tfsagent10/_work/_tool/terraform/1.1.4/x64/terraform validate
Success! The configuration is valid.

Affected Resource(s)

  • time_sleep

Terraform Configuration Files

resource "azurerm_windows_virtual_machine" "vm" { ... }
resource "azurerm_managed_disk" "datadisk" { ... }
resource "azurerm_virtual_machine_data_disk_attachment" "datadisk" { ... }

resource "azurerm_virtual_machine_extension" "scripts" {
...
depends_on = [azurerm_windows_virtual_machine.vm, azurerm_virtual_machine_data_disk_attachment.datadisk]
}

resource "azurerm_virtual_machine_extension" "disk-encryption" { 
...
depends_on = [azurerm_virtual_machine_extension.scripts]
}

resource "azurerm_virtual_machine_extension" "domjoin" {
...
< code to join to AD Domain >
...
depends_on = [azurerm_virtual_machine_extension.disk-encryption]
}

resource "time_sleep" "wait_for_ou" {
  create_duration = "300s"

  depends_on = [azurerm_virtual_machine_extension.domjoin]
}

Debug Output

module.vmwin[0].time_sleep.wait_for_ou: Creating...
module.vmwin[0].azurerm_network_interface.vm_nic: Creating...
module.vmwin[0].azurerm_managed_disk.datadisk[0]: Creating...
module.vmwin[0].azurerm_network_interface.vm_nic: Creation complete after 5s ...
module.vmwin[0].azurerm_windows_virtual_machine.vm: Creating...
module.vmwin[0].azurerm_managed_disk.datadisk[0]: Creation complete after 6s ...
module.vmwin[0].time_sleep.wait_for_ou: Still creating... [10s elapsed]
module.vmwin[0].azurerm_windows_virtual_machine.vm: Still creating... [10s elapsed]
module.vmwin[0].time_sleep.wait_for_ou: Still creating... [20s elapsed]
module.vmwin[0].azurerm_windows_virtual_machine.vm: Still creating... [20s elapsed]
...
module.vmwin[0].azurerm_virtual_machine_extension.scripts: Still creating... [3m10s elapsed]
module.vmwin[0].time_sleep.wait_for_ou: Creation complete after 5m0s [id=2022-03-11T21:40:36Z]
module.vmwin[0].azurerm_virtual_machine_extension.scripts: Still creating... [3m20s elapsed]
...
module.vmwin[0].azurerm_virtual_machine_extension.disk-encryption: Creation complete after 1m33 ...

Apply complete! Resources: 7 added, 0 changed, 0 destroyed.

Panic Output

N/A

Expected Behavior

Process1 (Dom Join) should run, then Resource3+ should run after Resource2 (time_sleep)

Actual Behavior

time_sleep ran 1st and everything else ran at the same time (per there depends_on order)

Steps to Reproduce

  1. terraform apply

Important Factoids

N/A

References

N/A

@DevonK3
Copy link
Author

DevonK3 commented Mar 11, 2022

This has been working fine for over a year. We recently upgraded the TF and ARM versions and just noticed this.

@DevonK3
Copy link
Author

DevonK3 commented Mar 11, 2022

I checked my previous pipeline runs and it ran as expected on 1-Mar-22. No code changes have been applied on my side. Our version upgrades were on 31-Jan-22. So I am really confused now.

...
module.vmwin[0].azurerm_virtual_machine_extension.domjoin[0]: Still creating... [1m30s elapsed]
module.vmwin[0].azurerm_virtual_machine_extension.domjoin[0]: Creation complete after 1m33s ...
module.vmwin[0].time_sleep.wait_for_ou: Creating...
module.vmwin[1].azurerm_virtual_machine_extension.domjoin[0]: Still creating... [40s elapsed]
module.vmwin[0].time_sleep.wait_for_ou: Still creating... [10s elapsed]
module.vmwin[1].azurerm_virtual_machine_extension.domjoin[0]: Still creating... [50s elapsed]
module.vmwin[0].time_sleep.wait_for_ou: Still creating... [20s elapsed]
module.vmwin[1].azurerm_virtual_machine_extension.domjoin[0]: Still creating... [1m0s elapsed]
module.vmwin[1].azurerm_virtual_machine_extension.domjoin[0]: Creation complete after 1m3s ...
module.vmwin[1].time_sleep.wait_for_ou: Creating...
module.vmwin[0].time_sleep.wait_for_ou: Still creating... [30s elapsed]
...

Overall Changes

Upgraded pipelines to use Terraform 1.1.4

  • Upgraded Terraform Modules
    • azurerm v2.87.0 -> v2.94.0
    • azuread v2.11.0 -> v2.16.0

@vkeerthi1
Copy link

Any update regarding this ? i do face same issue

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

No branches or pull requests

2 participants