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

16989: Add bicep sample code #355

Merged
merged 6 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Baseline deployment sample
//

// Use this sample to deploy the baseline resource configuration.

targetScope = 'managementGroup'


// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Baseline resource configuration')
module baseline_custom_role_definitions '../customRoleDefinitions.bicep' = {
name: 'custom_role_definition'
params: {
parAssignableScopeManagementGroupId: 'alz'
parTelemetryOptOut: false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'managementGroup'


// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Minimum resource configuration')
module minimum_custom_role_definitions '../customRoleDefinitions.bicep' = {
name: 'custom_role_definition'
}
45 changes: 45 additions & 0 deletions infra-as-code/bicep/modules/logging/samples/baseline.sample.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// Baseline deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'resourceGroup'

@description('The Azure location to deploy to.')
param location string = resourceGroup().location

// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Baseline resource configuration')
module baseline_logging '../logging.bicep' = {
name: 'baseline_logging'
params: {
parLogAnalyticsWorkspaceLocation: location
parAutomationAccountLocation: location
parLogAnalyticsWorkspaceName: 'alz-log-analytics'
parLogAnalyticsWorkspaceSkuName: 'PerGB2018'
parLogAnalyticsWorkspaceSolutions: [
'AgentHealthAssessment'
'AntiMalware'
'AzureActivity'
'ChangeTracking'
'Security'
'SecurityInsights'
'ServiceMap'
'SQLAdvancedThreatProtection'
'SQLVulnerabilityAssessment'
'SQLAssessment'
'Updates'
'VMInsights'
]
parAutomationAccountName: 'alz-automation-account'
parTelemetryOptOut: false
}
}
27 changes: 27 additions & 0 deletions infra-as-code/bicep/modules/logging/samples/minimum.sample.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'resourceGroup'

@description('The Azure location to deploy to.')
param location string = resourceGroup().location

// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Minimum resource configuration')
module minimum_logging '../logging.bicep' = {
name: 'minimum_logging'
params: {
parLogAnalyticsWorkspaceLocation: location
parAutomationAccountLocation: location
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'tenant'

// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Baseline resource configuration')
module baseline_managementgroups'../managementGroups.bicep' = {
name: 'baseline managementGroups'
params: {
parTopLevelManagementGroupParentId: '00000000-0000-0000-0000-000000000000'
parLandingZoneMgChildren: {
'mg-landingzone': {
displayName: 'Landing Zone'
children: {
'mg-operations': {
displayName: 'Operations'
}
}
}
}
parTopLevelManagementGroupPrefix: 'alz'
parTopLevelManagementGroupDisplayName: 'Azure Landing Zones'
parLandingZoneMgAlzDefaultsEnable: true
parLandingZoneMgConfidentialEnable: false
parTelemetryOptOut: false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'tenant'

// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Minimum resource configuration')
module minimum_managementgroups '../managementGroups.bicep' = {
name: 'minimum managementGroups'
params: {
parTopLevelManagementGroupParentId: '00000000-0000-0000-0000-000000000000'
parLandingZoneMgChildren: {
'mg-landingzone': {
displayName: 'Landing Zone'
children: {
'mg-operations': {
displayName: 'Operations'
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'managementGroup'

// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Baseline resource configuration')
module baseline_policy '../definitions/customPolicyDefinitions.bicep' = {
name: 'minimum policy'
params: {
parTargetManagementGroupId: 'alz'
parTelemetryOptOut: false
}
}
37 changes: 37 additions & 0 deletions infra-as-code/bicep/modules/policy/samples/baseline.sample.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Baseline deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'managementGroup'

// ----------
// PARAMETERS
// ----------
var policyAssignmentConfig = loadJsonContent('../assignments/parameters/mc-policyAssignmentManagementGroup.dine.parameters.all.json')

// ---------
// RESOURCES
// ---------

@description('Baseline resource configuration')
module minimum_policy '../assignments/policyAssignmentManagementGroup.bicep' = {
name: 'baseline policy'
params: {
parPolicyAssignmentName: policyAssignmentConfig.parameters.parPolicyAssignmentName.value
parPolicyAssignmentDisplayName: policyAssignmentConfig.parameters.parPolicyAssignmentDisplayName.value
parPolicyAssignmentDescription: policyAssignmentConfig.parameters.parPolicyAssignmentDescription.value
parPolicyAssignmentDefinitionId: policyAssignmentConfig.parameters.parPolicyAssignmentDefinitionId.value
parPolicyAssignmentParameters: policyAssignmentConfig.parameters.parPolicyAssignmentParameters
parPolicyAssignmentNonComplianceMessages: policyAssignmentConfig.parameters.parPolicyAssignmentNonComplianceMessages.value
parPolicyAssignmentNotScopes: policyAssignmentConfig.parameters.parPolicyAssignmentNotScopes.value
parTelemetryOptOut: policyAssignmentConfig.parameters.parTelemetryOptOut.value
parPolicyAssignmentParameterOverrides: policyAssignmentConfig.parameters.parPolicyAssignmentParameterOverrides.value
parPolicyAssignmentEnforcementMode: policyAssignmentConfig.parameters.parPolicyAssignmentEnforcementMode.value
parPolicyAssignmentIdentityType: policyAssignmentConfig.parameters.parPolicyAssignmentIdentityType.value
parPolicyAssignmentIdentityRoleAssignmentsAdditionalMgs: policyAssignmentConfig.parameters.parPolicyAssignmentIdentityRoleAssignmentsAdditionalMgs.value
parPolicyAssignmentIdentityRoleAssignmentsSubs: policyAssignmentConfig.parameters.parPolicyAssignmentIdentityRoleAssignmentsSubs.value
parPolicyAssignmentIdentityRoleDefinitionIds: policyAssignmentConfig.parameters.parPolicyAssignmentIdentityRoleDefinitionIds.value
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'managementGroup'

// ----------
// PARAMETERS
// ----------

// ---------
// RESOURCES
// ---------

@description('Minimum resource configuration')
module minimum_policy '../definitions/customPolicyDefinitions.bicep' = {
name: 'minimum policy'
}
31 changes: 31 additions & 0 deletions infra-as-code/bicep/modules/policy/samples/minimum.sample.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Minimum deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'managementGroup'

// ----------
// PARAMETERS
// ----------
var policyAssignmentConfig = loadJsonContent('../assignments/parameters/mc-policyAssignmentManagementGroup.dine.parameters.min.json')

// ---------
// RESOURCES
// ---------

@description('Minimum resource configuration')
module minimum_policy '../assignments/policyAssignmentManagementGroup.bicep' = {
name: 'minimum policy'
params: {
parPolicyAssignmentName: policyAssignmentConfig.parameters.parPolicyAssignmentName.value
parPolicyAssignmentDisplayName: policyAssignmentConfig.parameters.parPolicyAssignmentDisplayName.value
parPolicyAssignmentDescription: policyAssignmentConfig.parameters.parPolicyAssignmentDescription.value
parPolicyAssignmentDefinitionId: policyAssignmentConfig.parameters.parPolicyAssignmentDefinitionId.value
parPolicyAssignmentParameters: policyAssignmentConfig.parameters.parPolicyAssignmentParameters
parPolicyAssignmentNonComplianceMessages: policyAssignmentConfig.parameters.parPolicyAssignmentNonComplianceMessages.value
parPolicyAssignmentNotScopes: policyAssignmentConfig.parameters.parPolicyAssignmentNotScopes.value
parTelemetryOptOut: policyAssignmentConfig.parameters.parTelemetryOptOut.value
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//
// Baseline deployment sample
//

// Use this sample to deploy the minimum resource configuration.

targetScope = 'resourceGroup'

// ----------
// PARAMETERS
// ----------
@description('The Azure Region to deploy the resources into. Default: resourceGroup().location')
param location string = resourceGroup().location
// ---------
// RESOURCES
// ---------

@description('Baseline resource configuration')
module baseline_private_dns '../privateDnsZones.bicep' = {
name: 'minimum private DNS'
params: {
parLocation: location
parPrivateDnsZones: [
'privatelink.azure-automation.net'
'privatelink.database.windows.net'
'privatelink.sql.azuresynapse.net'
'privatelink.dev.azuresynapse.net'
'privatelink.azuresynapse.net'
'privatelink.blob.core.windows.net'
'privatelink.table.core.windows.net'
'privatelink.queue.core.windows.net'
'privatelink.file.core.windows.net'
'privatelink.web.core.windows.net'
'privatelink.dfs.core.windows.net'
'privatelink.documents.azure.com'
'privatelink.mongo.cosmos.azure.com'
'privatelink.cassandra.cosmos.azure.com'
'privatelink.gremlin.cosmos.azure.com'
'privatelink.table.cosmos.azure.com'
'privatelink.${toLower(location)}.batch.azure.com'
'privatelink.postgres.database.azure.com'
'privatelink.mysql.database.azure.com'
'privatelink.mariadb.database.azure.com'
'privatelink.vaultcore.azure.net'
'privatelink.managedhsm.azure.net'
'privatelink.${toLower(location)}.azmk8s.io'
'privatelink.siterecovery.windowsazure.com'
'privatelink.servicebus.windows.net'
'privatelink.azure-devices.net'
'privatelink.eventgrid.azure.net'
'privatelink.azurewebsites.net'
'privatelink.api.azureml.ms'
'privatelink.notebooks.azure.net'
'privatelink.service.signalr.net'
'privatelink.monitor.azure.com'
'privatelink.oms.opinsights.azure.com'
'privatelink.ods.opinsights.azure.com'
'privatelink.agentsvc.azure-automation.net'
'privatelink.afs.azure.net'
'privatelink.datafactory.azure.net'
'privatelink.adf.azure.com'
'privatelink.redis.cache.windows.net'
'privatelink.redisenterprise.cache.azure.net'
'privatelink.purview.azure.com'
'privatelink.purviewstudio.azure.com'
'privatelink.digitaltwins.azure.net'
'privatelink.azconfig.io'
'privatelink.cognitiveservices.azure.com'
'privatelink.azurecr.io'
'privatelink.search.windows.net'
'privatelink.azurehdinsight.net'
'privatelink.media.azure.net'
'privatelink.his.arc.azure.com'
'privatelink.guestconfiguration.azure.com'
]
parTags: {}
parVirtualNetworkIdToLink: ''
parTelemetryOptOut: false
}
}
Loading