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: Adding support for Peer Encryption #3068

Merged
merged 54 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cf5fede
Adding new workflow
hundredacres Mar 25, 2024
ff7c683
Merge remote-tracking branch 'upstream/main'
hundredacres Mar 26, 2024
c883d2b
Merge remote-tracking branch 'upstream/main'
hundredacres Mar 27, 2024
5d11b9b
Merge remote-tracking branch 'upstream/main'
hundredacres Mar 28, 2024
abcb62e
Merge remote-tracking branch 'upstream/main'
hundredacres Apr 8, 2024
318eacd
Merge remote-tracking branch 'upstream/main'
hundredacres Apr 22, 2024
98c9667
Merge branch 'Azure:main' into main
hundredacres Apr 24, 2024
d4f9aaa
Merge remote-tracking branch 'upstream/main'
hundredacres Apr 29, 2024
cf5d59a
Merge remote-tracking branch 'upstream/main'
hundredacres Apr 30, 2024
0f43d8b
Merge branch 'Azure:main' into main
hundredacres May 1, 2024
a84760a
chore: shortening module statuses (#1809)
matebarabas May 1, 2024
d992d08
fix: repair automatic assignment of issues (#1817)
rahalan May 2, 2024
5b95ae1
fix: Removed orphaned file & reference (#1822)
JFolberth May 2, 2024
e9f11ba
Merge branch 'Azure:main' into main
hundredacres May 2, 2024
2a3fd4c
Merge remote-tracking branch 'upstream/main'
hundredacres May 6, 2024
9061cfe
Merge remote-tracking branch 'upstream/main'
hundredacres May 8, 2024
9893b9a
Merge remote-tracking branch 'upstream/main'
hundredacres May 10, 2024
15ea104
Merge branch 'Azure:main' into main
hundredacres May 14, 2024
7932e38
Merge branch 'Azure:main' into main
hundredacres May 15, 2024
fc79840
Merge remote-tracking branch 'upstream/main'
hundredacres May 16, 2024
fa79026
Merge remote-tracking branch 'upstream/main'
hundredacres May 17, 2024
dada297
Merge remote-tracking branch 'upstream/main'
hundredacres May 23, 2024
4a21db9
Merge remote-tracking branch 'upstream/main'
hundredacres May 24, 2024
279c3ae
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 5, 2024
07101e0
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 5, 2024
001dbcb
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 7, 2024
c176840
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 14, 2024
0676b50
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 17, 2024
6add63b
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 19, 2024
3e307bd
Merge branch 'Azure:main' into main
hundredacres Jun 24, 2024
8ebba67
Merge remote-tracking branch 'upstream/main'
hundredacres Jun 27, 2024
990a851
Merge remote-tracking branch 'upstream/main'
hundredacres Jul 3, 2024
f589c3b
Merge branch 'Azure:main' into main
hundredacres Jul 8, 2024
7c9743f
Merge branch 'Azure:main' into main
hundredacres Jul 9, 2024
177624f
Merge branch 'main' of https://github.com/hundredacres/bicep-registry…
hundredacres Jul 9, 2024
f7f45f4
Merge remote-tracking branch 'upstream/main'
hundredacres Jul 10, 2024
a60b6db
Merge branch 'Azure:main' into main
hundredacres Jul 10, 2024
f58e8c9
Merge branch 'Azure:main' into main
hundredacres Jul 11, 2024
66863e5
Merge branch 'main' of https://github.com/hundredacres/bicep-registry…
hundredacres Jul 11, 2024
a08709e
Merge branch 'Azure:main' into main
hundredacres Jul 16, 2024
0917b87
Merge branch 'main' of https://github.com/hundredacres/bicep-registry…
hundredacres Jul 17, 2024
a12b397
Merge remote-tracking branch 'upstream/main'
hundredacres Jul 24, 2024
2605fea
Merge remote-tracking branch 'upstream/main'
hundredacres Aug 1, 2024
3b976de
Merge remote-tracking branch 'upstream/main'
hundredacres Aug 1, 2024
ad6aabb
Merge remote-tracking branch 'upstream/main'
hundredacres Aug 3, 2024
0ebbb51
Merge remote-tracking branch 'upstream/main'
hundredacres Aug 5, 2024
0346ba0
Merge remote-tracking branch 'upstream/main'
hundredacres Aug 7, 2024
09cc4b1
Merge branch 'Azure:main' into main
hundredacres Aug 16, 2024
4ba8a77
Merge branch 'Azure:main' into main
hundredacres Aug 19, 2024
2f51d54
Merge branch 'main' of https://github.com/hundredacres/bicep-registry…
hundredacres Aug 19, 2024
ff17b70
Adding support for peer encryption
hundredacres Aug 19, 2024
4bf5189
Bumping minor version since API version changes
hundredacres Aug 19, 2024
1c243cc
Merge branch 'main' into feat/issues/3063
hundredacres Aug 20, 2024
04217b5
Defaulting peerEncryption to true
hundredacres Aug 20, 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
17 changes: 15 additions & 2 deletions avm/res/app/managed-environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ This module deploys an App Managed Environment (also known as a Container App En

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.App/managedEnvironments` | [2023-11-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.App/2023-11-02-preview/managedEnvironments) |
| `Microsoft.App/managedEnvironments/storages` | [2023-11-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.App/2023-11-02-preview/managedEnvironments/storages) |
| `Microsoft.App/managedEnvironments` | [2024-02-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.App/2024-02-02-preview/managedEnvironments) |
| `Microsoft.App/managedEnvironments/storages` | [2024-02-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.App/2024-02-02-preview/managedEnvironments/storages) |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |

Expand Down Expand Up @@ -171,6 +171,7 @@ module managedEnvironment 'br/public:avm/res/app/managed-environment:<version>'
]
}
}
peerTrafficEncryption: true
platformReservedCidr: '172.17.17.0/24'
platformReservedDnsIP: '172.17.17.17'
roleAssignments: [
Expand Down Expand Up @@ -288,6 +289,9 @@ module managedEnvironment 'br/public:avm/res/app/managed-environment:<version>'
}
}
},
"peerTrafficEncryption": {
"value": true
},
"platformReservedCidr": {
"value": "172.17.17.0/24"
},
Expand Down Expand Up @@ -542,6 +546,7 @@ module managedEnvironment 'br/public:avm/res/app/managed-environment:<version>'
| [`logsDestination`](#parameter-logsdestination) | string | Logs destination. |
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. |
| [`openTelemetryConfiguration`](#parameter-opentelemetryconfiguration) | object | Open Telemetry configuration. |
| [`peerTrafficEncryption`](#parameter-peertrafficencryption) | bool | Whether or not to encrypt peer traffic. |
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`storages`](#parameter-storages) | array | The list of storages to mount on the environment. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
Expand Down Expand Up @@ -761,6 +766,14 @@ Open Telemetry configuration.
- Type: object
- Default: `{}`

### Parameter: `peerTrafficEncryption`

Whether or not to encrypt peer traffic.

- Required: No
- Type: bool
- Default: `False`

### Parameter: `roleAssignments`

Array of role assignments to create.
Expand Down
10 changes: 9 additions & 1 deletion avm/res/app/managed-environment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ param platformReservedCidr string = ''
@description('Conditional. An IP address from the IP range defined by "platformReservedCidr" that will be reserved for the internal DNS server. It must not be the first address in the range and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. Required if zoneRedundant is set to true to make the resource WAF compliant.')
param platformReservedDnsIP string = ''

@description('Optional. Whether or not to encrypt peer traffic.')
param peerTrafficEncryption bool = false

@description('Optional. Whether or not this Managed Environment is zone-redundant.')
param zoneRedundant bool = true

Expand Down Expand Up @@ -146,7 +149,7 @@ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09
scope: resourceGroup(split(logAnalyticsWorkspaceResourceId, '/')[2], split(logAnalyticsWorkspaceResourceId, '/')[4])
}

resource managedEnvironment 'Microsoft.App/managedEnvironments@2023-11-02-preview' = {
resource managedEnvironment 'Microsoft.App/managedEnvironments@2024-02-02-preview' = {
name: name
location: location
tags: tags
Expand All @@ -170,6 +173,11 @@ resource managedEnvironment 'Microsoft.App/managedEnvironments@2023-11-02-previe
dnsSuffix: dnsSuffix
}
openTelemetryConfiguration: !empty(openTelemetryConfiguration) ? openTelemetryConfiguration : null
peerTrafficConfiguration: {
encryption: {
enabled: peerTrafficEncryption
}
}
vnetConfiguration: {
internal: internal
infrastructureSubnetId: !empty(infrastructureSubnetId) ? infrastructureSubnetId : null
Expand Down
22 changes: 17 additions & 5 deletions avm/res/app/managed-environment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "364014764379639426"
"templateHash": "7943835735953238295"
},
"name": "App ManagedEnvironments",
"description": "This module deploys an App Managed Environment (also known as a Container App Environment).",
Expand Down Expand Up @@ -285,6 +285,13 @@
"description": "Conditional. An IP address from the IP range defined by \"platformReservedCidr\" that will be reserved for the internal DNS server. It must not be the first address in the range and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. Required if zoneRedundant is set to true to make the resource WAF compliant."
}
},
"peerTrafficEncryption": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Whether or not to encrypt peer traffic."
}
},
"zoneRedundant": {
"type": "bool",
"defaultValue": true,
Expand Down Expand Up @@ -372,7 +379,7 @@
"count": "[length(coalesce(parameters('storages'), createArray()))]"
},
"type": "Microsoft.App/managedEnvironments/storages",
"apiVersion": "2023-11-02-preview",
"apiVersion": "2024-02-02-preview",
"name": "[format('{0}/{1}', parameters('name'), coalesce(parameters('storages'), createArray())[copyIndex()].shareName)]",
"properties": {
"nfsAzureFile": "[if(equals(coalesce(parameters('storages'), createArray())[copyIndex()].kind, 'NFS'), createObject('accessMode', coalesce(parameters('storages'), createArray())[copyIndex()].accessMode, 'server', format('{0}.file.{1}', coalesce(parameters('storages'), createArray())[copyIndex()].storageAccountName, environment().suffixes.storage), 'shareName', format('/{0}/{1}', coalesce(parameters('storages'), createArray())[copyIndex()].storageAccountName, coalesce(parameters('storages'), createArray())[copyIndex()].shareName)), null())]",
Expand Down Expand Up @@ -413,7 +420,7 @@
},
"managedEnvironment": {
"type": "Microsoft.App/managedEnvironments",
"apiVersion": "2023-11-02-preview",
"apiVersion": "2024-02-02-preview",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
Expand All @@ -437,6 +444,11 @@
"dnsSuffix": "[parameters('dnsSuffix')]"
},
"openTelemetryConfiguration": "[if(not(empty(parameters('openTelemetryConfiguration'))), parameters('openTelemetryConfiguration'), null())]",
"peerTrafficConfiguration": {
"encryption": {
"enabled": "[parameters('peerTrafficEncryption')]"
}
},
"vnetConfiguration": {
"internal": "[parameters('internal')]",
"infrastructureSubnetId": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('infrastructureSubnetId'), null())]",
Expand Down Expand Up @@ -502,7 +514,7 @@
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference('managedEnvironment', '2023-11-02-preview', 'full').location]"
"value": "[reference('managedEnvironment', '2024-02-02-preview', 'full').location]"
},
"name": {
"type": "string",
Expand All @@ -523,7 +535,7 @@
"metadata": {
"description": "The principal ID of the system assigned identity."
},
"value": "[coalesce(tryGet(tryGet(reference('managedEnvironment', '2023-11-02-preview', 'full'), 'identity'), 'principalId'), '')]"
"value": "[coalesce(tryGet(tryGet(reference('managedEnvironment', '2024-02-02-preview', 'full'), 'identity'), 'principalId'), '')]"
},
"defaultDomain": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-04-01' = {
{
name: 'defaultSubnet'
properties: {
addressPrefix: cidrSubnet(addressPrefix, 16, 0)
addressPrefix: cidrSubnet(addressPrefix, 23, 0)
delegations: [
{
name: 'Microsoft.App.environments'
Expand Down Expand Up @@ -138,4 +138,4 @@ output managedIdentityResourceId string = managedIdentity.id
output appInsightsConnectionString string = appInsightsComponent.properties.ConnectionString

@description('The name of the created Storage Account.')
output storageAccountName string = storageAccount.name
output storageAccountName string = storageAccount.name
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module testDeployment '../../../main.bicep' = [
]
internal: true
dockerBridgeCidr: '172.16.0.1/28'
peerTrafficEncryption: true
platformReservedCidr: '172.17.17.0/24'
platformReservedDnsIP: '172.17.17.17'
infrastructureSubnetId: nestedDependencies.outputs.subnetResourceId
Expand Down
4 changes: 2 additions & 2 deletions avm/res/app/managed-environment/version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.6",
"version": "0.7",
"pathFilters": [
"./main.json"
]
}
}