Skip to content

Commit 94b3907

Browse files
committed
Merge remote-tracking branch 'origin/main' into apex/cloudhsm
2 parents 43f0bf5 + 0454745 commit 94b3907

File tree

877 files changed

+15066
-2821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

877 files changed

+15066
-2821
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ jobs:
123123
- get-go-version
124124
- set-product-version
125125
runs-on: custom-ubuntu-22.04-medium
126+
if: github.repository_owner == 'hashicorp'
127+
timeout-minutes: 10
126128
strategy:
127129
fail-fast: true
128130
# Verify expected Artifacts list for a workflow run.
@@ -184,4 +186,4 @@ jobs:
184186
echo "### What's next?" >> "$GITHUB_STEP_SUMMARY"
185187
echo "#### For a release branch (see \`.release/ci.hcl\`)" >> $GITHUB_STEP_SUMMARY
186188
echo "After this \`build\` workflow run completes succesfully, you can expect the CRT \`prepare\` workflow to begin momentarily." >> "$GITHUB_STEP_SUMMARY"
187-
echo "To find the \`prepare\` workflow run, [view the checks for this commit]($github_dot_com/$owner_with_name/commits/$ref)" >> "$GITHUB_STEP_SUMMARY"
189+
echo "To find the \`prepare\` workflow run, [view the checks for this commit]($github_dot_com/$owner_with_name/commits/$ref)" >> "$GITHUB_STEP_SUMMARY"

.github/workflows/comment-failure.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Get run url
12-
if: failure()
1312
run: |
1413
echo "gha_url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" >> $GITHUB_ENV
1514
- name: Send build failure comment
16-
if: failure()
1715
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
1816
with:
1917
result-encoding: string
@@ -23,4 +21,4 @@ jobs:
2321
owner: context.repo.owner,
2422
repo: context.repo.repo,
2523
body: '<b>Build failure</b> \n\n This pull request contains a build failure which needs addressed [here](${{ env.gha_url}}) .'
26-
})
24+
})

.github/workflows/preview-api-version-linter.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Preview ARM API Version Linter
33

44
permissions:
55
contents: read
6-
pull-requests: read
6+
pull-requests: write
77

88
on:
99
pull_request:
@@ -23,5 +23,6 @@ jobs:
2323
go-version-file: ./.go-version
2424
- run: go run internal/tools/preview-api-version-linter/main.go
2525
comment-on-fail:
26-
if: ${{ needs.depscheck.result }} == 'failure'
27-
uses: ./.github/workflows/comment-failure.yaml
26+
needs: preview-api-version-linter
27+
if: ${{ failure() }}
28+
uses: ./.github/workflows/comment-failure.yaml

.github/workflows/provider-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
go-version-file: ./.go-version
4545

4646
- name: Azure CLI login (using OIDC)
47-
uses: azure/login@v1
47+
uses: azure/login@cb79c773a3cfa27f31f25eb3f677781210c9ce3d # v1.6.1
4848
with:
4949
client-id: ${{ secrets.ARM_CLIENT_ID }}
5050
tenant-id: ${{ secrets.ARM_TENANT_ID }}

.github/workflows/shellcheck.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: ShellCheck Scripts
3+
4+
permissions:
5+
contents: read
6+
7+
on:
8+
pull_request:
9+
types: ['opened', 'synchronize']
10+
paths:
11+
- '.github/workflows/shellcheck.yaml'
12+
- 'scripts/**'
13+
14+
concurrency:
15+
group: 'shellcheck-${{ github.head_ref }}'
16+
cancel-in-progress: true
17+
18+
jobs:
19+
shellcheck:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- name: Run ShellCheck
24+
run: make shellcheck
25+
save-artifacts-on-fail:
26+
needs: shellcheck
27+
if: ${{ failure() }}
28+
uses: ./.github/workflows/save-artifacts.yaml
29+
comment-on-fail:
30+
needs: shellcheck
31+
if: ${{ failure() }}
32+
uses: ./.github/workflows/comment-failure.yaml

.release/provider-schema.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 4.59.0 (February 06, 2026)
2+
3+
ENHANCEMENTS:
4+
5+
* dependencies: `go-azure-sdk` - update to `v0.20260129.1200123` ([#31621](https://github.com/hashicorp/terraform-provider-azurerm/issues/31621))
6+
* `azurerm_automation_runbook` - add support for the `runtime_environment_name` property ([#30992](https://github.com/hashicorp/terraform-provider-azurerm/issues/30992))
7+
* `azurerm_kusto_eventgrid_data_connection` - update validation for `eventhub_consumer_group_name` to allow `$Default` as input ([#31551](https://github.com/hashicorp/terraform-provider-azurerm/issues/31551))
8+
* `azurerm_linux_function_app` - add support for `3.14` to `site_config.application_stack.python_version` ([#31195](https://github.com/hashicorp/terraform-provider-azurerm/issues/31195))
9+
* `azurerm_linux_function_app_slot` - add support for `3.14` to `site_config.application_stack.python_version` ([#31195](https://github.com/hashicorp/terraform-provider-azurerm/issues/31195))
10+
* `azurerm_netapp_volume_group_sap_hana_resource` - add support for `zone`, `encryption_key_source`, `key_vault_private_endpoint_id`, and `network_features` ([#31603](https://github.com/hashicorp/terraform-provider-azurerm/issues/31603))
11+
* `azurerm_user_assigned_identity` - add support for the `isolation_scope` property ([#31216](https://github.com/hashicorp/terraform-provider-azurerm/issues/31216))
12+
13+
BUG FIXES:
14+
15+
* `azurerm_kubernetes_cluster` - the`network_policy` property now allows updating from `calico` to `cilium` ([#31627](https://github.com/hashicorp/terraform-provider-azurerm/issues/31627))
16+
* `azurerm_logic_app_trigger_http_request` - fix an issue that prevented importing existing resources due to empty trigger inputs ([#31433](https://github.com/hashicorp/terraform-provider-azurerm/issues/31433))
17+
118
## 4.58.0 (January 22, 2026)
219

320
FEATURES:

GNUmakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ goimports:
5454
lint:
5555
@golangci-lint run -v ./...
5656

57+
shellcheck:
58+
@command -v shellcheck >/dev/null || (echo "shellcheck not installed. Install via: brew install shellcheck (macOS) or apt install shellcheck (Linux)" && exit 1)
59+
@echo "==> Checking shell scripts with shellcheck..."
60+
@shellcheck scripts/*.sh
61+
5762
depscheck:
5863
@echo "==> Checking dependencies.."
5964
@./scripts/track2-check.sh

contributing/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ More granular documentation covers how these fit together - and the most common
3030

3131
* [Adding a new Service Package](topics/guide-new-service-package.md)
3232
* [Adding a new Resource](topics/guide-new-resource.md)
33+
* [Adding a new List Resource](topics/guide-list-resource.md)
3334
* [Adding a new Data Source](topics/guide-new-data-source.md)
3435
* [When to create a new Resource vs Inline Block](topics/guide-new-resource-vs-inline.md)
3536

contributing/topics/guide-list-resource.md

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -143,42 +143,24 @@ Before adding a List Resource, the resource must have Resource Identity implemen
143143
// Set the ID of the resource for the ResourceData object
144144
id, err := networkprofiles.ParseNetworkProfileID(pointer.From(profile.Id))
145145
if err != nil {
146-
sdk.SetListIteratorErrorDiagnostic(result, push, "parsing Network Profile ID", err)
146+
sdk.SetErrorDiagnosticAndPushListResult(result, push, "parsing Network Profile ID", err)
147147
return
148148
}
149149
rd.SetId(id.ID())
150150
151151
// Use the resource flatten function to set the attributes into the resource state
152152
if err := resourceNetworkProfileFlatten(rd, id, &profile); err != nil {
153-
sdk.SetListIteratorErrorDiagnostic(result, push, fmt.Sprintf("encoding `%s` resource data", azureNetworkProfileResourceName), err)
153+
sdk.SetErrorDiagnosticAndPushListResult(result, push, fmt.Sprintf("encoding `%s` resource data", azureNetworkProfileResourceName), err)
154154
return
155155
}
156156
157-
// Convert and set the identity and resource state into the result
158-
tfTypeIdentity, err := rd.TfTypeIdentityState()
159-
if err != nil {
160-
sdk.SetListIteratorErrorDiagnostic(result, push, "converting Identity State", err)
161-
return
162-
}
163-
164-
if err := result.Identity.Set(ctx, *tfTypeIdentity); err != nil {
165-
sdk.SetListIteratorErrorDiagnostic(result, push, "setting Identity Data", err)
166-
return
167-
}
168-
169-
// Convert and set the resource state into the result
170-
tfTypeResourceState, err := rd.TfTypeResourceState()
171-
if err != nil {
172-
sdk.SetListIteratorErrorDiagnostic(result, push, "converting Resource State", err)
173-
return
174-
}
175-
176-
if err := result.Resource.Set(ctx, *tfTypeResourceState); err != nil {
177-
sdk.SetListIteratorErrorDiagnostic(result, push, "setting Resource Data", err)
178-
return
179-
}
180-
181-
// Send the result to the stream
157+
// Convert and set the identity and resource state into the result
158+
sdk.EncodeListResult(ctx, rd, &result)
159+
if result.Diagnostics.HasError() {
160+
push(result)
161+
return
162+
}
163+
182164
if !push(result) {
183165
return
184166
}
@@ -189,7 +171,7 @@ Before adding a List Resource, the resource must have Resource Identity implemen
189171
190172
5. Register the new List Resource
191173
192-
List Resources are registered within the `registration.go` within each Service Package - and should look something like this:
174+
List Resources are registered within the `registration.go` within each Service Package - and should look something like this:
193175
194176
```
195177
package network
@@ -212,9 +194,9 @@ List Resources are registered within the `registration.go` within each Service P
212194
213195
6. Add Acceptance Tests for this List Resource
214196
215-
Create a new acceptance test file for the List Resource (for example, `network_profile_resource_list_test.go`) and add tests to cover the List Resource functionality. The test should provision any prerequisite resources and multiple resources of the type of List Resource we want to test.
216-
217-
The test should look something like this:
197+
Create a new acceptance test file for the List Resource (for example, `network_profile_resource_list_test.go`) and add tests to cover the List Resource functionality. The test should provision any prerequisite resources and multiple resources of the type of List Resource we want to test.
198+
199+
The test should look something like this:
218200
219201
```
220202
package network_test
@@ -346,9 +328,9 @@ The test should look something like this:
346328
347329
7. Add documentation for this List Resource
348330
349-
Documentation should be written manually and added to the `./website/docs/list-resources/` folder.
350-
351-
It should include an example, arguments reference, and look something like this:
331+
Documentation should be written manually and added to the `./website/docs/list-resources/` folder.
332+
333+
It should include an example, arguments reference, and look something like this:
352334
353335
````markdown
354336
---
@@ -392,4 +374,36 @@ It should include an example, arguments reference, and look something like this:
392374
* `resource_group_name` - (Optional) The name of the resource group to query.
393375
394376
* `subscription_id` - (Optional) The Subscription ID to query. Defaults to the value specified in the Provider Configuration.
395-
````
377+
````
378+
379+
## Known Issues and Considerations
380+
381+
### Cancelled Context
382+
383+
Some resources need to send additional API requests in the flatten function, these API requests require a valid context (i.e. not cancelled or done). However, due to the way the List resources function, the context provided will be cancelled by the time Terraform calls the iterator (`stream.Results`).
384+
385+
In this scenario, you must instantiate a new context within the iterator using the deadline from the provided context, this should look like the below:
386+
387+
```go
388+
func (r ExampleListResource) List(ctx context.Context, request list.ListRequest, stream *list.ListResultsStream, metadata sdk.ResourceMetadata) {
389+
...
390+
391+
// retrieve the deadline from the supplied context
392+
deadline, ok := ctx.Deadline()
393+
if !ok {
394+
// This *should* never happen given the List Wrapper instantiates a context with a timeout
395+
sdk.SetResponseErrorDiagnostic(stream, "internal-error", "context had no deadline")
396+
return
397+
}
398+
399+
stream.Result = func(push func(list.ListResult) bool) {
400+
// Instantiate a new context based on the deadline retrieved earlier
401+
ctx, cancel := context.WithDeadline(context.Background(), deadline)
402+
defer cancel()
403+
404+
for _, example := range results {
405+
// Remaining logic to retrieve and set the resource data
406+
}
407+
}
408+
}
409+
```

0 commit comments

Comments
 (0)