![](/img/trans.png)
[英]How to access the resource ids between two different terraform code
[英]How to access a resource from a different module in Terraform?
模塊 'xyz' 應該等待 10 分鍾讓模塊 'abc' 駐留在 diff 目錄中。 這是詳細信息。
根/x/main.tf
module "abc" {
...
}
resource "time_sleep" "wait_10_mins" {
depends_on = [module.abc[0]]
create_duration = "10m"
}
根/y/main.tf
module "xyz" {
.....
depends_on = how to access resource time_sleep.wait_10_mins here?
}
你似乎很接近:
如果 abc 模塊使用count
或for_each
則只需要[0]
:
depends_on = [
module.abc
]
和
depends_on = [
time_sleep.wait_10_mins
]
應該做的伎倆。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.