Skip to content

Commit

Permalink
feat: Service-Fabric-Cluster - Updated UDTs to pending specs (#4104)
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.service-fabric.cluster](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.service-fabric.cluster.yml/badge.svg?branch=users%2Falsehr%2Favm.res.service-fabric.cluster_udt&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.service-fabric.cluster.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 16, 2025
1 parent 5379df8 commit a561e0e
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 193 deletions.
24 changes: 9 additions & 15 deletions avm/res/service-fabric/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This module deploys a Service Fabric Cluster.
- [Usage examples](#Usage-examples)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)
- [Data Collection](#Data-Collection)

## Resource Types
Expand Down Expand Up @@ -82,7 +83,6 @@ module cluster 'br/public:avm/res/service-fabric/cluster:<version>' = {
isAdmin: true
}
]
location: '<location>'
}
}
```
Expand Down Expand Up @@ -147,9 +147,6 @@ module cluster 'br/public:avm/res/service-fabric/cluster:<version>' = {
"isAdmin": true
}
]
},
"location": {
"value": "<location>"
}
}
}
Expand Down Expand Up @@ -202,7 +199,6 @@ param clientCertificateThumbprints = [
isAdmin: true
}
]
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -246,7 +242,6 @@ module cluster 'br/public:avm/res/service-fabric/cluster:<version>' = {
certificate: {
thumbprint: '0AC113D5E1D94C401DDEB0EE2B1B96CC130'
}
location: '<location>'
}
}
```
Expand Down Expand Up @@ -297,9 +292,6 @@ module cluster 'br/public:avm/res/service-fabric/cluster:<version>' = {
"value": {
"thumbprint": "0AC113D5E1D94C401DDEB0EE2B1B96CC130"
}
},
"location": {
"value": "<location>"
}
}
}
Expand Down Expand Up @@ -340,7 +332,6 @@ param reliabilityLevel = 'None'
param certificate = {
thumbprint: '0AC113D5E1D94C401DDEB0EE2B1B96CC130'
}
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -1060,7 +1051,6 @@ module cluster 'br/public:avm/res/service-fabric/cluster:<version>' = {
]
}
]
location: '<location>'
maxUnusedVersionsToKeep: 2
notifications: [
{
Expand Down Expand Up @@ -1241,9 +1231,6 @@ module cluster 'br/public:avm/res/service-fabric/cluster:<version>' = {
}
]
},
"location": {
"value": "<location>"
},
"maxUnusedVersionsToKeep": {
"value": 2
},
Expand Down Expand Up @@ -1410,7 +1397,6 @@ param fabricSettings = [
]
}
]
param location = '<location>'
param maxUnusedVersionsToKeep = 2
param notifications = [
{
Expand Down Expand Up @@ -2104,6 +2090,14 @@ Boolean to pause automatic runtime version upgrades to the cluster.
| `resourceGroupName` | string | The Service Fabric Cluster resource group. |
| `resourceId` | string | The Service Fabric Cluster resource ID. |

## 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.5.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: 22 additions & 46 deletions avm/res/service-fabric/cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ param location string = resourceGroup().location
@description('Optional. Tags of the resource.')
param tags object?

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

@allowed([
'BackupRestoreService'
Expand All @@ -30,16 +31,16 @@ param maxUnusedVersionsToKeep int = 3
param azureActiveDirectory object = {}

@description('Conditional. The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. Required if the certificateCommonNames parameter is not used.')
param certificate certificateType
param certificate certificateType?

@description('Conditional. Describes a list of server certificates referenced by common name that are used to secure the cluster. Required if the certificate parameter is not used.')
param certificateCommonNames certificateCommonNameType
param certificateCommonNames certificateCommonNameType?

@description('Optional. The list of client certificates referenced by common name that are allowed to manage the cluster. Cannot be used if the clientCertificateThumbprints parameter is used.')
param clientCertificateCommonNames clientCertificateCommonNameType
param clientCertificateCommonNames clientCertificateCommonNameType[]?

@description('Optional. The list of client certificates referenced by thumbprint that are allowed to manage the cluster. Cannot be used if the clientCertificateCommonNames parameter is used.')
param clientCertificateThumbprints clientCertificateThumbprintType
param clientCertificateThumbprints clientCertificateThumbprintType[]?

@description('Optional. The Service Fabric runtime version of the cluster. This property can only by set the user when upgradeMode is set to "Manual". To get list of available Service Fabric versions for new clusters use ClusterVersion API. To get the list of available version for existing clusters use availableClusterVersions.')
param clusterCodeVersion string?
Expand Down Expand Up @@ -125,8 +126,9 @@ param vmssZonalUpgradeMode string = 'Hierarchical'
@description('Optional. Boolean to pause automatic runtime version upgrades to the cluster.')
param waveUpgradePaused bool = false

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

@description('Optional. Array of Service Fabric cluster application types.')
param applicationTypes array = []
Expand Down Expand Up @@ -403,6 +405,8 @@ output location string = serviceFabricCluster.location
// Definitions //
// =============== //

@export()
@description('The type for a certificate.')
type certificateType = {
@description('Required. The thumbprint of the primary certificate.')
thumbprint: string
Expand All @@ -420,11 +424,13 @@ type certificateType = {
| 'Root'
| 'TrustedPeople'
| 'TrustedPublisher')?
}?
}

@export()
@description('The type for a certificate common name.')
type certificateCommonNameType = {
@description('Required. The list of server certificates referenced by common name that are used to secure the cluster.')
commonNames: serverCertificateCommonNameType
commonNames: serverCertificateCommonNameType[]

@description('Optional. The local certificate store location.')
x509StoreName: (
Expand All @@ -436,16 +442,18 @@ type certificateCommonNameType = {
| 'Root'
| 'TrustedPeople'
| 'TrustedPublisher')?
}?
}

@description('The type for a server certificate common name.')
type serverCertificateCommonNameType = {
@description('Required. The common name of the server certificate.')
certificateCommonName: string

@description('Required. The issuer thumbprint of the server certificate.')
certificateIssuerThumbprint: string
}[]
}

@description('The type for a client certificate common name.')
type clientCertificateCommonNameType = {
@description('Required. The common name of the client certificate.')
certificateCommonName: string
Expand All @@ -455,46 +463,14 @@ type clientCertificateCommonNameType = {

@description('Required. Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster.')
isAdmin: bool
}[]?
}

@export()
@description('The type for a client certificate thumbprint.')
type clientCertificateThumbprintType = {
@description('Required. The thumbprint of the client certificate.')
certificateThumbprint: string

@description('Required. Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster.')
isAdmin: bool
}[]?

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?
}[]?
}
Loading

0 comments on commit a561e0e

Please sign in to comment.