-
Notifications
You must be signed in to change notification settings - Fork 437
Added more options to Microsoft.ContainerInstances/containergroups module #2175
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
Merged
AlexanderSehr
merged 41 commits into
main
from
users/fblix_jpeasier/1867-container-options
Dec 23, 2022
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
087d52b
change containers param
JPEasier 867ed26
parameter update
JPEasier 36084f1
update readme
JPEasier 4c4b50c
set param to optional
JPEasier 7a1deda
Merge branch 'main' of https://github.com/Azure/ResourceModules into …
834d925
added further options to containergroups
6e90273
add subnet for ContainerInstance
JPEasier 54be701
Merge branch 'users/fblix_jpeasier/1867-container-options' of https:/…
JPEasier 40107e5
change description
JPEasier 200bd52
added union flag for property split
adaf867
updated readme
1833b34
changed subnetid indent
ca4c28d
changed private deployment params
ce7de77
updated param file
4d4c112
fixed volume name
7cd92b1
Merge branch 'main' of https://github.com/Azure/ResourceModules into …
90cdb69
add subnet delegation
JPEasier 2d5a6a7
Merge branch 'users/fblix_jpeasier/1867-container-options' of https:/…
JPEasier c702cc3
smaller fixes
d1bad11
Merge branch 'users/fblix_jpeasier/1867-container-options' of https:/…
023fa90
changed min param name
ae23039
removed autodnslabel
95a7f7b
updated min param name
f5c9ace
updated naming
969b13f
updated readme
3a75926
Merge branch 'main' of https://github.com/Azure/ResourceModules into …
JPEasier 770afa9
add privat ip deployment
JPEasier cc2d806
namePrefix
JPEasier 5c2a501
update param ipAdressPort to 'required'
JPEasier 9ca4642
namePrifix
JPEasier fdb633b
update readme for linter
JPEasier 76e8fac
Update modules/Microsoft.ContainerInstance/containerGroups/.test/priv…
AlexanderSehr 2038051
Update modules/Microsoft.ContainerInstance/containerGroups/deploy.bicep
JPEasier 2ac55d4
Update modules/Microsoft.ContainerInstance/containerGroups/.test/priv…
JPEasier 09670f1
use union on properties object
JPEasier e7a122b
update readme
JPEasier 59fd9d9
update union
JPEasier ee3645e
remove dnsConfig from basic properties
JPEasier 46aebf9
go back to variables
JPEasier 612c1c1
update readme
JPEasier 96a7004
rename prifix
JPEasier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
modules/Microsoft.ContainerInstance/containerGroups/.test/private/dependencies.bicep
This file contains hidden or 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,47 @@ | ||
| @description('Required. The name of the managed identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| @description('Required. The name of the Virtual Network to create.') | ||
| param virtualNetworkName string | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { | ||
| name: virtualNetworkName | ||
| location: location | ||
| properties: { | ||
| addressSpace: { | ||
| addressPrefixes: [ | ||
| '10.0.0.0/24' | ||
| ] | ||
| } | ||
| subnets: [ | ||
| { | ||
| name: 'defaultSubnet' | ||
| properties: { | ||
| addressPrefix: '10.0.0.0/24' | ||
| delegations: [ | ||
| { | ||
| name: 'Microsoft.ContainerInstance.containerGroups' | ||
| properties: { | ||
| serviceName: 'Microsoft.ContainerInstance/containerGroups' | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| @description('The resource ID of the created Managed Identity.') | ||
| output managedIdentityResourceId string = managedIdentity.id | ||
|
|
||
| @description('The resource ID of the created Virtual Network Subnet.') | ||
| output subnetResourceId string = virtualNetwork.properties.subnets[0].id |
129 changes: 129 additions & 0 deletions
129
modules/Microsoft.ContainerInstance/containerGroups/.test/private/deploy.test.bicep
This file contains hidden or 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,129 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.containerinstance.containergroups-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location 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 = 'cicgprivate' | ||
|
|
||
| @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') | ||
| param enableDefaultTelemetry bool = true | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| virtualNetworkName: 'dep-<<namePrefix>>-vnet-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| enableDefaultTelemetry: enableDefaultTelemetry | ||
| name: '<<namePrefix>>${serviceShort}001' | ||
| lock: 'CanNotDelete' | ||
| containers: [ | ||
| { | ||
| name: '<<namePrefix>>-az-aci-x-001' | ||
| properties: { | ||
| command: [] | ||
| environmentVariables: [] | ||
| image: 'mcr.microsoft.com/azuredocs/aci-helloworld' | ||
| ports: [ | ||
| { | ||
| port: '80' | ||
| protocol: 'Tcp' | ||
| } | ||
| { | ||
| port: '443' | ||
| protocol: 'Tcp' | ||
| } | ||
| ] | ||
| resources: { | ||
| requests: { | ||
| cpu: 2 | ||
| memoryInGB: 4 | ||
| } | ||
| } | ||
| volumeMounts: [ | ||
| { | ||
| name: 'my-name' | ||
| mountPath: '/mnt/empty' | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| { | ||
| name: '<<namePrefix>>-az-aci-x-002' | ||
| properties: { | ||
| command: [] | ||
| environmentVariables: [] | ||
| image: 'mcr.microsoft.com/azuredocs/aci-helloworld' | ||
| ports: [ | ||
| { | ||
| port: '8080' | ||
| protocol: 'Tcp' | ||
| } | ||
| ] | ||
| resources: { | ||
| requests: { | ||
| cpu: 2 | ||
| memoryInGB: 2 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| ipAddressType: 'Private' | ||
| ipAddressPorts: [ | ||
| { | ||
| protocol: 'Tcp' | ||
| port: 80 | ||
| } | ||
| { | ||
| protocol: 'Tcp' | ||
| port: 443 | ||
| } | ||
| { | ||
| protocol: 'Tcp' | ||
| port: '8080' | ||
| } | ||
| ] | ||
| subnetId: resourceGroupResources.outputs.subnetResourceId | ||
| volumes: [ | ||
| { | ||
| emptyDir: {} | ||
| name: 'my-name' | ||
| } | ||
| ] | ||
| systemAssignedIdentity: true | ||
| userAssignedIdentities: { | ||
| '${resourceGroupResources.outputs.managedIdentityResourceId}': {} | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.