Skip to content

Commit

Permalink
feat: Added types to avm/res/cdn/profile module (Azure#3728)
Browse files Browse the repository at this point in the history
## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes Azure#3727 

-->

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.cdn.profile](https://github.com/anderseide/avm-bicep-registry-modules/actions/workflows/avm.res.cdn.profile.yml/badge.svg?branch=types-avm-res-cdn-profile)](https://github.com/anderseide/avm-bicep-registry-modules/actions/workflows/avm.res.cdn.profile.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.
- [X] 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`.
  - [X] Update to documentation

## Checklist

- [X] I'm sure there are no other open Pull Requests for the same
update/change
- [X] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [X] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
anderseide authored Nov 14, 2024
1 parent 34cff93 commit 72199cd
Show file tree
Hide file tree
Showing 24 changed files with 4,002 additions and 257 deletions.
681 changes: 681 additions & 0 deletions avm/res/cdn/profile/README.md

Large diffs are not rendered by default.

199 changes: 199 additions & 0 deletions avm/res/cdn/profile/afdEndpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,205 @@ The list of routes for this AFD Endpoint.
- Required: No
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-routesname) | string | The name of the route. |
| [`originGroupName`](#parameter-routesorigingroupname) | string | The name of the origin group. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`cacheConfiguration`](#parameter-routescacheconfiguration) | object | The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object. |
| [`customDomainNames`](#parameter-routescustomdomainnames) | array | The names of the custom domains. |
| [`enabledState`](#parameter-routesenabledstate) | string | Whether to enable use of this rule. |
| [`forwardingProtocol`](#parameter-routesforwardingprotocol) | string | The protocol this rule will use when forwarding traffic to backends. |
| [`httpsRedirect`](#parameter-routeshttpsredirect) | string | Whether to automatically redirect HTTP traffic to HTTPS traffic. |
| [`linkToDefaultDomain`](#parameter-routeslinktodefaultdomain) | string | Whether this route will be linked to the default endpoint domain. |
| [`originPath`](#parameter-routesoriginpath) | string | A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. |
| [`patternsToMatch`](#parameter-routespatternstomatch) | array | The route patterns of the rule. |
| [`ruleSets`](#parameter-routesrulesets) | array | The rule sets of the rule. |
| [`supportedProtocols`](#parameter-routessupportedprotocols) | array | The supported protocols of the rule. |

### Parameter: `routes.name`

The name of the route.

- Required: Yes
- Type: string

### Parameter: `routes.originGroupName`

The name of the origin group.

- Required: Yes
- Type: string

### Parameter: `routes.cacheConfiguration`

The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.

- Required: No
- Type: object

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`compressionSettings`](#parameter-routescacheconfigurationcompressionsettings) | object | Compression settings. |
| [`queryParameters`](#parameter-routescacheconfigurationqueryparameters) | string | Query parameters to include or exclude (comma separated). |
| [`queryStringCachingBehavior`](#parameter-routescacheconfigurationquerystringcachingbehavior) | string | Defines how Frontdoor caches requests that include query strings. |

### Parameter: `routes.cacheConfiguration.compressionSettings`

Compression settings.

- Required: Yes
- Type: object

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`contentTypesToCompress`](#parameter-routescacheconfigurationcompressionsettingscontenttypestocompress) | array | List of content types on which compression applies. The value should be a valid MIME type. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`iscontentTypeToCompressAll`](#parameter-routescacheconfigurationcompressionsettingsiscontenttypetocompressall) | bool | Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. |

### Parameter: `routes.cacheConfiguration.compressionSettings.contentTypesToCompress`

List of content types on which compression applies. The value should be a valid MIME type.

- Required: Yes
- Type: array

### Parameter: `routes.cacheConfiguration.compressionSettings.iscontentTypeToCompressAll`

Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.

- Required: No
- Type: bool

### Parameter: `routes.cacheConfiguration.queryParameters`

Query parameters to include or exclude (comma separated).

- Required: Yes
- Type: string

### Parameter: `routes.cacheConfiguration.queryStringCachingBehavior`

Defines how Frontdoor caches requests that include query strings.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'IgnoreQueryString'
'IgnoreSpecifiedQueryStrings'
'IncludeSpecifiedQueryStrings'
'UseQueryString'
]
```

### Parameter: `routes.customDomainNames`

The names of the custom domains.

- Required: No
- Type: array

### Parameter: `routes.enabledState`

Whether to enable use of this rule.

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

### Parameter: `routes.forwardingProtocol`

The protocol this rule will use when forwarding traffic to backends.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'HttpOnly'
'HttpsOnly'
'MatchRequest'
]
```

### Parameter: `routes.httpsRedirect`

Whether to automatically redirect HTTP traffic to HTTPS traffic.

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

### Parameter: `routes.linkToDefaultDomain`

Whether this route will be linked to the default endpoint domain.

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

### Parameter: `routes.originPath`

A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.

- Required: No
- Type: string

### Parameter: `routes.patternsToMatch`

The route patterns of the rule.

- Required: No
- Type: array

### Parameter: `routes.ruleSets`

The rule sets of the rule.

- Required: No
- Type: array

### Parameter: `routes.supportedProtocols`

The supported protocols of the rule.

- Required: No
- Type: array

### Parameter: `tags`

The tags of the AFD Endpoint.
Expand Down
26 changes: 25 additions & 1 deletion avm/res/cdn/profile/afdEndpoint/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ param autoGeneratedDomainNameLabelScope string = 'TenantReuse'
param enabledState string = 'Enabled'

@description('Optional. The list of routes for this AFD Endpoint.')
param routes array?
param routes routeType[]?

resource profile 'Microsoft.Cdn/profiles@2023-05-01' existing = {
name: profileName
Expand Down Expand Up @@ -84,3 +84,27 @@ output location string = afdEndpoint.location

@description('The list of routes assigned to the AFD endpoint.')
output routes array = routes ?? []

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

import { routeType } from './route/main.bicep'

@export()
type afdEndpointType = {
@description('Required. The name of the AFD Endpoint.')
name: string

@description('Optional. The list of routes for this AFD Endpoint.')
routes: routeType[]?

@description('Optional. The tags for the AFD Endpoint.')
tags: object?

@description('Optional. The scope of the auto-generated domain name label.')
autoGeneratedDomainNameLabelScope: 'NoReuse' | 'ResourceGroupReuse' | 'SubscriptionReuse' | 'TenantReuse' | null

@description('Optional. The state of the AFD Endpoint.')
enabledState: 'Enabled' | 'Disabled' | null
}
Loading

0 comments on commit 72199cd

Please sign in to comment.