Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new module avm/res/synapse/workspace #914

Merged
merged 61 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
4b3d3d8
synapse wks draft
elanzel Jan 26, 2024
8e2a043
readme update
elanzel Jan 26, 2024
53454b9
workflow
elanzel Jan 26, 2024
497fd44
orphaned
elanzel Jan 26, 2024
ae7db52
param update
elanzel Jan 26, 2024
f464cb6
codeowners, psrule
elanzel Jan 26, 2024
0643d1e
tags
elanzel Jan 26, 2024
5f99d2f
Merge branch 'Azure:main' into synapse-workspace
elanzel Jan 30, 2024
e491c55
issue template update
elanzel Jan 30, 2024
ff807fe
workspace endpoint
elanzel Feb 1, 2024
698b3e5
conditional changed
elanzel Feb 1, 2024
1ad2b08
readme update
elanzel Feb 1, 2024
bc0a4b5
Merge branch 'Azure:main' into synapse-workspace
elanzel Feb 1, 2024
391fff9
synapse workspace module
elanzel Feb 1, 2024
14b3f9d
location
elanzel Feb 2, 2024
0e71ae9
dot end
elanzel Feb 2, 2024
a769e0f
readme
elanzel Feb 2, 2024
903277c
s to S
elanzel Feb 2, 2024
5d5a6ff
waf tags
elanzel Feb 2, 2024
43ab977
readme update
elanzel Feb 2, 2024
17f5367
Update .github/workflows/avm.res.synapse.workspace.yml
elanzel Feb 5, 2024
bdd5cf5
Update .github/workflows/avm.res.synapse.workspace.yml
elanzel Feb 5, 2024
3b312c6
Merge branch 'main' into synapse-workspace
elanzel Feb 5, 2024
6ef2e5e
draft plhub
elanzel Feb 5, 2024
78c7ffd
workflow
elanzel Feb 5, 2024
1374404
Merge pull request #4 from elanzel/synapse/private-link-hub
elanzel Feb 5, 2024
c426d7c
Merge branch 'Azure:main' into main
elanzel Feb 5, 2024
4f0bbac
Update avm/res/synapse/workspace/main.bicep
elanzel Feb 6, 2024
954bbdc
test with secret
elanzel Feb 6, 2024
c6ee10c
Merge branch 'main' into synapse-workspace
elanzel Feb 6, 2024
051040f
readme update
elanzel Feb 6, 2024
422aa94
resourceLocation
elanzel Feb 6, 2024
e8e55a6
remoed private link hub from branch
elanzel Feb 6, 2024
b611922
prettify
elanzel Feb 7, 2024
61ad559
Merge branch 'main' into synapse-workspace
elanzel Feb 7, 2024
d559bde
codeowners alphabetical order
elanzel Feb 8, 2024
d3e3fcb
reverting alphabetical mistake for test
elanzel Feb 9, 2024
e67fd3c
roll back
elanzel Feb 9, 2024
a2c3163
removed managed identity
elanzel Feb 9, 2024
b26409c
removed managed identity
elanzel Feb 9, 2024
0003fd9
initialworkspaceadmin needed
elanzel Feb 9, 2024
d483f0c
removed workspace identity
elanzel Feb 9, 2024
6afbbf0
rbac
elanzel Feb 9, 2024
b18afdd
roles
elanzel Feb 9, 2024
e07103c
main fix
elanzel Feb 9, 2024
790624e
test only max
elanzel Feb 9, 2024
d327a8e
restored identity block
elanzel Feb 12, 2024
b1aa190
removed secret
elanzel Feb 12, 2024
b86cd0c
Merge branch 'main' to synapse-workspace
elanzel Feb 12, 2024
a670d12
restore main to 422aa94
elanzel Feb 12, 2024
aee35ed
waf-aligned
elanzel Feb 12, 2024
afff3dc
managed identity removed from waf
elanzel Feb 12, 2024
63f0a90
test no identity
elanzel Feb 13, 2024
77916f0
all tests
elanzel Feb 13, 2024
efacc46
Merge branch 'main' into synapse-workspace
elanzel Feb 13, 2024
0a92758
Merge branch 'main' into synapse-workspace
elanzel Feb 13, 2024
668d6a6
Merge branch 'main' into synapse-workspace
eriqua Feb 15, 2024
3741cc1
Merge branch 'main' into synapse-workspace
AlexanderSehr Feb 15, 2024
6f74692
Update avm/res/synapse/workspace/tests/e2e/encrwuai/main.test.bicep
elanzel Feb 15, 2024
4850d15
Update avm/res/synapse/workspace/tests/e2e/managedvnet/main.test.bicep
elanzel Feb 15, 2024
9ba052b
readme update
elanzel Feb 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
567 changes: 563 additions & 4 deletions avm/res/synapse/workspace/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions avm/res/synapse/workspace/integration-runtime/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "5925144887906209420"
"version": "0.25.53.49325",
"templateHash": "7739107907804712060"
},
"name": "Synapse Workspace Integration Runtimes",
"description": "This module deploys a Synapse Workspace Integration Runtime.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/synapse/workspace/key/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "15811131631744837887"
"version": "0.25.53.49325",
"templateHash": "2498604793784722860"
},
"name": "Synapse Workspaces Keys",
"description": "This module deploys a Synapse Workspaces Key.",
Expand Down
5 changes: 0 additions & 5 deletions avm/res/synapse/workspace/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@ resource workspace 'Microsoft.Synapse/workspaces@2021-06-01' = {
} : {
useSystemAssignedIdentity: empty(customerManagedKey.?userAssignedIdentityResourceId)
}

identity: !empty(customerManagedKey.?userAssignedIdentityResourceId) ? {
userAssignedIdentity: cMKUserAssignedIdentity.id
} : null

key: {
keyVaultUrl: cMKKeyVault::cMKKey.properties.keyUri
name: customerManagedKey!.keyName
Expand Down
20 changes: 10 additions & 10 deletions avm/res/synapse/workspace/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "9888573987770649830"
"version": "0.25.53.49325",
"templateHash": "13895345816421777976"
},
"name": "Synapse Workspaces",
"description": "This module deploys a Synapse Workspace.",
Expand Down Expand Up @@ -557,7 +557,7 @@
}
},
"sqlAdministratorLoginPassword": {
"type": "string",
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "Optional. Password for administrator access to the workspace's SQL pools. If you don't provide a password, one will be automatically generated. You can change the password later."
Expand Down Expand Up @@ -685,7 +685,7 @@
"filesystem": "[parameters('defaultDataLakeStorageFilesystem')]",
"createManagedPrivateEndpoint": "[if(parameters('managedVirtualNetwork'), parameters('defaultDataLakeStorageCreateManagedPrivateEndpoint'), null())]"
},
"encryption": "[if(not(empty(parameters('customerManagedKey'))), createObject('cmk', createObject('kekIdentity', if(not(empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'))), createObject('userAssignedIdentity', extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '//'), '/')[2], split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '////'), '/')[4]), 'Microsoft.ManagedIdentity/userAssignedIdentities', last(split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), 'dummyMsi'), '/')))), createObject('useSystemAssignedIdentity', empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId')))), 'identity', if(not(empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'))), createObject('userAssignedIdentity', extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '//'), '/')[2], split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '////'), '/')[4]), 'Microsoft.ManagedIdentity/userAssignedIdentities', last(split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), 'dummyMsi'), '/')))), null()), 'key', createObject('keyVaultUrl', reference('cMKKeyVault::cMKKey').keyUri, 'name', parameters('customerManagedKey').keyName))), null())]",
"encryption": "[if(not(empty(parameters('customerManagedKey'))), createObject('cmk', createObject('kekIdentity', if(not(empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'))), createObject('userAssignedIdentity', extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '//'), '/')[2], split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '////'), '/')[4]), 'Microsoft.ManagedIdentity/userAssignedIdentities', last(split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), 'dummyMsi'), '/')))), createObject('useSystemAssignedIdentity', empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId')))), 'key', createObject('keyVaultUrl', reference('cMKKeyVault::cMKKey').keyUri, 'name', parameters('customerManagedKey').keyName))), null())]",
"managedResourceGroupName": "[if(not(empty(parameters('managedResourceGroupName'))), parameters('managedResourceGroupName'), null())]",
"managedVirtualNetwork": "[if(parameters('managedVirtualNetwork'), 'default', null())]",
"managedVirtualNetworkSettings": "[if(parameters('managedVirtualNetwork'), createObject('allowedAadTenantIdsForLinking', parameters('allowedAadTenantIdsForLinking'), 'linkedAccessCheckOnTargetResource', parameters('linkedAccessCheckOnTargetResource'), 'preventDataExfiltration', parameters('preventDataExfiltration')), null())]",
Expand Down Expand Up @@ -789,8 +789,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "5925144887906209420"
"version": "0.25.53.49325",
"templateHash": "7739107907804712060"
},
"name": "Synapse Workspace Integration Runtimes",
"description": "This module deploys a Synapse Workspace Integration Runtime.",
Expand Down Expand Up @@ -887,8 +887,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "17058954208193213785"
"version": "0.25.53.49325",
"templateHash": "16862202180408198277"
}
},
"parameters": {
Expand Down Expand Up @@ -975,8 +975,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "15811131631744837887"
"version": "0.25.53.49325",
"templateHash": "2498604793784722860"
},
"name": "Synapse Workspaces Keys",
"description": "This module deploys a Synapse Workspaces Key.",
Expand Down
31 changes: 31 additions & 0 deletions avm/res/synapse/workspace/tests/e2e/defaults/dependencies.bicep
AlexanderSehr marked this conversation as resolved.
Outdated
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@description('Optional. The location to deploy to.')
param location string = resourceGroup().location

@description('Required. The name of the Storage Account to create.')
param storageAccountName string

resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
isHnsEnabled: true
}

resource blobService 'blobServices@2022-09-01' = {
name: 'default'

resource container 'containers@2022-09-01' = {
name: 'synapsews'
}
}
}

@description('The resource ID of the created Storage Account.')
output storageAccountResourceId string = storageAccount.id

@description('The name of the created container.')
output storageContainerName string = storageAccount::blobService::container.name
58 changes: 58 additions & 0 deletions avm/res/synapse/workspace/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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}-synapse.workspaces-${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 = 'swmin'

@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

// ============ //
// Dependencies //
// ============ //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = {
name: resourceGroupName
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: resourceLocation
storageAccountName: 'dep${namePrefix}sa${serviceShort}01'
}
}

// ============== //
// Test Execution //
// ============== //

@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: resourceLocation
defaultDataLakeStorageAccountResourceId: nestedDependencies.outputs.storageAccountResourceId
defaultDataLakeStorageFilesystem: nestedDependencies.outputs.storageContainerName
sqlAdministratorLogin: 'synwsadmin'
}
}]
66 changes: 66 additions & 0 deletions avm/res/synapse/workspace/tests/e2e/encrwsai/dependencies.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@description('Optional. The location to deploy to.')
param location string = resourceGroup().location

@description('Required. The name of the Key Vault to create.')
param keyVaultName string

@description('Required. The name of the Storage Account to create.')
param storageAccountName string

resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: keyVaultName
location: location
properties: {
sku: {
family: 'A'
name: 'standard'
}
tenantId: tenant().tenantId
enablePurgeProtection: true
softDeleteRetentionInDays: 7
enabledForTemplateDeployment: true
enabledForDiskEncryption: true
enabledForDeployment: true
enableRbacAuthorization: true
accessPolicies: []
}

resource key 'keys@2022-07-01' = {
name: 'keyEncryptionKey'
properties: {
kty: 'RSA'
}
}
}

resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
isHnsEnabled: true
}

resource blobService 'blobServices@2022-09-01' = {
name: 'default'

resource container 'containers@2022-09-01' = {
name: 'synapsews'
}
}
}

@description('The resource ID of the created Key Vault.')
output keyVaultResourceId string = keyVault.id

@description('The name of the Key Vault Encryption Key.')
output keyVaultEncryptionKeyName string = keyVault::key.name

@description('The resource ID of the created Storage Account.')
output storageAccountResourceId string = storageAccount.id

@description('The name of the created container.')
output storageContainerName string = storageAccount::blobService::container.name
69 changes: 69 additions & 0 deletions avm/res/synapse/workspace/tests/e2e/encrwsai/main.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
targetScope = 'subscription'

metadata name = 'Using encryption with Customer-Managed-Key'
metadata description = 'This instance deploys the module using Customer-Managed-Keys using a System-Assigned Identity to access the Customer-Managed-Key secret.'


// ========== //
// Parameters //
// ========== //

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-synapse.workspaces-${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 = 'swensa'

@description('Generated. Used as a basis for unique resource names.')
param baseTime string = utcNow('u')

@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

// ============ //
// Dependencies //
// ============ //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = {
name: resourceGroupName
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
// Adding base time to make the name unique as purge protection must be enabled (but may not be longer than 24 characters total)
keyVaultName: 'dep-${namePrefix}-kv-${serviceShort}-${substring(uniqueString(baseTime), 0, 3)}'
storageAccountName: 'dep${namePrefix}sa${serviceShort}01'
location: resourceLocation
}
}

// ============== //
// Test Execution //
// ============== //

@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
defaultDataLakeStorageAccountResourceId: nestedDependencies.outputs.storageAccountResourceId
defaultDataLakeStorageFilesystem: nestedDependencies.outputs.storageContainerName
sqlAdministratorLogin: 'synwsadmin'
customerManagedKey: {
keyName: nestedDependencies.outputs.keyVaultEncryptionKeyName
keyVaultResourceId: nestedDependencies.outputs.keyVaultResourceId
}
encryptionActivateWorkspace: true
location: resourceLocation
}
}]
Loading
Loading