diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 15b24546acb..386f5d1449d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -101,6 +101,7 @@ /avm/res/digital-twins/digital-twins-instance/ @Azure/avm-res-digitaltwins-digitaltwinsinstance-module-owners-bicep @Azure/avm-module-reviewers-bicep /avm/res/document-db/database-account/ @Azure/avm-res-documentdb-databaseaccount-module-owners-bicep @Azure/avm-module-reviewers-bicep /avm/res/document-db/mongo-cluster/ @Azure/avm-res-documentdb-mongocluster-module-owners-bicep @Azure/avm-module-reviewers-bicep +/avm/res/edge/site/ @Azure/avm-res-edge-site-module-owners-bicep @Azure/avm-module-reviewers-bicep /avm/res/elastic-san/elastic-san/ @Azure/avm-res-elasticsan-elasticsan-module-owners-bicep @Azure/avm-module-reviewers-bicep /avm/res/event-grid/domain/ @Azure/avm-res-eventgrid-domain-module-owners-bicep @Azure/avm-module-reviewers-bicep /avm/res/event-grid/namespace/ @Azure/avm-res-eventgrid-namespace-module-owners-bicep @Azure/avm-module-reviewers-bicep diff --git a/.github/ISSUE_TEMPLATE/avm_module_issue.yml b/.github/ISSUE_TEMPLATE/avm_module_issue.yml index 47c4e486526..923cc197a52 100644 --- a/.github/ISSUE_TEMPLATE/avm_module_issue.yml +++ b/.github/ISSUE_TEMPLATE/avm_module_issue.yml @@ -136,6 +136,7 @@ body: - "avm/res/digital-twins/digital-twins-instance" - "avm/res/document-db/database-account" - "avm/res/document-db/mongo-cluster" + - "avm/res/edge/site" - "avm/res/elastic-san/elastic-san" - "avm/res/event-grid/domain" - "avm/res/event-grid/namespace" diff --git a/.github/workflows/avm.res.edge.site.yml b/.github/workflows/avm.res.edge.site.yml new file mode 100644 index 00000000000..1c01d8308df --- /dev/null +++ b/.github/workflows/avm.res.edge.site.yml @@ -0,0 +1,89 @@ +name: "avm.res.edge.site" + +on: + workflow_dispatch: + inputs: + staticValidation: + type: boolean + description: "Execute static validation" + required: false + default: true + deploymentValidation: + type: boolean + description: "Execute deployment validation" + required: false + default: true + removeDeployment: + type: boolean + description: "Remove deployed module" + required: false + default: true + customLocation: + type: string + description: "Default location overwrite (e.g., eastus)" + required: false + push: + branches: + - main + paths: + - ".github/actions/templates/avm-**" + - ".github/workflows/avm.template.module.yml" + - ".github/workflows/avm.res.edge.site.yml" + - "avm/res/edge/site/**" + - "utilities/pipelines/**" + - "!utilities/pipelines/platform/**" + - "!*/**/child-module-publish-allowed-list.json" + - "!*/**/README.md" + +env: + modulePath: "avm/res/edge/site" + workflowPath: ".github/workflows/avm.res.edge.site.yml" + +concurrency: + group: ${{ github.workflow }} + +jobs: + ########################### + # Initialize pipeline # + ########################### + job_initialize_pipeline: + runs-on: ubuntu-latest + name: "Initialize pipeline" + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "Set input parameters to output variables" + id: get-workflow-param + uses: ./.github/actions/templates/avm-getWorkflowInput + with: + workflowPath: "${{ env.workflowPath}}" + - name: "Get module test file paths" + id: get-module-test-file-paths + uses: ./.github/actions/templates/avm-getModuleTestFiles + with: + modulePath: "${{ env.modulePath }}" + outputs: + workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} + moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + psRuleModuleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.psRuleModuleTestFilePaths }} + modulePath: "${{ env.modulePath }}" + + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: "Run" + permissions: + id-token: write # For OIDC + contents: write # For release tags + needs: + - job_initialize_pipeline + uses: ./.github/workflows/avm.template.module.yml + with: + workflowInput: "${{ needs.job_initialize_pipeline.outputs.workflowInput }}" + moduleTestFilePaths: "${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}" + psRuleModuleTestFilePaths: "${{ needs.job_initialize_pipeline.outputs.psRuleModuleTestFilePaths }}" + modulePath: "${{ needs.job_initialize_pipeline.outputs.modulePath}}" + secrets: inherit diff --git a/avm/res/edge/site/README.md b/avm/res/edge/site/README.md new file mode 100644 index 00000000000..22da638b4d2 --- /dev/null +++ b/avm/res/edge/site/README.md @@ -0,0 +1,34 @@ +# Microsoft Edge Site (Multi-Scope) `[Microsoft.Edge/sites]` + +This module's child-modules deploy a Microsoft Edge Site at a Subscription (sub-scope) or Resource Group (rg-scope) scope. + +> While this template is **not** published, you can find the actual published modules in the subfolders +> - `sub-scope` +> - `rg-scope` + + + +## Navigation + +- [Resource Types](#Resource-Types) +- [Usage examples](#Usage-examples) +- [Parameters](#Parameters) +- [Outputs](#Outputs) + +## Resource Types + +_None_ + +## Usage examples + +**Note**: This is a multi-scoped module. This means, you will find the 'Usage Examples' in the documentation of the correspondingly scoped child modules: +- `/rg-scope/README.md` +- `/sub-scope/README.md` + +## Parameters + +_None_ + +## Outputs + +_None_ diff --git a/avm/res/edge/site/main.bicep b/avm/res/edge/site/main.bicep new file mode 100644 index 00000000000..84084cba113 --- /dev/null +++ b/avm/res/edge/site/main.bicep @@ -0,0 +1,13 @@ +targetScope = 'subscription' + +// This module supports both subscription and resource group scope deployments +// Use the deploymentScope parameter to specify which scope to use +metadata name = 'Microsoft Edge Site (Multi-Scope)' +metadata description = ''' +This module's child-modules deploy a Microsoft Edge Site at a Subscription (sub-scope) or Resource Group (rg-scope) scope. + +> While this template is **not** published, you can find the actual published modules in the subfolders +> - `sub-scope` +> - `rg-scope` + +''' diff --git a/avm/res/edge/site/main.json b/avm/res/edge/site/main.json new file mode 100644 index 00000000000..e086ef840c4 --- /dev/null +++ b/avm/res/edge/site/main.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.37.4.10188", + "templateHash": "109047849730473759" + }, + "name": "Microsoft Edge Site (Multi-Scope)", + "description": "This module's child-modules deploy a Microsoft Edge Site at a Subscription (sub-scope) or Resource Group (rg-scope) scope.\n\n> While this template is **not** published, you can find the actual published modules in the subfolders\n> - `sub-scope`\n> - `rg-scope`\n\n" + }, + "resources": [] +} \ No newline at end of file diff --git a/avm/res/edge/site/rg-scope/CHANGELOG.md b/avm/res/edge/site/rg-scope/CHANGELOG.md new file mode 100644 index 00000000000..d607280b82e --- /dev/null +++ b/avm/res/edge/site/rg-scope/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/edge/site/rg-scope/CHANGELOG.md). + +## 0.1.0 + +### Changes + +- Initial version + +### Breaking Changes + +- None diff --git a/avm/res/edge/site/rg-scope/README.md b/avm/res/edge/site/rg-scope/README.md new file mode 100644 index 00000000000..a9409c9e122 --- /dev/null +++ b/avm/res/edge/site/rg-scope/README.md @@ -0,0 +1,307 @@ +# Microsoft Edge Site Resources `[Microsoft.Edge/sites]` + +Resource group scoped resources for Microsoft Edge Site. + +## Navigation + +- [Resource Types](#Resource-Types) +- [Usage examples](#Usage-examples) +- [Parameters](#Parameters) +- [Outputs](#Outputs) +- [Data Collection](#Data-Collection) + +## Resource Types + +| Resource Type | API Version | References | +| :-- | :-- | :-- | +| `Microsoft.Edge/sites` | 2025-03-01-preview | | + +## Usage examples + +The following section provides usage examples for the module, which were used to validate and deploy the module successfully. For a full reference, please review the module's test folder in its repository. + +>**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. + +>**Note**: To reference the module, please use the following syntax `br/public:avm/res/edge/site/rg-scope:`. + +- [Using only defaults](#example-1-using-only-defaults) +- [Using Well-Architected Framework aligned parameters](#example-2-using-well-architected-framework-aligned-parameters) + +### Example 1: _Using only defaults_ + +This instance deploys the module with the minimum set of required parameters. + + +
+ +via Bicep module + +```bicep +module site 'br/public:avm/res/edge/site/rg-scope:' = { + name: 'siteDeployment' + params: { + // Required parameters + name: 'esrgmin001' + siteAddress: { + country: 'US' + } + // Non-required parameters + location: '' + } +} +``` + +
+

+ +

+ +via JSON parameters file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "esrgmin001" + }, + "siteAddress": { + "value": { + "country": "US" + } + }, + // Non-required parameters + "location": { + "value": "" + } + } +} +``` + +
+

+ +

+ +via Bicep parameters file + +```bicep-params +using 'br/public:avm/res/edge/site/rg-scope:' + +// Required parameters +param name = 'esrgmin001' +param siteAddress = { + country: 'US' +} +// Non-required parameters +param location = '' +``` + +
+

+ +### Example 2: _Using Well-Architected Framework aligned parameters_ + +This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework. + + +

+ +via Bicep module + +```bicep +module site 'br/public:avm/res/edge/site/rg-scope:' = { + name: 'siteDeployment' + params: { + // Required parameters + name: 'esrgwaf001' + siteAddress: { + city: 'New York' + country: 'US' + postalCode: '10001' + stateOrProvince: 'New York' + streetAddress1: '350 Fifth Avenue' + streetAddress2: 'Floor 34' + } + // Non-required parameters + description: 'Test edge site for region deployment' + displayName: 'Test Edge Site' + labels: { + businessUnit: 'IT' + costCenter: 'CC-1234' + environment: 'test' + project: 'EdgeDeployment' + } + location: '' + } +} +``` + +
+

+ +

+ +via JSON parameters file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "esrgwaf001" + }, + "siteAddress": { + "value": { + "city": "New York", + "country": "US", + "postalCode": "10001", + "stateOrProvince": "New York", + "streetAddress1": "350 Fifth Avenue", + "streetAddress2": "Floor 34" + } + }, + // Non-required parameters + "description": { + "value": "Test edge site for region deployment" + }, + "displayName": { + "value": "Test Edge Site" + }, + "labels": { + "value": { + "businessUnit": "IT", + "costCenter": "CC-1234", + "environment": "test", + "project": "EdgeDeployment" + } + }, + "location": { + "value": "" + } + } +} +``` + +
+

+ +

+ +via Bicep parameters file + +```bicep-params +using 'br/public:avm/res/edge/site/rg-scope:' + +// Required parameters +param name = 'esrgwaf001' +param siteAddress = { + city: 'New York' + country: 'US' + postalCode: '10001' + stateOrProvince: 'New York' + streetAddress1: '350 Fifth Avenue' + streetAddress2: 'Floor 34' +} +// Non-required parameters +param description = 'Test edge site for region deployment' +param displayName = 'Test Edge Site' +param labels = { + businessUnit: 'IT' + costCenter: 'CC-1234' + environment: 'test' + project: 'EdgeDeployment' +} +param location = '' +``` + +
+

+ +## Parameters + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-name) | string | Name of the resource to create. | +| [`siteAddress`](#parameter-siteaddress) | object | The physical address configuration of the site. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`description`](#parameter-description) | string | The description of the site. | +| [`displayName`](#parameter-displayname) | string | The display name of the site. | +| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. | +| [`labels`](#parameter-labels) | object | Labels for the site. | +| [`location`](#parameter-location) | string | Location for all Resources. | + +### Parameter: `name` + +Name of the resource to create. + +- Required: Yes +- Type: string + +### Parameter: `siteAddress` + +The physical address configuration of the site. + +- Required: Yes +- Type: object + +### Parameter: `description` + +The description of the site. + +- Required: No +- Type: string + +### Parameter: `displayName` + +The display name of the site. + +- Required: No +- Type: string +- Default: `[parameters('name')]` + +### Parameter: `enableTelemetry` + +Enable/Disable usage telemetry for module. + +- Required: No +- Type: bool +- Default: `True` + +### Parameter: `labels` + +Labels for the site. + +- Required: No +- Type: object + +### Parameter: `location` + +Location for all Resources. + +- Required: No +- Type: string +- Default: `[resourceGroup().location]` + +## Outputs + +| Output | Type | Description | +| :-- | :-- | :-- | +| `location` | string | The location the resource was deployed into. | +| `name` | string | The name of the site. | +| `resourceGroupName` | string | The name of the resource group the role assignment was applied at. | +| `resourceId` | string | The resource ID of the site. | + +## Data Collection + +The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. diff --git a/avm/res/edge/site/rg-scope/main.bicep b/avm/res/edge/site/rg-scope/main.bicep new file mode 100644 index 00000000000..88c07a5325c --- /dev/null +++ b/avm/res/edge/site/rg-scope/main.bicep @@ -0,0 +1,76 @@ +metadata name = 'Microsoft Edge Site Resources' +metadata description = 'Resource group scoped resources for Microsoft Edge Site.' + +// ============== // +// Parameters // +// ============== // + +@sys.description('Required. Name of the resource to create.') +param name string + +@sys.description('Optional. Location for all Resources.') +param location string = resourceGroup().location + +@sys.description('Optional. Enable/Disable usage telemetry for module.') +param enableTelemetry bool = true + +@sys.description('Optional. The description of the site.') +param description string? + +@sys.description('Optional. The display name of the site.') +param displayName string = name + +@sys.description('Optional. Labels for the site.') +param labels resourceInput<'Microsoft.Edge/sites@2025-03-01-preview'>.properties.labels? + +@sys.description('Required. The physical address configuration of the site.') +param siteAddress resourceInput<'Microsoft.Edge/sites@2025-03-01-preview'>.properties.siteAddress + +// ============== // +// Resources // +// ============== // + +#disable-next-line no-deployments-resources +resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) { + name: '46d3xbcp.res.edge-site_rgscope.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + outputs: { + telemetry: { + type: 'String' + value: 'For more information, see https://aka.ms/avm/TelemetryInfo' + } + } + } + } +} + +resource site 'Microsoft.Edge/sites@2025-03-01-preview' = { + name: name + properties: { + description: description + displayName: displayName + labels: labels + siteAddress: siteAddress + } +} + +// ============ // +// Outputs // +// ============ // + +@sys.description('The resource ID of the site.') +output resourceId string = site.id + +@sys.description('The name of the site.') +output name string = site.name + +@sys.description('The location the resource was deployed into.') +output location string = location + +@sys.description('The name of the resource group the role assignment was applied at.') +output resourceGroupName string = resourceGroup().name diff --git a/avm/res/edge/site/rg-scope/main.json b/avm/res/edge/site/rg-scope/main.json new file mode 100644 index 00000000000..7f1564d882e --- /dev/null +++ b/avm/res/edge/site/rg-scope/main.json @@ -0,0 +1,132 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.37.4.10188", + "templateHash": "17434893961263519931" + }, + "name": "Microsoft Edge Site Resources", + "description": "Resource group scoped resources for Microsoft Edge Site." + }, + "parameters": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the resource to create." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Optional. Location for all Resources." + } + }, + "enableTelemetry": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Optional. Enable/Disable usage telemetry for module." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The description of the site." + } + }, + "displayName": { + "type": "string", + "defaultValue": "[parameters('name')]", + "metadata": { + "description": "Optional. The display name of the site." + } + }, + "labels": { + "type": "object", + "metadata": { + "__bicep_resource_derived_type!": { + "source": "Microsoft.Edge/sites@2025-03-01-preview#properties/properties/properties/labels" + }, + "description": "Optional. Labels for the site." + }, + "nullable": true + }, + "siteAddress": { + "type": "object", + "metadata": { + "__bicep_resource_derived_type!": { + "source": "Microsoft.Edge/sites@2025-03-01-preview#properties/properties/properties/siteAddress" + }, + "description": "Required. The physical address configuration of the site." + } + } + }, + "resources": { + "avmTelemetry": { + "condition": "[parameters('enableTelemetry')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2024-03-01", + "name": "[format('46d3xbcp.res.edge-site_rgscope.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [], + "outputs": { + "telemetry": { + "type": "String", + "value": "For more information, see https://aka.ms/avm/TelemetryInfo" + } + } + } + } + }, + "site": { + "type": "Microsoft.Edge/sites", + "apiVersion": "2025-03-01-preview", + "name": "[parameters('name')]", + "properties": { + "description": "[parameters('description')]", + "displayName": "[parameters('displayName')]", + "labels": "[parameters('labels')]", + "siteAddress": "[parameters('siteAddress')]" + } + } + }, + "outputs": { + "resourceId": { + "type": "string", + "metadata": { + "description": "The resource ID of the site." + }, + "value": "[resourceId('Microsoft.Edge/sites', parameters('name'))]" + }, + "name": { + "type": "string", + "metadata": { + "description": "The name of the site." + }, + "value": "[parameters('name')]" + }, + "location": { + "type": "string", + "metadata": { + "description": "The location the resource was deployed into." + }, + "value": "[parameters('location')]" + }, + "resourceGroupName": { + "type": "string", + "metadata": { + "description": "The name of the resource group the role assignment was applied at." + }, + "value": "[resourceGroup().name]" + } + } +} \ No newline at end of file diff --git a/avm/res/edge/site/rg-scope/version.json b/avm/res/edge/site/rg-scope/version.json new file mode 100644 index 00000000000..f077f1c7fe8 --- /dev/null +++ b/avm/res/edge/site/rg-scope/version.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://aka.ms/bicep-registry-module-version-file-schema#", + "version": "0.1" +} diff --git a/avm/res/edge/site/sub-scope/CHANGELOG.md b/avm/res/edge/site/sub-scope/CHANGELOG.md new file mode 100644 index 00000000000..0c9f1bdf010 --- /dev/null +++ b/avm/res/edge/site/sub-scope/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/edge/site/sub-scope/CHANGELOG.md). + +## 0.1.0 + +### Changes + +- Initial version + +### Breaking Changes + +- None diff --git a/avm/res/edge/site/sub-scope/README.md b/avm/res/edge/site/sub-scope/README.md new file mode 100644 index 00000000000..6b5704d72ba --- /dev/null +++ b/avm/res/edge/site/sub-scope/README.md @@ -0,0 +1,315 @@ +# Microsoft Edge Site Resources `[Microsoft.Edge/sites]` + +Subscription scoped resources for Microsoft Edge Site. + +## Navigation + +- [Resource Types](#Resource-Types) +- [Usage examples](#Usage-examples) +- [Parameters](#Parameters) +- [Outputs](#Outputs) +- [Data Collection](#Data-Collection) + +## Resource Types + +| Resource Type | API Version | References | +| :-- | :-- | :-- | +| `Microsoft.Edge/sites` | 2025-03-01-preview |

| + +## Usage examples + +The following section provides usage examples for the module, which were used to validate and deploy the module successfully. For a full reference, please review the module's test folder in its repository. + +>**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. + +>**Note**: To reference the module, please use the following syntax `br/public:avm/res/edge/site/sub-scope:`. + +- [Using subscription scope deployment](#example-1-using-subscription-scope-deployment) +- [Using subscription scope deployment](#example-2-using-subscription-scope-deployment) + +### Example 1: _Using subscription scope deployment_ + +This instance deploys the module at subscription scope without requiring a resource group. + + +
+ +via Bicep module + +```bicep +module site 'br/public:avm/res/edge/site/sub-scope:' = { + name: 'siteDeployment' + params: { + // Required parameters + location: '' + name: 'essubmin001' + siteAddress: { + country: 'US' + } + // Non-required parameters + description: 'Edge site deployed at subscription scope' + displayName: 'Subscription-Scoped Edge Site' + } +} +``` + +
+

+ +

+ +via JSON parameters file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "location": { + "value": "" + }, + "name": { + "value": "essubmin001" + }, + "siteAddress": { + "value": { + "country": "US" + } + }, + // Non-required parameters + "description": { + "value": "Edge site deployed at subscription scope" + }, + "displayName": { + "value": "Subscription-Scoped Edge Site" + } + } +} +``` + +
+

+ +

+ +via Bicep parameters file + +```bicep-params +using 'br/public:avm/res/edge/site/sub-scope:' + +// Required parameters +param location = '' +param name = 'essubmin001' +param siteAddress = { + country: 'US' +} +// Non-required parameters +param description = 'Edge site deployed at subscription scope' +param displayName = 'Subscription-Scoped Edge Site' +``` + +
+

+ +### Example 2: _Using subscription scope deployment_ + +This instance deploys the module at subscription scope without requiring a resource group. + + +

+ +via Bicep module + +```bicep +module site 'br/public:avm/res/edge/site/sub-scope:' = { + name: 'siteDeployment' + params: { + // Required parameters + location: '' + name: 'essubwaf001' + siteAddress: { + city: 'New York' + country: 'US' + postalCode: '10001' + stateOrProvince: 'New York' + streetAddress1: '350 Fifth Avenue' + streetAddress2: 'Floor 34' + } + // Non-required parameters + description: 'Test edge site for region deployment' + displayName: 'Test Edge Site' + labels: { + businessUnit: 'IT' + costCenter: 'CC-1234' + environment: 'test' + project: 'EdgeDeployment' + } + } +} +``` + +
+

+ +

+ +via JSON parameters file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "location": { + "value": "" + }, + "name": { + "value": "essubwaf001" + }, + "siteAddress": { + "value": { + "city": "New York", + "country": "US", + "postalCode": "10001", + "stateOrProvince": "New York", + "streetAddress1": "350 Fifth Avenue", + "streetAddress2": "Floor 34" + } + }, + // Non-required parameters + "description": { + "value": "Test edge site for region deployment" + }, + "displayName": { + "value": "Test Edge Site" + }, + "labels": { + "value": { + "businessUnit": "IT", + "costCenter": "CC-1234", + "environment": "test", + "project": "EdgeDeployment" + } + } + } +} +``` + +
+

+ +

+ +via Bicep parameters file + +```bicep-params +using 'br/public:avm/res/edge/site/sub-scope:' + +// Required parameters +param location = '' +param name = 'essubwaf001' +param siteAddress = { + city: 'New York' + country: 'US' + postalCode: '10001' + stateOrProvince: 'New York' + streetAddress1: '350 Fifth Avenue' + streetAddress2: 'Floor 34' +} +// Non-required parameters +param description = 'Test edge site for region deployment' +param displayName = 'Test Edge Site' +param labels = { + businessUnit: 'IT' + costCenter: 'CC-1234' + environment: 'test' + project: 'EdgeDeployment' +} +``` + +
+

+ +## Parameters + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`location`](#parameter-location) | string | Location for all Resources. | +| [`name`](#parameter-name) | string | Name of the resource to create. | +| [`siteAddress`](#parameter-siteaddress) | object | The physical address configuration of the site. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`description`](#parameter-description) | string | The description of the site. | +| [`displayName`](#parameter-displayname) | string | The display name of the site. | +| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. | +| [`labels`](#parameter-labels) | object | Labels for the site. | + +### Parameter: `location` + +Location for all Resources. + +- Required: Yes +- Type: string + +### Parameter: `name` + +Name of the resource to create. + +- Required: Yes +- Type: string + +### Parameter: `siteAddress` + +The physical address configuration of the site. + +- Required: Yes +- Type: object + +### Parameter: `description` + +The description of the site. + +- Required: No +- Type: string + +### Parameter: `displayName` + +The display name of the site. + +- Required: No +- Type: string +- Default: `[parameters('name')]` + +### Parameter: `enableTelemetry` + +Enable/Disable usage telemetry for module. + +- Required: No +- Type: bool +- Default: `True` + +### Parameter: `labels` + +Labels for the site. + +- Required: No +- Type: object + +## Outputs + +| Output | Type | Description | +| :-- | :-- | :-- | +| `location` | string | The location the resource was deployed into. | +| `name` | string | The name of the site. | +| `resourceId` | string | The resource ID of the site. | + +## Data Collection + +The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. diff --git a/avm/res/edge/site/sub-scope/main.bicep b/avm/res/edge/site/sub-scope/main.bicep new file mode 100644 index 00000000000..2bd986abd07 --- /dev/null +++ b/avm/res/edge/site/sub-scope/main.bicep @@ -0,0 +1,77 @@ +targetScope = 'subscription' + +metadata name = 'Microsoft Edge Site Resources' +metadata description = 'Subscription scoped resources for Microsoft Edge Site.' + +// ============== // +// Parameters // +// ============== // + +@sys.description('Required. Name of the resource to create.') +param name string + +@sys.description('Required. Location for all Resources.') +param location string + +@sys.description('Optional. Enable/Disable usage telemetry for module.') +param enableTelemetry bool = true + +@sys.description('Optional. The description of the site.') +param description string? + +@sys.description('Optional. The display name of the site.') +param displayName string = name + +@sys.description('Optional. Labels for the site.') +param labels resourceInput<'Microsoft.Edge/sites@2025-03-01-preview'>.properties.labels? + +@sys.description('Required. The physical address configuration of the site.') +param siteAddress resourceInput<'Microsoft.Edge/sites@2025-03-01-preview'>.properties.siteAddress + +// ============== // +// Resources // +// ============== // + +#disable-next-line no-deployments-resources +resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) { + name: '46d3xbcp.res.edge-site_subscope.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}' + location: location + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + outputs: { + telemetry: { + type: 'String' + value: 'For more information, see https://aka.ms/avm/TelemetryInfo' + } + } + } + } +} + +// Deploy Edge Site at subscription scope +resource site 'Microsoft.Edge/sites@2025-03-01-preview' = { + name: name + properties: { + description: description + displayName: displayName + labels: labels + siteAddress: siteAddress + } +} + +// ============ // +// Outputs // +// ============ // + +@sys.description('The resource ID of the site.') +output resourceId string = site.id + +@sys.description('The name of the site.') +output name string = site.name + +@sys.description('The location the resource was deployed into.') +output location string = location diff --git a/avm/res/edge/site/sub-scope/main.json b/avm/res/edge/site/sub-scope/main.json new file mode 100644 index 00000000000..9514cce5cca --- /dev/null +++ b/avm/res/edge/site/sub-scope/main.json @@ -0,0 +1,125 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "languageVersion": "2.0", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.37.4.10188", + "templateHash": "10110123724688272413" + }, + "name": "Microsoft Edge Site Resources", + "description": "Subscription scoped resources for Microsoft Edge Site." + }, + "parameters": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the resource to create." + } + }, + "location": { + "type": "string", + "metadata": { + "description": "Required. Location for all Resources." + } + }, + "enableTelemetry": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Optional. Enable/Disable usage telemetry for module." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The description of the site." + } + }, + "displayName": { + "type": "string", + "defaultValue": "[parameters('name')]", + "metadata": { + "description": "Optional. The display name of the site." + } + }, + "labels": { + "type": "object", + "metadata": { + "__bicep_resource_derived_type!": { + "source": "Microsoft.Edge/sites@2025-03-01-preview#properties/properties/properties/labels" + }, + "description": "Optional. Labels for the site." + }, + "nullable": true + }, + "siteAddress": { + "type": "object", + "metadata": { + "__bicep_resource_derived_type!": { + "source": "Microsoft.Edge/sites@2025-03-01-preview#properties/properties/properties/siteAddress" + }, + "description": "Required. The physical address configuration of the site." + } + } + }, + "resources": { + "avmTelemetry": { + "condition": "[parameters('enableTelemetry')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2024-03-01", + "name": "[format('46d3xbcp.res.edge-site_subscope.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]", + "location": "[parameters('location')]", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [], + "outputs": { + "telemetry": { + "type": "String", + "value": "For more information, see https://aka.ms/avm/TelemetryInfo" + } + } + } + } + }, + "site": { + "type": "Microsoft.Edge/sites", + "apiVersion": "2025-03-01-preview", + "name": "[parameters('name')]", + "properties": { + "description": "[parameters('description')]", + "displayName": "[parameters('displayName')]", + "labels": "[parameters('labels')]", + "siteAddress": "[parameters('siteAddress')]" + } + } + }, + "outputs": { + "resourceId": { + "type": "string", + "metadata": { + "description": "The resource ID of the site." + }, + "value": "[subscriptionResourceId('Microsoft.Edge/sites', parameters('name'))]" + }, + "name": { + "type": "string", + "metadata": { + "description": "The name of the site." + }, + "value": "[parameters('name')]" + }, + "location": { + "type": "string", + "metadata": { + "description": "The location the resource was deployed into." + }, + "value": "[parameters('location')]" + } + } +} \ No newline at end of file diff --git a/avm/res/edge/site/sub-scope/version.json b/avm/res/edge/site/sub-scope/version.json new file mode 100644 index 00000000000..f077f1c7fe8 --- /dev/null +++ b/avm/res/edge/site/sub-scope/version.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://aka.ms/bicep-registry-module-version-file-schema#", + "version": "0.1" +} diff --git a/avm/res/edge/site/tests/e2e/rg-scope.defaults/main.test.bicep b/avm/res/edge/site/tests/e2e/rg-scope.defaults/main.test.bicep new file mode 100644 index 00000000000..aad90032b33 --- /dev/null +++ b/avm/res/edge/site/tests/e2e/rg-scope.defaults/main.test.bicep @@ -0,0 +1,45 @@ +targetScope = 'subscription' + +metadata name = 'Using only defaults' +metadata description = 'This instance deploys the module with the minimum set of required parameters.' + +// ========== // +// Parameters // +// ========== // + +@description('Optional. The name of the resource group to deploy for testing purposes.') +@maxLength(90) +param resourceGroupName string = 'dep-${namePrefix}-edge.site-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to.') +param resourceLocation string = deployment().location + +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') +param serviceShort string = 'esrgmin' + +@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.') +param namePrefix string = '#_namePrefix_#' + +resource resourceGroup 'Microsoft.Resources/resourceGroups@2024-11-01' = { + name: resourceGroupName + location: resourceLocation +} + +// ============== // +// Test Execution // +// ============== // + +@batchSize(1) +module testDeployment '../../../rg-scope/main.bicep' = [ + for iteration in ['init', 'idem']: { + name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + params: { + name: '${namePrefix}${serviceShort}001' + location: resourceLocation + siteAddress: { + country: 'US' + } + } + scope: resourceGroup + } +] diff --git a/avm/res/edge/site/tests/e2e/rg-scope.waf-aligned/main.test.bicep b/avm/res/edge/site/tests/e2e/rg-scope.waf-aligned/main.test.bicep new file mode 100644 index 00000000000..9abbd5f9327 --- /dev/null +++ b/avm/res/edge/site/tests/e2e/rg-scope.waf-aligned/main.test.bicep @@ -0,0 +1,58 @@ +targetScope = 'subscription' + +metadata name = 'Using Well-Architected Framework aligned parameters' +metadata description = 'This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.' + +// ========== // +// Parameters // +// ========== // + +@description('Optional. The name of the resource group to deploy for testing purposes.') +@maxLength(90) +param resourceGroupName string = 'dep-${namePrefix}-edge.site-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to.') +param resourceLocation string = deployment().location + +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') +param serviceShort string = 'esrgwaf' + +@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.') +param namePrefix string = '#_namePrefix_#' + +resource resourceGroup 'Microsoft.Resources/resourceGroups@2024-11-01' = { + name: resourceGroupName + location: resourceLocation +} + +// ============== // +// Test Execution // +// ============== // + +@batchSize(1) +module testDeployment '../../../rg-scope/main.bicep' = [ + for iteration in ['init', 'idem']: { + name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + scope: resourceGroup + params: { + name: '${namePrefix}${serviceShort}001' + location: resourceLocation + displayName: 'Test Edge Site' + description: 'Test edge site for region deployment' + siteAddress: { + city: 'New York' + country: 'US' + postalCode: '10001' + stateOrProvince: 'New York' + streetAddress1: '350 Fifth Avenue' + streetAddress2: 'Floor 34' + } + labels: { + environment: 'test' + businessUnit: 'IT' + costCenter: 'CC-1234' + project: 'EdgeDeployment' + } + } + } +] diff --git a/avm/res/edge/site/tests/e2e/sub-scope.defaults/main.test.bicep b/avm/res/edge/site/tests/e2e/sub-scope.defaults/main.test.bicep new file mode 100644 index 00000000000..fff51752cdf --- /dev/null +++ b/avm/res/edge/site/tests/e2e/sub-scope.defaults/main.test.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +metadata name = 'Using subscription scope deployment' +metadata description = 'This instance deploys the module at subscription scope without requiring a resource group.' + +// ========== // +// Parameters // +// ========== // + +@description('Optional. The location to deploy resources to.') +param resourceLocation string = deployment().location + +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') +param serviceShort string = 'essubmin' + +@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.') +param namePrefix string = '#_namePrefix_#' + +// ============== // +// Test Execution // +// ============== // + +@batchSize(1) +module testDeployment '../../../sub-scope/main.bicep' = [ + for iteration in ['init', 'idem']: { + name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + params: { + name: '${namePrefix}${serviceShort}001' + location: resourceLocation + displayName: 'Subscription-Scoped Edge Site' + description: 'Edge site deployed at subscription scope' + siteAddress: { + country: 'US' + } + } + } +] diff --git a/avm/res/edge/site/tests/e2e/sub-scope.waf-aligned/main.test.bicep b/avm/res/edge/site/tests/e2e/sub-scope.waf-aligned/main.test.bicep new file mode 100644 index 00000000000..026575d11ce --- /dev/null +++ b/avm/res/edge/site/tests/e2e/sub-scope.waf-aligned/main.test.bicep @@ -0,0 +1,48 @@ +targetScope = 'subscription' + +metadata name = 'Using subscription scope deployment' +metadata description = 'This instance deploys the module at subscription scope without requiring a resource group.' + +// ========== // +// Parameters // +// ========== // + +@description('Optional. The location to deploy resources to.') +param resourceLocation string = deployment().location + +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') +param serviceShort string = 'essubwaf' + +@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.') +param namePrefix string = '#_namePrefix_#' + +// ============== // +// Test Execution // +// ============== // + +@batchSize(1) +module testDeployment '../../../sub-scope/main.bicep' = [ + for iteration in ['init', 'idem']: { + name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + params: { + name: '${namePrefix}${serviceShort}001' + location: resourceLocation + displayName: 'Test Edge Site' + description: 'Test edge site for region deployment' + siteAddress: { + city: 'New York' + country: 'US' + postalCode: '10001' + stateOrProvince: 'New York' + streetAddress1: '350 Fifth Avenue' + streetAddress2: 'Floor 34' + } + labels: { + environment: 'test' + businessUnit: 'IT' + costCenter: 'CC-1234' + project: 'EdgeDeployment' + } + } + } +] diff --git a/utilities/pipelines/staticValidation/compliance/helper/child-module-publish-allowed-list.json b/utilities/pipelines/staticValidation/compliance/helper/child-module-publish-allowed-list.json index 3ba7d5d291c..8c76b442515 100644 --- a/utilities/pipelines/staticValidation/compliance/helper/child-module-publish-allowed-list.json +++ b/utilities/pipelines/staticValidation/compliance/helper/child-module-publish-allowed-list.json @@ -3,6 +3,8 @@ "avm/res/authorization/role-assignment/mg-scope", "avm/res/authorization/role-assignment/sub-scope", "avm/res/authorization/role-assignment/rg-scope", + "avm/res/edge/site/sub-scope", + "avm/res/edge/site/rg-scope", "avm/res/key-vault/vault/access-policy", "avm/res/key-vault/vault/key", "avm/res/key-vault/vault/secret", @@ -20,4 +22,4 @@ "avm/res/web/site/config", "avm/res/web/site/slot" ] -} \ No newline at end of file +}