Skip to content

Commit

Permalink
feat: App Job - Updated UDTs to pending specs (#4124)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
AlexanderSehr authored Jan 7, 2025
1 parent d14133a commit 3121841
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 170 deletions.
13 changes: 11 additions & 2 deletions avm/res/app/job/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This module deploys a Container App Job.
- [Usage examples](#Usage-examples)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)
- [Data Collection](#Data-Collection)

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

### Parameter: `managedIdentities.systemAssigned`

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

### Parameter: `managedIdentities.userAssignedResourceIds`

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

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

## Cross-referenced modules

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).

| Reference | Type |
| :-- | :-- |
| `br/public:avm/utl/types/avm-common-types:0.4.1` | Remote reference |

## Data Collection

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.
68 changes: 23 additions & 45 deletions avm/res/app/job/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ param location string = resourceGroup().location
@description('Required. Resource ID of Container Apps Environment.')
param environmentResourceId string

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

Expand Down Expand Up @@ -46,6 +47,7 @@ param tags object?
})
param registries registryType[]?

import { managedIdentityAllType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
@description('Optional. The managed identity definition for this resource.')
@metadata({
example: '''
Expand All @@ -60,10 +62,11 @@ param registries registryType[]?
}
'''
})
param managedIdentities managedIdentitiesType?
param managedIdentities managedIdentityAllType?

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

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

// =============== //
// Definitions //
// =============== //

type managedIdentitiesType = {
@description('Optional. Enables system assigned managed identity on the resource.')
systemAssigned: bool?

@description('Optional. The resource ID(s) to assign to the resource.')
userAssignedResourceIds: string[]?
}

type lockType = {
@description('Optional. Specify the name of lock.')
name: string?

@description('Optional. Specify the type of lock.')
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@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\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@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".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]

@export()
@description('The type for a registry.')
type registryType = {
@description('Required. The FQDN name of the container registry.')
@metadata({ example: 'myregistry.azurecr.io' })
Expand All @@ -349,6 +312,8 @@ type registryType = {
passwordSecretRef: string?
}

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

@export()
@description('The type for a volumne.')
type volumeType = {
@description('Required. The name of the volume.')
name: string
Expand All @@ -390,6 +357,7 @@ type volumeType = {
storageType: ('AzureFile' | 'EmptyDir' | 'NfsAzureFile' | 'Secret')
}

@description('The type for a container environment variable.')
type containerEnvironmentVariablesType = {
@description('Required. The environment variable name.')
name: string
Expand All @@ -401,6 +369,7 @@ type containerEnvironmentVariablesType = {
value: string?
}

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

@description('The type for a container resource.')
type containerResourceType = {
@description('Required. The CPU limit of the container in cores.')
@metadata({
Expand All @@ -494,6 +464,7 @@ type containerResourceType = {
memory: string
}

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

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

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

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

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

0 comments on commit 3121841

Please sign in to comment.