Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hundredacres authored Jul 8, 2024
2 parents 3e307bd + 9fe3ea3 commit f589c3b
Show file tree
Hide file tree
Showing 358 changed files with 15,279 additions and 6,685 deletions.
296 changes: 149 additions & 147 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/avm_module_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ body:
# - "avm/ptn/avd-lza/management-plane"
# - "avm/ptn/avd-lza/networking"
# - "avm/ptn/avd-lza/session-hosts"
- "avm/ptn/deployment-script/import-image-to-acr"
- "avm/ptn/finops-toolkit/finops-hub"
- "avm/ptn/lz/sub-vending"
- "avm/ptn/network/private-link-private-dns-zones"
- "avm/ptn/policy-insights/remediation"
- "avm/ptn/security/security-center"
- "avm/res/aad/domain-service"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: "avm.ptn.deployment-script.import-image-to-acr"

on:
schedule:
- cron: "0 12 1/15 * *" # Bi-Weekly Test (on 1st & 15th of month)
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.ptn.deployment-script.import-image-to-acr.yml"
- "avm/ptn/deployment-script/import-image-to-acr/**"
- "avm/utilities/pipelines/**"
- "!avm/utilities/pipelines/platform/**"
- "!*/**/README.md"

env:
modulePath: "avm/ptn/deployment-script/import-image-to-acr"
workflowPath: ".github/workflows/avm.ptn.deployment-script.import-image-to-acr.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
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: "avm.ptn.network.private-link-private-dns-zones"

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.ptn.network.private-link-private-dns-zones.yml"
- "avm/ptn/network/private-link-private-dns-zones/**"
- "avm/utilities/pipelines/**"
- "!avm/utilities/pipelines/platform/**"
- "!*/**/README.md"

env:
modulePath: "avm/ptn/network/private-link-private-dns-zones"
workflowPath: ".github/workflows/avm.ptn.network.private-link-private-dns-zones.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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.encoding": "utf8bom",
"files.insertFinalNewline": true
"files.insertFinalNewline": true,
"editor.detectIndentation": false // VS Code will not detect indentation/tab/space from the file and use settings editor.insertSpaces and editor.tabSize instead
}
}
2 changes: 1 addition & 1 deletion avm/ptn/authorization/policy-assignment/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Policy Assignments (All scopes) `[Microsoft.Authorization/policyAssignments]`
# Policy Assignments (All scopes) `[Authorization/PolicyAssignment]`

This module deploys a Policy Assignment at a Management Group, Subscription or Resource Group scope.

Expand Down
32 changes: 26 additions & 6 deletions avm/ptn/authorization/policy-assignment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ param resourceSelectors array = []
@sys.description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: take('46d3xbcp.ptn.authorization-policyassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}', 64)
#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: take(
'46d3xbcp.ptn.authorization-policyassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}',
64
)
location: location
properties: {
mode: 'Incremental'
Expand Down Expand Up @@ -160,13 +164,29 @@ module policyAssignment_rg 'modules/resource-group.bicep' = if (!empty(resourceG
}

@sys.description('Policy Assignment Name.')
output name string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.name : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.name : policyAssignment_rg.outputs.name)
output name string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.name
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.name
: policyAssignment_rg.outputs.name)

@sys.description('Policy Assignment principal ID.')
output principalId string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.principalId : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.principalId : policyAssignment_rg.outputs.principalId)
output principalId string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.principalId
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.principalId
: policyAssignment_rg.outputs.principalId)

@sys.description('Policy Assignment resource ID.')
output resourceId string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.resourceId : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.resourceId : policyAssignment_rg.outputs.resourceId)
output resourceId string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.resourceId
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.resourceId
: policyAssignment_rg.outputs.resourceId)

@sys.description('The location the resource was deployed into.')
output location string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.location : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.location : policyAssignment_rg.outputs.location)
output location string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.location
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.location
: policyAssignment_rg.outputs.location)
18 changes: 9 additions & 9 deletions avm/ptn/authorization/policy-assignment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "3274497359181095240"
"version": "0.28.1.47646",
"templateHash": "7409207305186624461"
},
"name": "Policy Assignments (All scopes)",
"description": "This module deploys a Policy Assignment at a Management Group, Subscription or Resource Group scope.",
Expand Down Expand Up @@ -158,7 +158,7 @@
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"apiVersion": "2024-03-01",
"name": "[take(format('46d3xbcp.ptn.authorization-policyassignment.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4)), 64)]",
"location": "[parameters('location')]",
"properties": {
Expand Down Expand Up @@ -226,8 +226,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "15016174258473942920"
"version": "0.28.1.47646",
"templateHash": "10754608594936413857"
},
"name": "Policy Assignments (Management Group scope)",
"description": "This module deploys a Policy Assignment at a Management Group scope.",
Expand Down Expand Up @@ -481,8 +481,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "977404313320239280"
"version": "0.28.1.47646",
"templateHash": "14066444680843928013"
},
"name": "Policy Assignments (Subscription scope)",
"description": "This module deploys a Policy Assignment at a Subscription scope.",
Expand Down Expand Up @@ -736,8 +736,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "17106923564853756802"
"version": "0.28.1.47646",
"templateHash": "17693268287104969526"
},
"name": "Policy Assignments (Resource Group scope)",
"description": "This module deploys a Policy Assignment at a Resource Group scope.",
Expand Down
2 changes: 1 addition & 1 deletion avm/ptn/authorization/resource-role-assignment/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Resource-scoped role assignment `[Microsoft.Authorization/resourceroleassignment]`
# Resource-scoped role assignment `[Authorization/ResourceRoleAssignment]`

This module deploys a Role Assignment for a specific resource.

Expand Down
3 changes: 2 additions & 1 deletion avm/ptn/authorization/resource-role-assignment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ param enableTelemetry bool = true
// Definitions //
// =============== //

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: '46d3xbcp.ptn.authorization-resourceroleassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
Expand Down
8 changes: 4 additions & 4 deletions avm/ptn/authorization/resource-role-assignment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "17107961067773605935"
"version": "0.28.1.47646",
"templateHash": "17607291889971078318"
},
"name": "Resource-scoped role assignment",
"description": "This module deploys a Role Assignment for a specific resource.",
Expand Down Expand Up @@ -136,7 +136,7 @@
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.ptn.authorization-resourceroleassignment.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name), 0, 4))]",
"properties": {
"mode": "Incremental",
Expand Down Expand Up @@ -216,4 +216,4 @@
"value": "[resourceGroup().name]"
}
}
}
}
2 changes: 1 addition & 1 deletion avm/ptn/authorization/role-assignment/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Role Assignments (All scopes) `[Microsoft.Authorization/roleAssignments]`
# Role Assignments (All scopes) `[Authorization/RoleAssignment]`

This module deploys a Role Assignment at a Management Group, Subscription or Resource Group scope.

Expand Down
Loading

0 comments on commit f589c3b

Please sign in to comment.