![](/img/trans.png)
[英]Using Event Grid, is it possible to trigger a logic app when a resource is created/deleted in Azure?
[英]Cloud Asset Organization feed for deleted/created resource
我正在為已刪除/創建的資源創建資產提要。 下面的代碼和鏈接僅在創建資源時顯示表達式,但我只需要在刪除資源時使用另一個提要。 參考鏈接 - https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_asset_organization_feed
我只想收到有關創建和刪除沒有更新的通知。
resource "google_cloud_asset_organization_feed" "organization_feed" {
billing_project = "my-project-name"
org_id = "123456789"
feed_id = "network-updates"
content_type = "RESOURCE"
asset_types = [
"compute.googleapis.com/Subnetwork",
"compute.googleapis.com/Network",
]
feed_output_config {
pubsub_destination {
topic = google_pubsub_topic.feed_output.id
}
}
condition {
expression = <<-EOT
!temporal_asset.deleted &&
temporal_asset.prior_asset_state == google.cloud.asset.v1.TemporalAsset.PriorAssetState.DOES_NOT_EXIST
EOT
title = "created"
description = "Send notifications on creation events"
}
}
要創建已刪除的資產提要,請將條件更改為:
condition {
expression = temporal_asset.deleted
title = "deleted"
description = "Send notifications on deletion events"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.