Skip to content

Instantly share code, notes, and snippets.

View ItayPodhajcer's full-sized avatar

Itay Podhajcer ItayPodhajcer

View GitHub Profile
@ItayPodhajcer
ItayPodhajcer / main.tf
Created May 29, 2023 14:11
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
})
}
@ItayPodhajcer
ItayPodhajcer / subdoc.json
Created May 29, 2023 14:09
terraform-did-web-azure/subdoc.json
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/jws-2020/v1"
],
"id": "did:web:${domain}:${route}",
"verificationMethod": [
{
"id": "did:web:${domain}:${route}#key-0",
"type": "JsonWebKey2020",
@ItayPodhajcer
ItayPodhajcer / root.json
Created May 29, 2023 14:07
terraform-did-web-azure/root.json
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/jws-2020/v1"
],
"id": "did:web:${domain}",
"verificationMethod": [
{
"id": "did:web:${domain}#key-0",
"type": "JsonWebKey2020",
@ItayPodhajcer
ItayPodhajcer / main.tf
Created May 29, 2023 13:59
terraform-did-web-azure/main.tf#cname-domain
resource "cloudflare_record" "this" {
zone_id = data.cloudflare_zones.this.zones[0].id
name = var.subdomain
value = azurerm_cdn_endpoint.this.fqdn
type = "CNAME"
ttl = 1
proxied = false
}
resource "azurerm_cdn_endpoint_custom_domain" "this" {
@ItayPodhajcer
ItayPodhajcer / main.tf
Created May 29, 2023 13:57
terraform-did-web-azure/main.tf#cdn
resource "azurerm_cdn_profile" "this" {
name = "cdn-${var.deployment_name}-${var.location}"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
sku = "Standard_Microsoft"
}
resource "azurerm_cdn_endpoint" "this" {
name = "endpoint-${var.deployment_name}-${var.location}"
profile_name = azurerm_cdn_profile.this.name
@ItayPodhajcer
ItayPodhajcer / main.tf
Created May 29, 2023 13:55
terraform-did-web-azure/main.tf#storage
resource "random_string" "this" {
length = 24
special = false
upper = false
}
resource "azurerm_storage_account" "this" {
name = random_string.this.result
resource_group_name = azurerm_resource_group.this.name
location = var.location
@ItayPodhajcer
ItayPodhajcer / main.tf
Created May 29, 2023 13:54
terraform-did-web-azure/main.tf#zone-and-rg
data "cloudflare_zones" "this" {
filter {
name = var.zone_name
}
}
resource "azurerm_resource_group" "this" {
name = "rg-${var.deployment_name}-${var.location}"
location = var.location
}
@ItayPodhajcer
ItayPodhajcer / main.tf
Created March 15, 2023 15:49
terraform-azure-mastodon/main.tf#aci-mastodon-sidekiq
container {
name = "mastodon-sidekiq"
image = "docker.io/bitnami/mastodon:4"
cpu = "0.5"
memory = "1"
environment_variables = {
"ALLOW_EMPTY_PASSWORD" = "yes"
"MASTODON_MODE" = "sidekiq"
"MASTODON_REDIS_HOST" = "localhost"
@ItayPodhajcer
ItayPodhajcer / main.tf
Created March 15, 2023 15:43
terraform-azure-mastodon/main.tf#aci-mastodon-streaming
container {
name = "mastodon-streaming"
image = "docker.io/bitnami/mastodon:4"
cpu = "0.5"
memory = "1"
ports {
port = "4000"
protocol = "TCP"
}
@ItayPodhajcer
ItayPodhajcer / main.tf
Created March 15, 2023 15:42
terraform-azure-mastodon/main.tf#aci-mastodon-web
container {
name = "mastodon"
image = "docker.io/bitnami/mastodon:4"
cpu = "0.5"
memory = "1"
ports {
port = "3000"
protocol = "TCP"
}