This Terraform module implements an event forwarding system that captures Azure resource events and relays them to Stacklet's AWS-based platform for real-time policy execution and governance. It creates a cross-cloud event bridge that enables Stacklet's governance capabilities to extend from AWS into Azure environments.
The system works through a four-step process:
- Sets up an Azure EventGrid System Topic to capture subscription-level events
- By default monitors these resource events:
Microsoft.Resources.ResourceWriteSuccess
(resource creation/updates)Microsoft.Resources.ResourceActionSuccess
(resource actions)Microsoft.Resources.ResourceDeleteSuccess
(resource deletions)
- Events are queued in an Azure Storage Queue for reliable processing
- Uses CloudEvent schema v1.0 format for standardized event structure
- Python-based Azure Function processes events from the storage queue
- Uses queue trigger to automatically process incoming events
- Runs on Linux App Service Plan with Python 3.10
- Uses Azure Managed Identity to get an identity token
- Performs AssumeRoleWithWebIdentity to obtain AWS credentials
- Forwards events to AWS EventBridge in the target Stacklet account
- Azure Resource Group - Contains all module resources
- Azure EventGrid System Topic - Captures subscription-level events
- Azure Storage Account & Queue - Provides reliable event storage
- Azure Function App - Handles event processing and forwarding
- Azure Application Insights - Enables monitoring and logging
- Azure AD Application & Service Principal - Manages cross-cloud authentication
- User Assigned Identity - Provides managed identity for the function
This system enables:
- Event-driven policy execution - Real-time response to Azure resource changes
- Real-time compliance monitoring - Immediate visibility into compliance status
- Automated governance actions - Automated remediation and policy enforcement
- Cross-cloud resource visibility - Unified governance across Azure and AWS
Azure Functions Core Tools must be installed.
Name | Version |
---|---|
azuread | n/a |
azurerm | n/a |
local | n/a |
null | n/a |
random | n/a |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
aws_target_account | AWS Target account for relay, to be provided by Stacklet. | string |
n/a | yes |
aws_target_event_bus | AWS Target event bus for relay, to be provided by Stacklet. | string |
n/a | yes |
aws_target_partition | AWS Target partition for relay, to be provided by Stacklet. | string |
"aws" |
no |
aws_target_prefix | Deployment prefix for the target Stacklet instance, to be provided by Stacklet. | string |
n/a | yes |
aws_target_region | AWS Target region for relay, to be provided by Stacklet. | string |
n/a | yes |
aws_target_role_name | AWS Target role name for relay, to be provided by Stacklet. | string |
n/a | yes |
azuread_application | Azure AD Application. One per tenant. | string |
null |
no |
event_grid_topic_name | System Topic Name for subscription events if it already exists | string |
null |
no |
event_grid_topic_resource_group | System Topic resource group name for subscription events if it already exists | string |
null |
no |
event_names | Event Names to filter | list(string) |
[ |
no |
prefix | A Prefix for all of the generated resources | string |
n/a | yes |
resource_group_location | Resource Group location for generated resoruces | string |
n/a | yes |
tags | Tags to apply to resources | map(any) |
{} |
no |
No outputs.