Skip to content

Instantly share code, notes, and snippets.

@ItayPodhajcer
Created May 29, 2023 14:11
Show Gist options
  • Save ItayPodhajcer/e83660de93405a3f51c97561894a069c to your computer and use it in GitHub Desktop.
Save ItayPodhajcer/e83660de93405a3f51c97561894a069c to your computer and use it in GitHub Desktop.
terraform-did-web-azure/main.tf-docs
resource "azurerm_storage_blob" "root" {
name = ".well-known/did.json"
storage_account_name = azurerm_storage_account.this.name
storage_container_name = "$web"
type = "Block"
content_type = "application/json"
source_content = templatefile(var.root_doc, {
domain = cloudflare_record.this.hostname
})
}
resource "azurerm_storage_blob" "subdocs" {
for_each = var.sub_docs
name = "${each.value.route}/did.json"
storage_account_name = azurerm_storage_account.this.name
storage_container_name = "$web"
type = "Block"
content_type = "application/json"
source_content = templatefile(each.value.doc, {
domain = cloudflare_record.this.hostname
route = replace(each.value.route, "/", ":")
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment