Files
smom-dbis-138/terraform/modules/resource-groups/main.tf
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- 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.
2025-12-12 14:57:48 -08:00

145 lines
3.1 KiB
HCL

# Resource Groups Module
# Creates resource groups according to Well-Architected Framework best practices
variable "environment" {
description = "Environment (prod, dev, test, staging)"
type = string
}
variable "location" {
description = "Azure region"
type = string
}
variable "project_name" {
description = "Project name"
type = string
default = "defi-oracle-mainnet"
}
variable "tags" {
description = "Tags to apply to resource groups"
type = map(string)
default = {}
}
# Common tags
locals {
common_tags = merge(
{
Environment = var.environment
Project = var.project_name
ChainID = "138"
ManagedBy = "Terraform"
},
var.tags
)
}
# Networking Resource Group (Long-lived)
resource "azurerm_resource_group" "network" {
name = "rg-${var.environment}-network-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Networking"
Lifecycle = "Long-lived"
})
}
# Compute Resource Group (Long-lived)
resource "azurerm_resource_group" "compute" {
name = "rg-${var.environment}-compute-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Compute"
Lifecycle = "Long-lived"
})
}
# Storage Resource Group (Long-lived)
resource "azurerm_resource_group" "storage" {
name = "rg-${var.environment}-storage-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Storage"
Lifecycle = "Long-lived"
})
}
# Security Resource Group (Long-lived)
resource "azurerm_resource_group" "security" {
name = "rg-${var.environment}-security-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Security"
Lifecycle = "Long-lived"
})
}
# Monitoring Resource Group (Long-lived)
resource "azurerm_resource_group" "monitoring" {
name = "rg-${var.environment}-monitoring-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Monitoring"
Lifecycle = "Long-lived"
})
}
# Identity Resource Group (Long-lived)
resource "azurerm_resource_group" "identity" {
name = "rg-${var.environment}-identity-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Identity"
Lifecycle = "Long-lived"
})
}
# Temporary Resource Group (Ephemeral)
resource "azurerm_resource_group" "temp" {
name = "rg-${var.environment}-temp-001"
location = var.location
tags = merge(local.common_tags, {
Purpose = "Temporary"
Lifecycle = "Ephemeral"
})
}
# Outputs
output "network_rg_name" {
value = azurerm_resource_group.network.name
}
output "compute_rg_name" {
value = azurerm_resource_group.compute.name
}
output "storage_rg_name" {
value = azurerm_resource_group.storage.name
}
output "security_rg_name" {
value = azurerm_resource_group.security.name
}
output "monitoring_rg_name" {
value = azurerm_resource_group.monitoring.name
}
output "identity_rg_name" {
value = azurerm_resource_group.identity.name
}
output "temp_rg_name" {
value = azurerm_resource_group.temp.name
}