Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#24317: Support preferred_data_persistence_auth_method for azurerm_redis_cache resource #24370

Merged
merged 5 commits into from
Feb 16, 2024

Conversation

harshavmb
Copy link
Contributor

Support preferred_data_persistence_auth_method for azurerm_redis_cache resource.

Fixes #24317.

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @harshavmb thanks for submitting this. This is looking good so far but could we include this new property in the tests? Thanks!

@harshavmb
Copy link
Contributor Author

Hi @catriona-m ,

I've added the check now.

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @harshavmb thanks for updating this, however it looks like there is a test failure that needs to be addressed:

Test ended in panic.
------- Stdout: -------
=== RUN   TestAccRedisCacheDataSource_standard
=== PAUSE TestAccRedisCacheDataSource_standard
=== CONT  TestAccRedisCacheDataSource_standard
------- Stderr: -------
panic: Invalid address to set: []string{"redis_configuration", "0", "preferred_data_persistence_auth_method"}

@harshavmb
Copy link
Contributor Author

Hi @harshavmb thanks for updating this, however it looks like there is a test failure that needs to be addressed:

Test ended in panic.
------- Stdout: -------
=== RUN   TestAccRedisCacheDataSource_standard
=== PAUSE TestAccRedisCacheDataSource_standard
=== CONT  TestAccRedisCacheDataSource_standard
------- Stderr: -------
panic: Invalid address to set: []string{"redis_configuration", "0", "preferred_data_persistence_auth_method"}

Hi @catriona-m ,

I added a new test case for this field. Could you please retest & let me know if this worked?

Thanks,
Harsha

…ata_persistence_authentication_method as per review
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we still have a test failure:

Test ended in panic.

------- Stdout: -------
=== RUN   TestAccRedisCacheDataSource_standard
=== PAUSE TestAccRedisCacheDataSource_standard
=== CONT  TestAccRedisCacheDataSource_standard

------- Stderr: -------
panic: Invalid address to set: []string{"redis_configuration", "0", "data_persistence_authentication_method"}

goroutine 1978 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc004bdb580, {0x8bbfe5d, 0x13}, {0x78468c0, 0xc00137e570})
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:233 +0x2b5
github.com/hashicorp/terraform-provider-azurerm/internal/services/redis.dataSourceRedisCacheRead(0x0?, {0x7bd03a0?, 0xc003ef5680?})
	/opt/teamcity-agent/work/3337027aeff310bf/internal/services/redis/redis_cache_data_source.go:311 +0xf14
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x9442bc8?, {0x9442bc8?, 0xc002703a70?}, 0xd?, {0x7bd03a0?, 0xc003ef5680?})
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:783 +0x163
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc00109a1c0, {0x9442bc8, 0xc002703a70}, 0xc004bdb480, {0x7bd03a0, 0xc003ef5680})
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:1015 +0x149
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc003cee4c8, {0x9442bc8?, 0xc0027039e0?}, 0xc004eeb2e0)
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:1237 +0x366
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc00497a1e0, {0x9442bc8?, 0xc002703020?}, 0xc004876f50)
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go:699 +0x3df
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x87c5be0?, 0xc00497a1e0}, {0x9442bc8, 0xc002703020}, 0xc00506d650, 0x0)
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:503 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc002ec05a0, {0x9469ee0, 0xc0022ec000}, 0xc004c4fc20, 0xc0015d3020, 0xef91c28, 0x0)
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/google.golang.org/grpc/server.go:1374 +0xde7
google.golang.org/grpc.(*Server).handleStream(0xc002ec05a0, {0x9469ee0, 0xc0022ec000}, 0xc004c4fc20, 0x0)
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/google.golang.org/grpc/server.go:1751 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/google.golang.org/grpc/server.go:986 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 340
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/google.golang.org/grpc/server.go:997 +0x145```

@harshavmb
Copy link
Contributor Author

Thanks @katbyte ,

I paid bit more attention to the error message this time & found azurerm_redis_cache datasource having dependency on flattenRedisConfiguration function. I fixed the testcase. Logs from my run..

harsha@dev terraform-provider-azurerm % make acctests SERVICE='redis' TESTARGS='-run=TestAccRedisCacheDataSource_standard' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/redis -run=TestAccRedisCacheDataSource_standard -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccRedisCacheDataSource_standard
=== PAUSE TestAccRedisCacheDataSource_standard
=== CONT  TestAccRedisCacheDataSource_standard

--- PASS: TestAccRedisCacheDataSource_standard (1640.70s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/redis 1644.867s

@harshavmb harshavmb requested a review from katbyte February 16, 2024 13:12
Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @harshavmb, it looks like this test is passing now, thanks! LGTM!

@catriona-m catriona-m merged commit 2d58bd3 into hashicorp:main Feb 16, 2024
33 checks passed
@github-actions github-actions bot added this to the v3.93.0 milestone Feb 16, 2024
catriona-m added a commit that referenced this pull request Feb 16, 2024
@harshavmb harshavmb deleted the github-24317 branch February 20, 2024 13:42
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this pull request Feb 21, 2024
…zurerm_redis_cache resource (hashicorp#24370)

* hashicorp#24317: Support preferred_data_persistence_auth_method for azurerm_redis_cache resource

* hashicorp#24317: Changes as per review comments

* hashicorp#24317: Fix tests

* hashicorp#24317: renaming preferred_data_persistence_auth_method to data_persistence_authentication_method as per review

* hashicorp#24317: Fix azurerm_redis_cache data source
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this pull request Feb 21, 2024
lemeurherve pushed a commit to jenkins-infra/azure that referenced this pull request Feb 23, 2024
<Actions>
<action
id="f410411e63aff4bb73a81c2aec1d373cf8a903e63b30dee2006b0030d8a94cc8">
        <h3>Bump Terraform `azurerm` provider version</h3>
<details
id="1d9343c012f5434ac9fe8a98135bae3667b399259be16d9b14302ea3bd424a24">
            <summary>Update Terraform lock file</summary>
<p>changes detected:&#xA;&#x9;&#34;hashicorp/azurerm&#34; updated from
&#34;3.92.0&#34; to &#34;3.93.0&#34; in file
&#34;.terraform.lock.hcl&#34;</p>
            <details>
                <summary>3.93.0</summary>
<pre>Changelog retrieved
from:&#xA;&#x9;https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v3.93.0&#xA;*
**New Data Source**: `azurerm_express_route_circuit_peering`
([#24971](hashicorp/terraform-provider-azurerm#24971
**New Data Source**: `azurerm_storage_table_entities`
([#24973](hashicorp/terraform-provider-azurerm#24973
**New Resource**: `azurerm_dev_center_catalog`
([#24833](hashicorp/terraform-provider-azurerm#24833
**New Resource**: `azurerm_system_center_virtual_machine_manager_server`
([#24278](https://github.com/hashicorp/terraform-provider-azurerm/issues/24278))&#xA;&#xA;BUG
FIXES:&#xA;&#xA;* `azurerm_key_vault` - conditionally polling the Data
Plane endpoint when `public_network_access_enabled` is set to false
([#23823](hashicorp/terraform-provider-azurerm#23823
`azurerm_storage_account` - allow the `identity.type` property to be
`SystemAssigned, UserAssigned` when using a Customer Managed Key
([#24923](hashicorp/terraform-provider-azurerm#24923
`azurerm_automation_account` - prevent the `identity.identity_ids` User
Assigned identity being set when not specified in config
([#24977](https://github.com/hashicorp/terraform-provider-azurerm/issues/24977))&#xA;&#xA;ENHANCEMENTS:&#xA;&#xA;*
dependencies: updating to `v0.20240221.1170458` of
`hashicorp/go-azure-sdk`
([#24967](hashicorp/terraform-provider-azurerm#24967
dependencies: refactor `azurerm_spring_cloud_configuration_service` to
use `go-azure-sdk`
([#24918](hashicorp/terraform-provider-azurerm#24918
provider: support or the feature flag
`virtual_machine_scale_set.reimage_on_manual_upgrade`
([#22975](hashicorp/terraform-provider-azurerm#22975
`sentinel`: updating to use the transport layer from
`hashicorp/go-azure-sdk` rather than `Azure/go-autorest`
([#24962](hashicorp/terraform-provider-azurerm#24962
`sqlvirtualmachines`: updating to use the transport layer from
`hashicorp/go-azure-sdk` rather than `Azure/go-autorest`
([#24912](hashicorp/terraform-provider-azurerm#24912
`nginx` : updating to use `2024-01-01-preview`
([#24868](hashicorp/terraform-provider-azurerm#24868
`azurerm_cosmosdb_account` - support for the `backup.tier` property
([#24595](hashicorp/terraform-provider-azurerm#24595
`azurerm_linux_virtual_machine` - the `virtual_machine_scale_set_id`
proeprty can now be changed without creating a new resource
([#24768](hashicorp/terraform-provider-azurerm#24768
`azurerm_machine_learning_workspace` - support for the
`managed_network.isolation_mode` property
([#24951](hashicorp/terraform-provider-azurerm#24951
`azurerm_private_dns_resolver_inbound_endpoint` - support the `static`
value for the `private_ip_allocation_method` property
([#24952](hashicorp/terraform-provider-azurerm#24952
`azurerm_postgresql_flexible_server` - expose the `storage_tier` field
([#24892](hashicorp/terraform-provider-azurerm#24892
`azurerm_redis_cache` - support for the
`preferred_data_persistence_auth_method` property
([#24370](hashicorp/terraform-provider-azurerm#24370
`azurerm_servicebus_namespace` - support for the
`premium_messaging_partitions` property
([#24676](hashicorp/terraform-provider-azurerm#24676
`azurerm_windows_virtual_machine` - the `virtual_machine_scale_set_id`
proeprty can now be changed without creating a new resource
([#24768](https://github.com/hashicorp/terraform-provider-azurerm/issues/24768))&#xA;&#xA;BUG
FIXES:&#xA;&#xA;* `azurerm_cognitive_deployment` - the
`version_upgrade_option` property can not be updated without creating a
new resource
([#24922](hashicorp/terraform-provider-azurerm#24922
`azurerm_data_protection_backup_vault` - support or the `soft_delete`
and `retention_duration_in_days` properties
([#24775](hashicorp/terraform-provider-azurerm#24775
`azurerm_data_factory_pipeline` - correctly handle incorrect header
values
([#24921](hashicorp/terraform-provider-azurerm#24921
`azurerm_kusto_cluster` - `optimized_auto_scale` is now updated after
`sku` has been updated
([#24906](hashicorp/terraform-provider-azurerm#24906
`azurerm_key_vault_certificate` - will now only update the
`lifetime_action` of the certificate block unless otherwise required
([#24755](hashicorp/terraform-provider-azurerm#24755
`azurerm_linux_virtual_machine_scale_set` - correctly include
`public_ip_prefix_id` during updates
([#24939](hashicorp/terraform-provider-azurerm#24939
`azurerm_postgresql_flexible_server` - the
`customer_managed_key.key_vault_key_id` property is now required
([#24981](hashicorp/terraform-provider-azurerm#24981
`azurerm_nginx_deployment` - changing the `sku` property now creates a
new resource
([#24905](hashicorp/terraform-provider-azurerm#24905
`azurerm_orchestrated_virtual_machine_scale_set` - the `disk_size_gb`
and `lun` parameters of `data_disks` are optional now
([#24944](hashicorp/terraform-provider-azurerm#24944
`azurerm_storage_account` - change order of API calls to be GET-then-PUT
ratehr then PATCHES
([#23935](hashicorp/terraform-provider-azurerm#23935
`azurerm_storage_account` - improve the validation around the
`immutability_policy` being used with `blob_properties`
([#24938](hashicorp/terraform-provider-azurerm#24938
`azurerm_security_center_setting` - prevent a bug when name is
`SENTINEL`
([#24497](hashicorp/terraform-provider-azurerm#24497
`azurerm_windows_virtual_machine_scale_set` - correctly include
`public_ip_prefix_id` during updates
([#24939](https://github.com/hashicorp/terraform-provider-azurerm/issues/24939))&#xA;&#xA;&#xA;&#xA;&#xA;</pre>
            </details>
        </details>
<a
href="https://infra.ci.jenkins.io/job/updatecli/job/azure/job/main/19/">Jenkins
pipeline link</a>
    </action>
</Actions>

---

<table>
  <tr>
    <td width="77">
<img src="https://www.updatecli.io/images/updatecli.png" alt="Updatecli
logo" width="50" height="50">
    </td>
    <td>
      <p>
Created automatically by <a
href="https://www.updatecli.io/">Updatecli</a>
      </p>
      <details><summary>Options:</summary>
        <br />
<p>Most of Updatecli configuration is done via <a
href="https://www.updatecli.io/docs/prologue/quick-start/">its
manifest(s)</a>.</p>
        <ul>
<li>If you close this pull request, Updatecli will automatically reopen
it, the next time it runs.</li>
<li>If you close this pull request and delete the base branch, Updatecli
will automatically recreate it, erasing all previous commits made.</li>
        </ul>
        <p>
Feel free to report any issues at <a
href="https://github.com/updatecli/updatecli/issues">github.com/updatecli/updatecli</a>.<br
/>
If you find this tool useful, do not hesitate to star <a
href="https://github.com/updatecli/updatecli/stargazers">our GitHub
repository</a> as a sign of appreciation, and/or to tell us directly on
our <a
href="https://matrix.to/#/#Updatecli_community:gitter.im">chat</a>!
        </p>
      </details>
    </td>
  </tr>
</table>

Co-authored-by: Jenkins Infra Bot (updatecli) <60776566+jenkins-infra-bot@users.noreply.github.com>
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this pull request Feb 29, 2024
…zurerm_redis_cache resource (hashicorp#24370)

* hashicorp#24317: Support preferred_data_persistence_auth_method for azurerm_redis_cache resource

* hashicorp#24317: Changes as per review comments

* hashicorp#24317: Fix tests

* hashicorp#24317: renaming preferred_data_persistence_auth_method to data_persistence_authentication_method as per review

* hashicorp#24317: Fix azurerm_redis_cache data source
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this pull request Feb 29, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for "preferred_data_persistence_auth_method" in Azure Redis Cache Configuration
4 participants