Skip to content

Commit

Permalink
feat: Added UDTs and added dependency (#4346)
Browse files Browse the repository at this point in the history
## Description

- Added UDTs for child resources
- Added dependency to PE deployment for cases where replications are
deployed (example of the first deployment failing while a second
attempts passes:
[ref](https://github.com/Azure/bicep-registry-modules/actions/runs/13012053623/job/36292968347#step:4:820)).
Now it runs all the way through:
[ref](https://github.com/Azure/bicep-registry-modules/actions/runs/13041119081/job/36383103466#step:4:708).

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.container-registry.registry](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.container-registry.registry.yml/badge.svg?branch=users%2Falsehr%2FregistryDependency&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.container-registry.registry.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:
- [x] 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 31, 2025
1 parent d0a356d commit feee477
Show file tree
Hide file tree
Showing 13 changed files with 786 additions and 136 deletions.
265 changes: 264 additions & 1 deletion avm/res/container-registry/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1027,13 +1027,138 @@ Array of Cache Rules.
- Required: No
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`sourceRepository`](#parameter-cacherulessourcerepository) | string | Source repository pulled from upstream. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`credentialSetResourceId`](#parameter-cacherulescredentialsetresourceid) | string | The resource ID of the credential store which is associated with the cache rule. |
| [`name`](#parameter-cacherulesname) | string | The name of the cache rule. Will be derived from the source repository name if not defined. |
| [`targetRepository`](#parameter-cacherulestargetrepository) | string | Target repository specified in docker pull command. E.g.: docker pull myregistry.azurecr.io/{targetRepository}:{tag}. |

### Parameter: `cacheRules.sourceRepository`

Source repository pulled from upstream.

- Required: Yes
- Type: string

### Parameter: `cacheRules.credentialSetResourceId`

The resource ID of the credential store which is associated with the cache rule.

- Required: No
- Type: string

### Parameter: `cacheRules.name`

The name of the cache rule. Will be derived from the source repository name if not defined.

- Required: No
- Type: string

### Parameter: `cacheRules.targetRepository`

Target repository specified in docker pull command. E.g.: docker pull myregistry.azurecr.io/{targetRepository}:{tag}.

- Required: No
- Type: string

### Parameter: `credentialSets`

Array of Credential Sets.

- Required: No
- Type: array
- Default: `[]`

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`authCredentials`](#parameter-credentialsetsauthcredentials) | array | List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential. |
| [`loginServer`](#parameter-credentialsetsloginserver) | string | The credentials are stored for this upstream or login server. |
| [`name`](#parameter-credentialsetsname) | string | The name of the credential set. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`managedIdentities`](#parameter-credentialsetsmanagedidentities) | object | The managed identity definition for this resource. |

### Parameter: `credentialSets.authCredentials`

List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential.

- Required: Yes
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-credentialsetsauthcredentialsname) | string | The name of the credential. |
| [`passwordSecretIdentifier`](#parameter-credentialsetsauthcredentialspasswordsecretidentifier) | string | KeyVault Secret URI for accessing the password. |
| [`usernameSecretIdentifier`](#parameter-credentialsetsauthcredentialsusernamesecretidentifier) | string | KeyVault Secret URI for accessing the username. |

### Parameter: `credentialSets.authCredentials.name`

The name of the credential.

- Required: Yes
- Type: string

### Parameter: `credentialSets.authCredentials.passwordSecretIdentifier`

KeyVault Secret URI for accessing the password.

- Required: Yes
- Type: string

### Parameter: `credentialSets.authCredentials.usernameSecretIdentifier`

KeyVault Secret URI for accessing the username.

- Required: Yes
- Type: string

### Parameter: `credentialSets.loginServer`

The credentials are stored for this upstream or login server.

- Required: Yes
- Type: string

### Parameter: `credentialSets.name`

The name of the credential set.

- Required: Yes
- Type: string

### Parameter: `credentialSets.managedIdentities`

The managed identity definition for this resource.

- Required: No
- Type: object

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`systemAssigned`](#parameter-credentialsetsmanagedidentitiessystemassigned) | bool | Enables system assigned managed identity on the resource. |

### Parameter: `credentialSets.managedIdentities.systemAssigned`

Enables system assigned managed identity on the resource.

- Required: No
- Type: bool

### Parameter: `customerManagedKey`

Expand Down Expand Up @@ -1825,6 +1950,63 @@ All replications to create.
- Required: No
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-replicationsname) | string | The name of the replication. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`location`](#parameter-replicationslocation) | string | Location for all resources. |
| [`regionEndpointEnabled`](#parameter-replicationsregionendpointenabled) | bool | Specifies whether the replication regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications. |
| [`tags`](#parameter-replicationstags) | object | Tags of the resource. |
| [`zoneRedundancy`](#parameter-replicationszoneredundancy) | string | Whether or not zone redundancy is enabled for this container registry. |

### Parameter: `replications.name`

The name of the replication.

- Required: Yes
- Type: string

### Parameter: `replications.location`

Location for all resources.

- Required: No
- Type: string

### Parameter: `replications.regionEndpointEnabled`

Specifies whether the replication regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications.

- Required: No
- Type: bool

### Parameter: `replications.tags`

Tags of the resource.

- Required: No
- Type: object

### Parameter: `replications.zoneRedundancy`

Whether or not zone redundancy is enabled for this container registry.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'Disabled'
'Enabled'
]
```

### Parameter: `retentionPolicyDays`

The number of days to retain an untagged manifest after which it gets purged.
Expand Down Expand Up @@ -2050,6 +2232,87 @@ All webhooks to create.
- Required: No
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`serviceUri`](#parameter-webhooksserviceuri) | string | The service URI for the webhook to post notifications. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`action`](#parameter-webhooksaction) | array | The list of actions that trigger the webhook to post notifications. |
| [`customHeaders`](#parameter-webhookscustomheaders) | object | Custom headers that will be added to the webhook notifications. |
| [`location`](#parameter-webhookslocation) | string | Location for all resources. |
| [`name`](#parameter-webhooksname) | string | The name of the registry webhook. |
| [`scope`](#parameter-webhooksscope) | string | The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. |
| [`status`](#parameter-webhooksstatus) | string | The status of the webhook at the time the operation was called. |
| [`tags`](#parameter-webhookstags) | object | Tags of the resource. |

### Parameter: `webhooks.serviceUri`

The service URI for the webhook to post notifications.

- Required: Yes
- Type: string

### Parameter: `webhooks.action`

The list of actions that trigger the webhook to post notifications.

- Required: No
- Type: array

### Parameter: `webhooks.customHeaders`

Custom headers that will be added to the webhook notifications.

- Required: No
- Type: object

### Parameter: `webhooks.location`

Location for all resources.

- Required: No
- Type: string

### Parameter: `webhooks.name`

The name of the registry webhook.

- Required: No
- Type: string

### Parameter: `webhooks.scope`

The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events.

- Required: No
- Type: string

### Parameter: `webhooks.status`

The status of the webhook at the time the operation was called.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'disabled'
'enabled'
]
```

### Parameter: `webhooks.tags`

Tags of the resource.

- Required: No
- Type: object

### Parameter: `zoneRedundancy`

Whether or not zone redundancy is enabled for this container registry.
Expand Down
15 changes: 10 additions & 5 deletions avm/res/container-registry/registry/cache-rule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ Cache for Azure Container Registry (Preview) feature allows users to cache conta

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`registryName`](#parameter-registryname) | string | The name of the parent registry. Required if the template is used in a standalone deployment. |
| [`sourceRepository`](#parameter-sourcerepository) | string | Source repository pulled from upstream. |

**Conditional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`registryName`](#parameter-registryname) | string | The name of the parent registry. Required if the template is used in a standalone deployment. |

**Optional parameters**

| Parameter | Type | Description |
Expand All @@ -31,16 +36,16 @@ Cache for Azure Container Registry (Preview) feature allows users to cache conta
| [`name`](#parameter-name) | string | The name of the cache rule. Will be derived from the source repository name if not defined. |
| [`targetRepository`](#parameter-targetrepository) | string | Target repository specified in docker pull command. E.g.: docker pull myregistry.azurecr.io/{targetRepository}:{tag}. |

### Parameter: `registryName`
### Parameter: `sourceRepository`

The name of the parent registry. Required if the template is used in a standalone deployment.
Source repository pulled from upstream.

- Required: Yes
- Type: string

### Parameter: `sourceRepository`
### Parameter: `registryName`

Source repository pulled from upstream.
The name of the parent registry. Required if the template is used in a standalone deployment.

- Required: Yes
- Type: string
Expand Down
2 changes: 1 addition & 1 deletion avm/res/container-registry/registry/cache-rule/main.bicep
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
metadata name = 'Container Registries Cache'
metadata description = 'Cache for Azure Container Registry (Preview) feature allows users to cache container images in a private container registry. Cache for ACR, is a preview feature available in Basic, Standard, and Premium service tiers ([ref](https://learn.microsoft.com/en-us/azure/container-registry/tutorial-registry-cache)).'

@description('Required. The name of the parent registry. Required if the template is used in a standalone deployment.')
@description('Conditional. The name of the parent registry. Required if the template is used in a standalone deployment.')
param registryName string

@description('Optional. The name of the cache rule. Will be derived from the source repository name if not defined.')
Expand Down
6 changes: 3 additions & 3 deletions avm/res/container-registry/registry/cache-rule/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "10966757769768845548"
"version": "0.33.13.18514",
"templateHash": "13450234979206794925"
},
"name": "Container Registries Cache",
"description": "Cache for Azure Container Registry (Preview) feature allows users to cache container images in a private container registry. Cache for ACR, is a preview feature available in Basic, Standard, and Premium service tiers ([ref](https://learn.microsoft.com/en-us/azure/container-registry/tutorial-registry-cache))."
Expand All @@ -15,7 +15,7 @@
"registryName": {
"type": "string",
"metadata": {
"description": "Required. The name of the parent registry. Required if the template is used in a standalone deployment."
"description": "Conditional. The name of the parent registry. Required if the template is used in a standalone deployment."
}
},
"name": {
Expand Down
Loading

0 comments on commit feee477

Please sign in to comment.