Skip to content

Commit 3121841

Browse files
feat: App Job - Updated UDTs to pending specs (#4124)
## Description Updated user-defined types with pending Azure/Azure-Verified-Modules#1738 & #4098. ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | | [![avm.res.app.job](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.app.job.yml/badge.svg?branch=users%2Falsehr%2FappJob_udt&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.app.job.yml) | ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - [ ] Update to CI Environment or utilities (Non-module affecting changes) - [x] Azure Verified Module updates: - [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation
1 parent d14133a commit 3121841

File tree

3 files changed

+215
-170
lines changed

3 files changed

+215
-170
lines changed

avm/res/app/job/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This module deploys a Container App Job.
88
- [Usage examples](#Usage-examples)
99
- [Parameters](#Parameters)
1010
- [Outputs](#Outputs)
11+
- [Cross-referenced modules](#Cross-referenced-modules)
1112
- [Data Collection](#Data-Collection)
1213

1314
## Resource Types
@@ -1908,7 +1909,7 @@ The managed identity definition for this resource.
19081909
| Parameter | Type | Description |
19091910
| :-- | :-- | :-- |
19101911
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | bool | Enables system assigned managed identity on the resource. |
1911-
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. |
1912+
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |
19121913

19131914
### Parameter: `managedIdentities.systemAssigned`
19141915

@@ -1919,7 +1920,7 @@ Enables system assigned managed identity on the resource.
19191920

19201921
### Parameter: `managedIdentities.userAssignedResourceIds`
19211922

1922-
The resource ID(s) to assign to the resource.
1923+
The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.
19231924

19241925
- Required: No
19251926
- Type: array
@@ -2319,6 +2320,14 @@ The name of the workload profile to use. Leave empty to use a consumption based
23192320
| `resourceId` | string | The resource ID of the Container App Job. |
23202321
| `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. |
23212322

2323+
## Cross-referenced modules
2324+
2325+
This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).
2326+
2327+
| Reference | Type |
2328+
| :-- | :-- |
2329+
| `br/public:avm/utl/types/avm-common-types:0.4.1` | Remote reference |
2330+
23222331
## Data Collection
23232332

23242333
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

avm/res/app/job/main.bicep

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ param location string = resourceGroup().location
1111
@description('Required. Resource ID of Container Apps Environment.')
1212
param environmentResourceId string
1313

14+
import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
1415
@description('Optional. The lock settings of the service.')
1516
param lock lockType?
1617

@@ -46,6 +47,7 @@ param tags object?
4647
})
4748
param registries registryType[]?
4849

50+
import { managedIdentityAllType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
4951
@description('Optional. The managed identity definition for this resource.')
5052
@metadata({
5153
example: '''
@@ -60,10 +62,11 @@ param registries registryType[]?
6062
}
6163
'''
6264
})
63-
param managedIdentities managedIdentitiesType?
65+
param managedIdentities managedIdentityAllType?
6466

67+
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
6568
@description('Optional. Array of role assignments to create.')
66-
param roleAssignments roleAssignmentType?
69+
param roleAssignments roleAssignmentType[]?
6770

6871
@description('Optional. Enable/Disable usage telemetry for module.')
6972
param enableTelemetry bool = true
@@ -280,54 +283,14 @@ output location string = job.location
280283
@metadata({
281284
example: '00000000-0000-0000-0000-000000000000'
282285
})
283-
output systemAssignedMIPrincipalId string = job.?identity.?principalId ?? ''
286+
output systemAssignedMIPrincipalId string? = job.?identity.?principalId
284287

285288
// =============== //
286289
// Definitions //
287290
// =============== //
288291

289-
type managedIdentitiesType = {
290-
@description('Optional. Enables system assigned managed identity on the resource.')
291-
systemAssigned: bool?
292-
293-
@description('Optional. The resource ID(s) to assign to the resource.')
294-
userAssignedResourceIds: string[]?
295-
}
296-
297-
type lockType = {
298-
@description('Optional. Specify the name of lock.')
299-
name: string?
300-
301-
@description('Optional. Specify the type of lock.')
302-
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
303-
}
304-
305-
type roleAssignmentType = {
306-
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
307-
name: string?
308-
309-
@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
310-
roleDefinitionIdOrName: string
311-
312-
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
313-
principalId: string
314-
315-
@description('Optional. The principal type of the assigned principal ID.')
316-
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?
317-
318-
@description('Optional. The description of the role assignment.')
319-
description: string?
320-
321-
@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
322-
condition: string?
323-
324-
@description('Optional. Version of the condition.')
325-
conditionVersion: '2.0'?
326-
327-
@description('Optional. The Resource Id of the delegated managed identity resource.')
328-
delegatedManagedIdentityResourceId: string?
329-
}[]
330-
292+
@export()
293+
@description('The type for a registry.')
331294
type registryType = {
332295
@description('Required. The FQDN name of the container registry.')
333296
@metadata({ example: 'myregistry.azurecr.io' })
@@ -349,6 +312,8 @@ type registryType = {
349312
passwordSecretRef: string?
350313
}
351314

315+
@export()
316+
@description('The type for a secret.')
352317
type secretType = {
353318
@description('Optional. Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity.')
354319
identity: string?
@@ -367,6 +332,8 @@ type secretType = {
367332
value: string?
368333
}
369334

335+
@export()
336+
@description('The type for a volumne.')
370337
type volumeType = {
371338
@description('Required. The name of the volume.')
372339
name: string
@@ -390,6 +357,7 @@ type volumeType = {
390357
storageType: ('AzureFile' | 'EmptyDir' | 'NfsAzureFile' | 'Secret')
391358
}
392359

360+
@description('The type for a container environment variable.')
393361
type containerEnvironmentVariablesType = {
394362
@description('Required. The environment variable name.')
395363
name: string
@@ -401,6 +369,7 @@ type containerEnvironmentVariablesType = {
401369
value: string?
402370
}
403371

372+
@description('The type for a container probe.')
404373
type containerProbeType = {
405374
@description('Optional. Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3.')
406375
@minValue(1)
@@ -473,6 +442,7 @@ type containerProbeType = {
473442
type: ('Liveness' | 'Readiness' | 'Startup')
474443
}
475444

445+
@description('The type for a container resource.')
476446
type containerResourceType = {
477447
@description('Required. The CPU limit of the container in cores.')
478448
@metadata({
@@ -494,6 +464,7 @@ type containerResourceType = {
494464
memory: string
495465
}
496466

467+
@description('The type for a container volume mount.')
497468
type containerVolumeMountType = {
498469
@description('Required. The path within the container at which the volume should be mounted. Must not contain \':\'.')
499470
mountPath: string
@@ -505,6 +476,8 @@ type containerVolumeMountType = {
505476
volumeName: string
506477
}
507478

479+
@export()
480+
@description('The type for a manually triggered job configuration.')
508481
type manualTriggerConfigType = {
509482
@description('Optional. Number of parallel replicas of a job that can run at a given time. Defaults to 1.')
510483
parallelism: int?
@@ -513,6 +486,8 @@ type manualTriggerConfigType = {
513486
replicaCompletionCount: int?
514487
}
515488

489+
@export()
490+
@description('The type for a schedule based job configuration.')
516491
type scheduleTriggerconfigType = {
517492
@description('Required. Cron formatted repeating schedule ("* * * * *") of a Cron Job. It supports the standard [cron](https://en.wikipedia.org/wiki/Cron) expression syntax.')
518493
@metadata({
@@ -530,6 +505,8 @@ type scheduleTriggerconfigType = {
530505
replicaCompletionCount: int?
531506
}
532507

508+
@export()
509+
@description('The type for an event-driven job configuration.')
533510
type eventTriggerConfigType = {
534511
@description('Optional. Number of parallel replicas of a job that can run at a given time. Defaults to 1.')
535512
parallelism: int?
@@ -541,6 +518,7 @@ type eventTriggerConfigType = {
541518
scale: jobScaleType
542519
}
543520

521+
@description('The type for a job scale configuration.')
544522
type jobScaleType = {
545523
@description('Optional. Maximum number of job executions that are created for a trigger, default 100.')
546524
maxExecutions: int?

0 commit comments

Comments
 (0)