- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
12 KiB
12 KiB
Azure Naming Convention (2-3 Character Region Codes)
Last Updated: 2025-01-27
Status: Active - Legacy/Alternative Convention
Purpose: Azure resource naming with 2-3 character region codes
Overview
This document defines the standardized naming convention for all Azure resources in the DeFi Oracle Meta Mainnet (ChainID 138) deployment using 2-3 character region codes. The convention ensures uniformity, clarity, and compliance with Azure naming restrictions.
Note
: This document uses 2-3 character region codes (e.g.,
we,ne,fc).
Alternative: See Azure Naming Convention (3 Character Region Codes) for the 3-character standard.
Related Documentation:
- Azure Naming Convention (3 Character) - Standard 3-character region code convention
Table of Contents
- Overview
- Naming Pattern
- Region Codes
- Resource Type Abbreviations
- Naming Examples
- Special Cases
- Azure Naming Restrictions
- Implementation
- Validation
- Migration Guide
- Best Practices
- References
Naming Pattern
{cloud}-{env}-{region}-{resource}-{instance}
Pattern Components
| Component | Abbreviation | Length | Description | Examples |
|---|---|---|---|---|
| Cloud | az |
2 | Cloud provider identifier | az (Azure) |
| Environment | p, d, t, s |
1 | Environment code | p (prod), d (dev), t (test), s (staging) |
| Region | we, ne, fc |
2-3 | Azure region code | we (westeurope), ne (northeurope), fc (francecentral) |
| Resource | rg, aks, kv |
2-6 | Resource type abbreviation | See resource abbreviations below |
| Instance | 001, main, sys |
2-4 | Instance identifier | Sequential number or descriptive name |
Region Codes
| Full Name | Code | Full Name | Code |
|---|---|---|---|
| westeurope | we |
northeurope | ne |
| francecentral | fc |
francesouth | fs |
| germanywestcentral | gw |
germanynorth | gn |
| uksouth | uk |
ukwest | uw |
| swedencentral | sc |
norwayeast | ne |
| switzerlandnorth | sn |
polandcentral | pc |
| italynorth | in |
spaincentral | sp |
Resource Type Abbreviations
Core Infrastructure
| Resource Type | Abbreviation | Example |
|---|---|---|
| Resource Group | rg |
az-p-we-rg-net-001 |
| Virtual Network | vnet |
az-p-we-vnet-main |
| Subnet | snet |
az-p-we-snet-aks |
| Network Security Group | nsg |
az-p-we-nsg-valid |
| Public IP | pip |
az-p-we-pip-gw |
| Load Balancer | lb |
az-p-we-lb-main |
| Application Gateway | agw |
az-p-we-agw-main |
Compute
| Resource Type | Abbreviation | Example |
|---|---|---|
| AKS Cluster | aks |
az-p-we-aks-main |
| VM | vm |
az-p-we-vm-valid-001 |
| VM Scale Set | vmss |
az-p-we-vmss-rpc |
| Container Instance | aci |
az-p-we-aci-oracle |
Storage
| Resource Type | Abbreviation | Example |
|---|---|---|
| Storage Account | st |
az-p-we-st-backup-001 |
| Storage Container | cnt |
az-p-we-cnt-chaindata |
| Disk | disk |
az-p-we-disk-valid-001 |
| File Share | share |
az-p-we-share-config |
Security & Identity
| Resource Type | Abbreviation | Example |
|---|---|---|
| Key Vault | kv |
az-p-we-kv-secrets-001 |
| Managed Identity | id |
az-p-we-id-aks |
| Service Principal | sp |
az-p-we-sp-deploy |
Monitoring & Logging
| Resource Type | Abbreviation | Example |
|---|---|---|
| Log Analytics Workspace | law |
az-p-we-law-main |
| Application Insights | appi |
az-p-we-appi-main |
| Action Group | ag |
az-p-we-ag-alerts |
| Alert Rule | alert |
az-p-we-alert-cpu |
Database
| Resource Type | Abbreviation | Example |
|---|---|---|
| SQL Database | sql |
az-p-we-sql-blockscout |
| PostgreSQL | psql |
az-p-we-psql-main |
| Cosmos DB | cosmos |
az-p-we-cosmos-main |
Networking
| Resource Type | Abbreviation | Example |
|---|---|---|
| Route Table | rt |
az-p-we-rt-main |
| NAT Gateway | nat |
az-p-we-nat-main |
| VPN Gateway | vpngw |
az-p-we-vpngw-main |
| ExpressRoute | er |
az-p-we-er-main |
Naming Examples
Resource Groups
az-p-we-rg-net-001 # Network resource group (prod, westeurope)
az-p-we-rg-comp-001 # Compute resource group
az-p-we-rg-stor-001 # Storage resource group
az-p-we-rg-sec-001 # Security resource group
az-d-we-rg-net-001 # Development environment
AKS Resources
az-p-we-aks-main # Main AKS cluster
az-p-we-aks-node-sys # System node pool
az-p-we-aks-node-valid # Validator node pool
az-p-we-aks-node-sent # Sentry node pool
az-p-we-aks-node-rpc # RPC node pool
Networking
az-p-we-vnet-main # Main virtual network
az-p-we-snet-aks # AKS subnet
az-p-we-snet-valid # Validator subnet
az-p-we-snet-sent # Sentry subnet
az-p-we-snet-rpc # RPC subnet
az-p-we-snet-agw # Application Gateway subnet
az-p-we-nsg-valid # Validator NSG
az-p-we-pip-agw # Application Gateway public IP
az-p-we-agw-main # Application Gateway
Storage
az-p-we-st-backup-001 # Backup storage account
az-p-we-st-shared-001 # Shared storage account
az-p-we-st-tfstate-001 # Terraform state storage
az-p-we-cnt-chaindata # Chaindata container
az-p-we-cnt-config # Configuration container
Security
az-p-we-kv-secrets-001 # Key Vault for secrets
az-p-we-id-aks # AKS managed identity
az-p-we-id-oracle # Oracle service identity
Monitoring
az-p-we-law-main # Log Analytics workspace
az-p-we-appi-main # Application Insights
az-p-we-ag-alerts # Alert action group
Special Cases
Terraform Backend
az-p-we-st-tfstate-001 # Terraform state storage account
az-p-we-rg-tfstate-001 # Terraform state resource group
Multi-Region
az-p-we-aks-main # Primary region (westeurope)
az-p-ne-aks-main # Secondary region (northeurope)
az-p-fc-aks-main # Tertiary region (francecentral)
Node Pools
az-p-we-aks-node-sys # System node pool
az-p-we-aks-node-valid # Validator node pool (4 nodes)
az-p-we-aks-node-sent # Sentry node pool (3 nodes)
az-p-we-aks-node-rpc # RPC node pool (3 nodes)
Azure Naming Restrictions
General Rules
- Length: Varies by resource (see table below)
- Characters: Alphanumeric, hyphens, underscores (varies by resource)
- Case: Lowercase only
- Uniqueness: Must be globally unique for some resources (storage accounts, Key Vaults)
Resource-Specific Limits
| Resource | Min | Max | Allowed Characters | Notes |
|---|---|---|---|---|
| Resource Group | 1 | 90 | Alphanumeric, hyphens, underscores, periods, parentheses | |
| Storage Account | 3 | 24 | Lowercase letters and numbers | Globally unique |
| Key Vault | 3 | 24 | Alphanumeric and hyphens | Globally unique |
| AKS Cluster | 1 | 63 | Alphanumeric, hyphens, underscores | |
| Virtual Network | 2 | 64 | Alphanumeric, hyphens, underscores, periods | |
| Subnet | 1 | 80 | Alphanumeric, hyphens, underscores, periods | |
| NSG | 1 | 80 | Alphanumeric, hyphens, underscores, periods | |
| Public IP | 1 | 80 | Alphanumeric, hyphens, underscores, periods |
Implementation
Terraform Variables
# Naming convention variables
variable "cloud_provider" {
description = "Cloud provider code"
type = string
default = "az"
}
variable "environment" {
description = "Environment code (p=prod, d=dev, t=test, s=staging)"
type = string
default = "p"
}
variable "region_code" {
description = "Azure region code (we=westeurope, ne=northeurope)"
type = string
default = "we"
}
variable "project_code" {
description = "Project code"
type = string
default = "dbis" # DeFi Oracle Meta Mainnet
}
Naming Locals
locals {
# Region mapping
region_codes = {
westeurope = "we"
northeurope = "ne"
francecentral = "fc"
uksouth = "uk"
}
# Current region code
region_code = local.region_codes[var.location]
# Naming prefix
name_prefix = "${var.cloud_provider}-${var.environment}-${local.region_code}"
# Resource names
rg_network = "${local.name_prefix}-rg-net-001"
rg_compute = "${local.name_prefix}-rg-comp-001"
rg_storage = "${local.name_prefix}-rg-stor-001"
rg_security = "${local.name_prefix}-rg-sec-001"
aks_cluster = "${local.name_prefix}-aks-main"
key_vault = "${local.name_prefix}-kv-secrets-001"
vnet_main = "${local.name_prefix}-vnet-main"
}
Validation
Naming Validation Script
Use the provided script to validate naming:
./scripts/azure/validate-naming.sh <resource-name>
Manual Validation Checklist
- Follows pattern:
{cloud}-{env}-{region}-{resource}-{instance} - All segments are lowercase
- Uses hyphens as separators
- Within Azure length limits
- Globally unique if required (storage, Key Vault)
- No special characters except hyphens
- Region code matches actual region
Migration Guide
Updating Existing Resources
- Review current names: Identify resources using old naming
- Plan migration: Create new names following convention
- Update Terraform: Modify resource names in code
- Apply changes: Use Terraform to rename (may require destroy/create)
- Update references: Update all scripts and documentation
Example Migration
Old Name: defi-oracle-mainnet-rg
New Name: az-p-we-rg-comp-001
Best Practices
- Consistency: Always use the same pattern across all resources
- Short Segments: Keep abbreviations concise but clear
- Environment Prefix: Always include environment code
- Region Code: Include region for multi-region deployments
- Sequential Numbers: Use
001,002for multiple instances - Documentation: Document any custom abbreviations
- Validation: Validate names before deployment
- Tags: Use tags for additional metadata (don't rely on names alone)