Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 0_core-infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Last updated: 2026-02-09

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/azure-bastion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/azure-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/network-security-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/public-ip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/resource-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/subnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 0_core-infrastructure/virtual-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Below is a list of variables used in this template, their expected values, types

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 10_migration-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Last updated: 2026-02-09

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 10_migration-backup/backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ terraform apply

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
2 changes: 1 addition & 1 deletion 10_migration-backup/site-recovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ terraform apply

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
8 changes: 6 additions & 2 deletions 11_media-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ Last updated: 2026-02-09
------------------------------------------

> [!IMPORTANT]
> TThis folder contains sample Terraform templates for Azure media services. These templates are starting points and should be customized based on your application needs.
> This folder contains sample Terraform templates for Azure media services. These templates are starting points and should be customized based on your application needs.

## Templates

- [cdn](./cdn)

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1646-limegreen" alt="Total views">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
1 change: 1 addition & 0 deletions 11_media-services/cdn/.terraform-provider-schema.json

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions 11_media-services/cdn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Terraform Template: <br/> CDN (Azure Content Delivery Network) → Azure Front Door (Standard/Premium)

Costa Rica

[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-10

------------------------------------------

> This template contains Terraform configurations to create an Azure Front Door (Standard/Premium) profile and endpoint suitable for serving media assets (for example, fronting a storage/web origin).

> [!NOTE]
> `Azure CDN (classic) profiles (for example`Standard_Microsoft`) no longer support new profile creation.` This template uses the modern Azure Front Door resources (`azurerm_cdn_frontdoor_*`).
> The modern replacement for “Microsoft-managed global CDN + edge routing” is Azure Front Door Standard/Premium. It provides the CDN capability, but it’s provisioned via azurerm_cdn_frontdoor_* resources (Front Door profile/endpoint/route/origin), not azurerm_cdn_profile. <br/>
>
> - If you already have classic CDN resources: Terraform can often still manage them.
> - If you’re creating new: you generally need Front Door Standard/Premium (or another supported CDN provider SKU where available), because classic Microsoft CDN can’t be created anymore.

<img width="650" alt="image" src="https://github.com/user-attachments/assets/75a4af56-de34-4d3b-81c2-d83cd906ec63" />

<img width="650" alt="image" src="https://github.com/user-attachments/assets/aacf9313-0032-4e31-8d9b-bb4ff7a5bb56" />

## File Descriptions

- **main.tf**: Creates the Resource Group, Front Door Profile, Endpoint, Origin Group, Origin, and a default Route.
- **variables.tf**: Defines the input variables used in the Terraform configuration.
- **provider.tf**: Configures the Azure provider (uses Azure CLI auth context).
- **terraform.tfvars**: Provides example values for the variables defined in `variables.tf`.
- **outputs.tf**: Defines outputs such as CDN profile ID, endpoint ID, and endpoint host name.

## Variables

| Variable Name | Description | Type | Example Value |
| --- | --- | --- | --- |
| `resource_group_name` | The name of the resource group to create. | string | `"rg-media-services-dev"` |
| `location` | Azure region for deployment. | string | `"East US"` |
| `cdn_profile_name` | Front Door profile name. | string | `"cdn-media-services-dev-001"` |
| `cdn_sku` | Front Door profile SKU. | string | `"Standard_AzureFrontDoor"` |
| `cdn_endpoint_name` | Front Door endpoint name. | string | `"cdn-media-dev-001"` |
| `origin_host` | Origin hostname (no scheme/path). | string | `"myorigin.example.com"` |
| `tags` | Tags applied to supported resources. | map(string) | `{ env = "dev" }` |

## Usage

1. Authenticate:

```sh
az login
```

2. (Optional) Select subscription:

```sh
az account set --subscription "<subscription-id-or-name>"
```

3. Initialize:

```sh
terraform init -upgrade
```

4. Validate and plan:

```sh
terraform validate
terraform plan
```

5. Apply:

```sh
terraform apply -auto-approve
```

## Outputs

| Output Name | Description |
| --- | --- |
| `cdn_profile_id` | The ID of the CDN profile. |
| `cdn_endpoint_id` | The ID of the CDN endpoint. |
| `cdn_endpoint_host_name` | The host name (FQDN) of the CDN endpoint. |

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1706-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-10</p>
</div>
<!-- END BADGE -->
68 changes: 68 additions & 0 deletions 11_media-services/cdn/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# main.tf
# This file contains the main configuration for creating an Azure Front Door (Standard/Premium)
# profile and endpoint (Azure CDN/Front Door modern offering).

resource "azurerm_resource_group" "cdn" {
name = var.resource_group_name
location = var.location

tags = var.tags
}

resource "azurerm_cdn_frontdoor_profile" "cdn" {
name = var.cdn_profile_name
resource_group_name = azurerm_resource_group.cdn.name
sku_name = var.cdn_sku

tags = var.tags
}

resource "azurerm_cdn_frontdoor_endpoint" "cdn" {
name = var.cdn_endpoint_name
cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile.cdn.id

tags = var.tags
}

resource "azurerm_cdn_frontdoor_origin_group" "cdn" {
name = "${var.cdn_endpoint_name}-og"
cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile.cdn.id

load_balancing {
additional_latency_in_milliseconds = 50
sample_size = 4
successful_samples_required = 3
}
}

resource "azurerm_cdn_frontdoor_origin" "cdn" {
name = "origin1"
cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group.cdn.id

enabled = true
certificate_name_check_enabled = false

host_name = var.origin_host
origin_host_header = var.origin_host
http_port = 80
https_port = 443

priority = 1
weight = 500
}

resource "azurerm_cdn_frontdoor_route" "cdn" {
name = "${var.cdn_endpoint_name}-route"
cdn_frontdoor_endpoint_id = azurerm_cdn_frontdoor_endpoint.cdn.id
cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group.cdn.id
cdn_frontdoor_origin_ids = [azurerm_cdn_frontdoor_origin.cdn.id]

enabled = true

forwarding_protocol = "HttpsOnly"
https_redirect_enabled = true
patterns_to_match = ["/*"]
supported_protocols = ["Http", "Https"]

link_to_default_domain = true
}
17 changes: 17 additions & 0 deletions 11_media-services/cdn/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# outputs.tf
# This file defines the outputs for the Azure CDN configuration.

output "cdn_profile_id" {
description = "The ID of the CDN profile."
value = azurerm_cdn_frontdoor_profile.cdn.id
}

output "cdn_endpoint_id" {
description = "The ID of the CDN endpoint."
value = azurerm_cdn_frontdoor_endpoint.cdn.id
}

output "cdn_endpoint_host_name" {
description = "The host name (FQDN) of the CDN endpoint."
value = azurerm_cdn_frontdoor_endpoint.cdn.host_name
}
24 changes: 24 additions & 0 deletions 11_media-services/cdn/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# provider.tf
# This file configures the Azure provider to interact with Azure resources.

terraform {
required_version = ">= 1.8, < 2.0"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.116"
}
}
}

provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}

# Uses the current Azure CLI context (az login + az account set)
skip_provider_registration = false
}
17 changes: 17 additions & 0 deletions 11_media-services/cdn/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Example values for the Azure CDN template (Media Services).

resource_group_name = "rg-media-services-dev"
location = "East US"

cdn_profile_name = "cdn-media-services-dev-001"
cdn_sku = "Standard_AzureFrontDoor"
cdn_endpoint_name = "cdn-media-dev-001"

# Example: storage or web origin hostname (no scheme, no path)
origin_host = "myorigin.example.com"

tags = {
env = "dev"
app = "media-services"
owner = "terraform"
}
Loading