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

Response to FRs - Issues #267 and #290 - POC in RG Name and Deployment Snippets #312

Merged
merged 31 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a41d24b
1
4pplied Aug 23, 2022
24bb1ea
remove deployment type from naming convention
4pplied Aug 25, 2022
f79f1ef
example module 2
Aug 26, 2022
8aa0665
carml naming
Aug 30, 2022
f2b9c9f
carml naming
Aug 30, 2022
d2830c1
Merge branch 'Azure:main' into snippetsandpocname
4pplied Sep 1, 2022
026d5c1
carml naming
Sep 1, 2022
e55c4a7
carml names
Sep 1, 2022
57d0c0c
Merge branch 'main' into snippetsandpocname
jtracey93 Sep 5, 2022
7547419
CARML and orchestration
Sep 12, 2022
aa7f674
Merge branch 'snippetsandpocname' of https://github.com/JamJarchitect…
Sep 12, 2022
e2eb9e2
Merge branch 'Azure:main' into snippetsandpocname
4pplied Sep 12, 2022
29b218e
formatting
Sep 12, 2022
9810c13
Merge branch 'snippetsandpocname' of https://github.com/JamJarchitect…
Sep 12, 2022
f480aab
prefix, pdnszone, conforming names
Sep 12, 2022
00e8b3b
Merge branch 'main' into snippetsandpocname
4pplied Oct 3, 2022
537de52
formatting bash - one module test
Oct 5, 2022
c5e79b7
remove warning from test module
Oct 5, 2022
6d69919
bash changes
Oct 5, 2022
fc7f31a
whitespaces
Oct 6, 2022
ea1c4b4
bash snippet changes
Oct 10, 2022
d3e1943
Merge branch 'main' into snippetsandpocname
Oct 10, 2022
bfe1d5f
editorconfig
Oct 10, 2022
16e881d
Merge branch 'main' into snippetsandpocname
jtracey93 Oct 10, 2022
02715de
prep for v0.10.5 release (#2)
4pplied Oct 11, 2022
80a6897
Merge branch 'Azure:main' into snippetsandpocname
4pplied Oct 11, 2022
f66efa6
Merge branch 'main' into snippetsandpocname
4pplied Oct 14, 2022
33ead1b
Merge branch 'main' into snippetsandpocname
Nov 1, 2022
416f1d1
amendments
Nov 2, 2022
9eda44b
Merge branch 'main' into snippetsandpocname
4pplied Nov 2, 2022
8a4e251
amendments
Nov 2, 2022
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
58 changes: 38 additions & 20 deletions infra-as-code/bicep/modules/customRoleDefinitions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,58 @@ Input parameter file `parameters/customRoleDefinitions.parameters.all.json` defi
### Azure CLI
```bash
# For Azure global regions
az deployment mg create \
--template-file infra-as-code/bicep/modules/customRoleDefinitions/customRoleDefinitions.bicep \
--parameters @infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json \
--location eastus \
--management-group-id alz

$inputObject = @(
'--name', ('CustomRoleDefsDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--parameters', '@infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json',
'--location', 'eastus',
'--management-group-id', 'alz',
'--template-file', "infra-as-code/bicep/modules/customRoleDefinitions/customRoleDefinitions.bicep"
)
az deployment mg create @inputObject
```
OR
```bash
# For Azure China regions
az deployment mg create \
--template-file infra-as-code/bicep/modules/customRoleDefinitions/mc-customRoleDefinitions.bicep \
--parameters @infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json \
--location chinaeast2 \
--management-group-id alz

$inputObject = @(
'--name', ('CustomRoleDefsDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--parameters', '@infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json',
'--location', 'chinaeast2',
'--management-group-id', 'alz',
'--template-file', "infra-as-code/bicep/modules/customRoleDefinitions/mc-customRoleDefinitions.bicep"
)
az deployment mg create @inputObject
```

### PowerShell

```powershell
# For Azure global regions
New-AzManagementGroupDeployment `
-TemplateFile infra-as-code/bicep/modules/customRoleDefinitions/customRoleDefinitions.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json `
-Location eastus `
-ManagementGroupId alz

$inputObject = @{
DeploymentName = 'CustomRoleDefsDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
ManagementGroupId = 'alz'
Location = 'eastus'
TemplateParameterFile = 'infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json'
TemplateFile = "infra-as-code/bicep/modules/customRoleDefinitions/customRoleDefinitions.bicep"
}

New-AzManagementGroupDeployment @inputObject
```
OR
```powershell
# For Azure China regions
New-AzManagementGroupDeployment `
-TemplateFile infra-as-code/bicep/modules/customRoleDefinitions/mc-customRoleDefinitions.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json `
-Location chinaeast2 `
-ManagementGroupId alz

$inputObject = @{
DeploymentName = 'CustomRoleDefsDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
ManagementGroupId = 'alz'
Location = 'chinaeast2'
TemplateParameterFile = 'infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json'
TemplateFile = "infra-as-code/bicep/modules/customRoleDefinitions/mc-customRoleDefinitions.bicep"
}

New-AzManagementGroupDeployment @inputObject
```

![Example Deployment Output](media/exampleDeploymentOutput.png "Example Deployment Output")
Expand Down
84 changes: 63 additions & 21 deletions infra-as-code/bicep/modules/hubNetworking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,25 @@ There are two different sets of input parameters; one for deploying to Azure glo
# For Azure global regions
# Set Platform connectivity subscription ID as the the current subscription
ConnectivitySubscriptionId="[your platform connectivity subscription ID]"

az account set --subscription $ConnectivitySubscriptionId

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
TopLevelMGPrefix="alz"

ResourceGroupName="rg-$TopLevelMGPrefix-hub-networking-001"

$inputObject = @(
'--name', ('HubNetworkingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--resource-group', $ResourceGroupName,
'--parameters', '@infra-as-code/bicep/modules/hubNetworking/parameters/hubNetworking.parameters.all.json',
'--template-file', "infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep"
)

az group create --location eastus \
--name Hub_Networking_POC
--name $ResourceGroupName
4pplied marked this conversation as resolved.
Show resolved Hide resolved

az deployment group create \
--resource-group HUB_Networking_POC \
--template-file infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep \
--parameters @infra-as-code/bicep/modules/hubNetworking/parameters/hubNetworking.parameters.all.json
az deployment group create @inputObject
```
OR
```bash
Expand All @@ -110,13 +120,22 @@ OR
ConnectivitySubscriptionId="[your platform connectivity subscription ID]"
az account set --subscription $ConnectivitySubscriptionId

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
TopLevelMGPrefix="alz"

ResourceGroupName="rg-$TopLevelMGPrefix-hub-networking-001"

$inputObject = @(
'--name', ('HubNetworkingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--resource-group', $ResourceGroupName,
'--parameters', '@infra-as-code/bicep/modules/hubNetworking/parameters/mc-hubNetworking.parameters.all.json',
'--template-file', "infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep"
)

az group create --location chinaeast2 \
--name Hub_Networking_POC
--name $ResourceGroupName
4pplied marked this conversation as resolved.
Show resolved Hide resolved

az deployment group create \
--resource-group HUB_Networking_POC \
--template-file infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep \
--parameters @infra-as-code/bicep/modules/hubNetworking/parameters/mc-hubNetworking.parameters.all.json
az deployment group create @inputObject
```

### PowerShell
Expand All @@ -128,13 +147,26 @@ $ConnectivitySubscriptionId = "[your platform connectivity subscription ID]"

Select-AzSubscription -SubscriptionId $ConnectivitySubscriptionId

New-AzResourceGroup -Name 'Hub_Networking_POC' `
# Set Platform management subscripion ID as the the current subscription
$ManagementSubscriptionId = "[your platform management subscription ID]"

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
$TopLevelMGPrefix = "alz"

$ResourceGroupName = "rg-$TopLevelMGPrefix-hub-networking-001"
4pplied marked this conversation as resolved.
Show resolved Hide resolved

# Parameters necessary for deployment
$inputObject = @{
DeploymentName = 'HubNetworkingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
ResourceGroupName = $ResourceGroupName
TemplateParameterFile = "infra-as-code/bicep/modules/hubNetworking/parameters/hubNetworking.parameters.all.json"
TemplateFile = "infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep"
}

New-AzResourceGroup -Name $ResourceGroupName `
-Location 'eastus'

New-AzResourceGroupDeployment `
-TemplateFile infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/hubNetworking/parameters/hubNetworking.parameters.all.json `
-ResourceGroupName 'Hub_Networking_POC'
New-AzResourceGroupDeployment @inputObject
```
OR
```powershell
Expand All @@ -144,13 +176,23 @@ $ConnectivitySubscriptionId = "[your platform connectivity subscription ID]"

Select-AzSubscription -SubscriptionId $ConnectivitySubscriptionId

New-AzResourceGroup -Name 'Hub_Networking_POC' `
# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
$TopLevelMGPrefix = "alz"

$ResourceGroupName = "rg-$TopLevelMGPrefix-hub-networking-001"
4pplied marked this conversation as resolved.
Show resolved Hide resolved

# Parameters necessary for deployment
$inputObject = @{
DeploymentName = 'HubNetworkingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
ResourceGroupName = $ResourceGroupName
TemplateParameterFile = "infra-as-code/bicep/modules/hubNetworking/parameters/mc-hubNetworking.parameters.all.json"
TemplateFile = "infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep"
}

New-AzResourceGroup -Name $ResourceGroupName `
-Location 'chinaeast2'

New-AzResourceGroupDeployment `
-TemplateFile infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/hubNetworking/parameters/mc-hubNetworking.parameters.all.json `
-ResourceGroupName 'Hub_Networking_POC'

New-AzResourceGroupDeployment @inputObject
```
## Example Output in Azure global regions

Expand Down
78 changes: 58 additions & 20 deletions infra-as-code/bicep/modules/logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,25 @@ There are separate input parameters files depending on which Azure cloud you are
ManagementSubscriptionId="[your platform management subscription ID]"
az account set --subscription $ManagementSubscriptionId

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
TopLevelMGPrefix="alz"

ResourceGroupName="rg-$TopLevelMGPrefix-logging-001"

# Create Resource Group - optional when using an existing resource group
az group create \
--name alz-logging \
--name $ResourceGroupName \
--location eastus

$inputObject = @(
'--name', ('LoggingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--resource-group', $ResourceGroupName,
'--parameters', '@infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json',
'--template-file', "infra-as-code/bicep/modules/logging/logging.bicep"
)

# Deploy Module
az deployment group create \
--template-file infra-as-code/bicep/modules/logging/logging.bicep \
--parameters @infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json \
--resource-group alz-logging
az deployment group create @inputObject
```
OR
```bash
Expand All @@ -90,16 +99,25 @@ OR
ManagementSubscriptionId="[your platform management subscription ID]"
az account set --subscription $ManagementSubscriptionId

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
TopLevelMGPrefix="alz"

ResourceGroupName="rg-$TopLevelMGPrefix-logging-001"

# Create Resource Group - optional when using an existing resource group
az group create \
--name alz-logging \
--name $ResourceGroupName \
--location chinaeast2

$inputObject = @(
'--name', 'LoggingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63]),
'--resource-group', $ResourceGroupName,
'--parameters', '@infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json',
'--template-file', "infra-as-code/bicep/modules/logging/logging.bicep"
)

# Deploy Module
az deployment group create \
--template-file infra-as-code/bicep/modules/logging/logging.bicep \
--parameters @infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json \
--resource-group alz-logging
az deployment group create @inputObject
```

### PowerShell
Expand All @@ -109,35 +127,55 @@ az deployment group create \
# Set Platform management subscripion ID as the the current subscription
$ManagementSubscriptionId = "[your platform management subscription ID]"

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
$TopLevelMGPrefix = "alz"

$ResourceGroupName = "rg-$TopLevelMGPrefix-logging-001"
4pplied marked this conversation as resolved.
Show resolved Hide resolved

# Parameters necessary for deployment
$inputObject = @{
DeploymentName = 'LoggingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
ResourceGroupName = $ResourceGroupName
TemplateParameterFile = "infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json"
TemplateFile = "infra-as-code/bicep/modules/logging/logging.bicep"
}

Select-AzSubscription -SubscriptionId $ManagementSubscriptionId

# Create Resource Group - optional when using an existing resource group
New-AzResourceGroup `
-Name alz-logging `
-Name $ResourceGroupName `
-Location eastus

New-AzResourceGroupDeployment `
-TemplateFile infra-as-code/bicep/modules/logging/logging.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json `
-ResourceGroup alz-logging
New-AzResourceGroupDeployment @inputObject
```
OR
```powershell
# For Azure China regions
# Set Platform management subscripion ID as the the current subscription
$ManagementSubscriptionId = "[your platform management subscription ID]"

# Set the top level MG Prefix in accordance to your environment. This example assumes default 'alz'.
$TopLevelMGPrefix = "alz"

$ResourceGroupName = "rg-$TopLevelMGPrefix-logging-001"
4pplied marked this conversation as resolved.
Show resolved Hide resolved

# Parameters necessary for deployment
$inputObject = @{
DeploymentName = 'LoggingDeploy-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
ResourceGroupName = $ResourceGroupName
TemplateParameterFile = "infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json"
TemplateFile = "infra-as-code/bicep/modules/logging/logging.bicep"
}

Select-AzSubscription -SubscriptionId $ManagementSubscriptionId

# Create Resource Group - optional when using an existing resource group
New-AzResourceGroup `
-Name alz-logging `
-Name $ResourceGroupName `
-Location chinaeast2

New-AzResourceGroupDeployment `
-TemplateFile infra-as-code/bicep/modules/logging/logging.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json `
-ResourceGroup alz-logging
New-AzResourceGroupDeployment @inputObject
```

## Bicep Visualizer
Expand Down
50 changes: 34 additions & 16 deletions infra-as-code/bicep/modules/managementGroups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,36 +120,54 @@ In this example, the management groups are created at the `Tenant Root Group` th
### Azure CLI
```bash
# For Azure global regions
az deployment tenant create \
--template-file infra-as-code/bicep/modules/managementGroups/managementGroups.bicep \
--parameters @infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json \
--location eastus

$inputObject = @(
'--name', ('MGDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--parameters', '@infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json',
'--location', 'eastus',
'--template-file', "infra-as-code/bicep/modules/managementGroups/managementGroups.bicep"
)

az deployment tenant create @inputObject
```
OR
```bash
# For Azure China regions
az deployment tenant create \
--template-file infra-as-code/bicep/modules/managementGroups/managementGroups.bicep \
--parameters @infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json \
--location chinaeast2

$inputObject = @(
'--name', ('MGDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])),
'--parameters', '@infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json',
'--location', 'chinaeast2',
'--template-file', "infra-as-code/bicep/modules/managementGroups/managementGroups.bicep"
)

az deployment tenant create @inputObject
```

### PowerShell

```powershell
# For Azure global regions
New-AzTenantDeployment `
-TemplateFile infra-as-code/bicep/modules/managementGroups/managementGroups.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json `
-Location eastus

$inputObject = @{
DeploymentName = 'MGDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
TemplateParameterFile = 'infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json'
Location = 'EastUS'
TemplateFile = "infra-as-code/bicep/modules/managementGroups/managementGroups.bicep"
}
New-AzTenantDeployment @inputObject
```
OR
```powershell
# For Azure China regions
New-AzTenantDeployment `
-TemplateFile infra-as-code/bicep/modules/managementGroups/managementGroups.bicep `
-TemplateParameterFile infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json `
-Location chinaeast2

$inputObject = @{
DeploymentName = 'MGDeployment-{0}' -f (-join (Get-Date -Format 'yyyyMMddTHHMMssffffZ')[0..63])
TemplateParameterFile = 'infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json'
Location = 'chinaeast2'
TemplateFile = "infra-as-code/bicep/modules/managementGroups/managementGroups.bicep"
}
New-AzTenantDeployment @inputObject
```

![Example Deployment Output](media/exampleDeploymentOutput.png "Example Deployment Output")
Expand Down
Loading