-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make AddDependency public and use project ref for ease of testing (#4…
…3257) * Make AddDependency public and use project ref for ease of testing * Handle empty construct
- Loading branch information
1 parent
0e30d39
commit 3f4a495
Showing
18 changed files
with
293 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
sdk/provisioning/Azure.Provisioning/tests/Infrastructure/DependentResources/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
targetScope = 'resourceGroup' | ||
|
||
@description('') | ||
param location string = resourceGroup().location | ||
|
||
|
||
resource storageAccount_7EH24TZOS 'Microsoft.Storage/storageAccounts@2022-09-01' = { | ||
name: toLower(take('photoAcct${uniqueString(resourceGroup().id)}', 24)) | ||
location: location | ||
sku: { | ||
name: 'Premium_LRS' | ||
} | ||
kind: 'BlockBlobStorage' | ||
properties: { | ||
networkAcls: { | ||
defaultAction: 'Deny' | ||
} | ||
} | ||
} | ||
|
||
resource storageAccount_GoC2YPRJs 'Microsoft.Storage/storageAccounts@2022-09-01' = { | ||
dependsOn: [ | ||
storageAccount_7EH24TZOS | ||
] | ||
name: toLower(take('photoAcct2${uniqueString(resourceGroup().id)}', 24)) | ||
location: location | ||
sku: { | ||
name: 'Premium_LRS' | ||
} | ||
kind: 'BlockBlobStorage' | ||
properties: { | ||
networkAcls: { | ||
defaultAction: 'Deny' | ||
} | ||
} | ||
} |
Empty file.
15 changes: 15 additions & 0 deletions
15
...g/Azure.Provisioning/tests/Infrastructure/ExistingUserAssignedIdentityResource/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
targetScope = 'subscription' | ||
|
||
|
||
resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = { | ||
name: 'rg-TEST' | ||
location: 'westus' | ||
tags: { | ||
'azd-env-name': 'TEST' | ||
} | ||
} | ||
|
||
module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = { | ||
name: 'rg_TEST_module' | ||
scope: resourceGroup_I6QNkoPsb | ||
} |
4 changes: 4 additions & 0 deletions
4
...ucture/ExistingUserAssignedIdentityResource/resources/rg_TEST_module/rg_TEST_module.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
resource userAssignedIdentity_AHWXCnFeG 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = { | ||
name: 'existingUserAssignedIdentity' | ||
} |
59 changes: 59 additions & 0 deletions
59
...ovisioning/Azure.Provisioning/tests/Infrastructure/RoleAssignmentWithParameter/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
targetScope = 'resourceGroup' | ||
|
||
@description('') | ||
param location string = resourceGroup().location | ||
|
||
@description('') | ||
param principalId string | ||
|
||
|
||
resource storageAccount_7EH24TZOS 'Microsoft.Storage/storageAccounts@2022-09-01' = { | ||
name: toLower(take('photoAcct${uniqueString(resourceGroup().id)}', 24)) | ||
location: location | ||
sku: { | ||
name: 'Premium_LRS' | ||
} | ||
kind: 'BlockBlobStorage' | ||
properties: { | ||
networkAcls: { | ||
defaultAction: 'Deny' | ||
} | ||
} | ||
} | ||
|
||
resource blobService_7QL3qUuBS 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { | ||
parent: storageAccount_7EH24TZOS | ||
name: 'default' | ||
properties: { | ||
} | ||
} | ||
|
||
resource roleAssignment_NfInNFBlY 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_7EH24TZOS | ||
name: guid(storageAccount_7EH24TZOS.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') | ||
principalId: principalId | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource roleAssignment_cmAstwnTk 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_7EH24TZOS | ||
name: guid(storageAccount_7EH24TZOS.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88') | ||
principalId: principalId | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource roleAssignment_4GhzPkC6K 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_7EH24TZOS | ||
name: guid(storageAccount_7EH24TZOS.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'User' | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...sioning/Azure.Provisioning/tests/Infrastructure/RoleAssignmentWithoutParameter/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
targetScope = 'subscription' | ||
|
||
|
||
resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = { | ||
name: 'rg-TEST' | ||
location: 'westus' | ||
tags: { | ||
'azd-env-name': 'TEST' | ||
} | ||
} | ||
|
||
module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = { | ||
name: 'rg_TEST_module' | ||
scope: resourceGroup_I6QNkoPsb | ||
} |
51 changes: 51 additions & 0 deletions
51
...frastructure/RoleAssignmentWithoutParameter/resources/rg_TEST_module/rg_TEST_module.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
resource storageAccount_ZnnWSenAP 'Microsoft.Storage/storageAccounts@2022-09-01' = { | ||
name: toLower(take('photoAcct${uniqueString(resourceGroup().id)}', 24)) | ||
location: 'westus' | ||
sku: { | ||
name: 'Premium_LRS' | ||
} | ||
kind: 'BlockBlobStorage' | ||
properties: { | ||
networkAcls: { | ||
defaultAction: 'Deny' | ||
} | ||
} | ||
} | ||
|
||
resource blobService_wAcYakiP0 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { | ||
parent: storageAccount_ZnnWSenAP | ||
name: 'default' | ||
properties: { | ||
} | ||
} | ||
|
||
resource roleAssignment_q3YvdxEC7 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_ZnnWSenAP | ||
name: guid(storageAccount_ZnnWSenAP.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource roleAssignment_c4BGrZguw 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_ZnnWSenAP | ||
name: guid(storageAccount_ZnnWSenAP.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource roleAssignment_YUoGSZS0y 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_ZnnWSenAP | ||
name: guid(storageAccount_ZnnWSenAP.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'User' | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...rovisioning/tests/Infrastructure/RoleAssignmentWithoutParameterInteractiveMode/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
targetScope = 'resourceGroup' | ||
|
||
@description('') | ||
param location string = resourceGroup().location | ||
|
||
|
||
resource storageAccount_7EH24TZOS 'Microsoft.Storage/storageAccounts@2022-09-01' = { | ||
name: toLower(take('photoAcct${uniqueString(resourceGroup().id)}', 24)) | ||
location: location | ||
sku: { | ||
name: 'Premium_LRS' | ||
} | ||
kind: 'BlockBlobStorage' | ||
properties: { | ||
networkAcls: { | ||
defaultAction: 'Deny' | ||
} | ||
} | ||
} | ||
|
||
resource blobService_7QL3qUuBS 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { | ||
parent: storageAccount_7EH24TZOS | ||
name: 'default' | ||
properties: { | ||
} | ||
} | ||
|
||
resource roleAssignment_Xx3s4qhkk 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_7EH24TZOS | ||
name: guid(storageAccount_7EH24TZOS.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource roleAssignment_LfCpykUe9 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_7EH24TZOS | ||
name: guid(storageAccount_7EH24TZOS.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource roleAssignment_4GhzPkC6K 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
scope: storageAccount_7EH24TZOS | ||
name: guid(storageAccount_7EH24TZOS.id, '00000000-0000-0000-0000-000000000000', subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3') | ||
principalId: '00000000-0000-0000-0000-000000000000' | ||
principalType: 'User' | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
sdk/provisioning/Azure.Provisioning/tests/Infrastructure/UserAssignedIdentities/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
targetScope = 'resourceGroup' | ||
|
||
@description('') | ||
param location string = resourceGroup().location | ||
|
||
|
||
resource userAssignedIdentity_gswVmGJeD 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
name: toLower(take('useridentity${uniqueString(resourceGroup().id)}', 24)) | ||
location: location | ||
properties: { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters