azurerm_storage_queue - Support storage_account_id#28752
azurerm_storage_queue - Support storage_account_id#28752catriona-m merged 13 commits intohashicorp:mainfrom
azurerm_storage_queue - Support storage_account_id#28752Conversation
|
There probably wants a new For this reason, I want to use the function |
|
#28617 has been merged, I've merge this PR with Test💤 TF_ACC=1 go test -v -timeout=20h -parallel=20 -run='(TestAccStorageQueue_basic|TestAccDataSourceStorageQueue_basic)' ./internal/services/storage
=== RUN TestAccDataSourceStorageQueue_basic
=== PAUSE TestAccDataSourceStorageQueue_basic
=== RUN TestAccDataSourceStorageQueue_basicDeprecated
=== PAUSE TestAccDataSourceStorageQueue_basicDeprecated
=== RUN TestAccStorageQueue_basic
=== PAUSE TestAccStorageQueue_basic
=== RUN TestAccStorageQueue_basicDeprecated
=== PAUSE TestAccStorageQueue_basicDeprecated
=== RUN TestAccStorageQueue_basicAzureADAuth
=== PAUSE TestAccStorageQueue_basicAzureADAuth
=== RUN TestAccStorageQueue_basicAzureADAuthDeprecated
=== PAUSE TestAccStorageQueue_basicAzureADAuthDeprecated
=== CONT TestAccDataSourceStorageQueue_basic
=== CONT TestAccStorageQueue_basicDeprecated
=== CONT TestAccStorageQueue_basic
=== CONT TestAccDataSourceStorageQueue_basicDeprecated
=== CONT TestAccStorageQueue_basicAzureADAuthDeprecated
=== CONT TestAccStorageQueue_basicAzureADAuth
--- PASS: TestAccDataSourceStorageQueue_basicDeprecated (140.99s)
--- PASS: TestAccDataSourceStorageQueue_basic (149.40s)
--- PASS: TestAccStorageQueue_basicDeprecated (157.24s)
--- PASS: TestAccStorageQueue_basicAzureADAuth (158.77s)
--- PASS: TestAccStorageQueue_basic (161.06s)
--- PASS: TestAccStorageQueue_basicAzureADAuthDeprecated (170.97s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/storage 171.016s |
catriona-m
left a comment
There was a problem hiding this comment.
Hi @magodo thanks for submitting this. I had a look trough this and left a couple of comments inline. Since this is a deprecation, this will also need to be documented in the 5.0 guide. Also, I ran the tests with the 5.0 flag set to true and it looks like there are a couple of failures that will need investigating:
------- Stdout: -------
=== RUN TestAccStorageQueue_basic
=== PAUSE TestAccStorageQueue_basic
=== CONT TestAccStorageQueue_basic
testcase.go:173: Step 3/3 error running import: exit status 1
Error: parsing account "/subscriptions/*******/resourceGroups/acctestRG-250904123723260355/providers/Microsoft.Storage/storageAccounts/acctestaccj0iei/queueServices/default/queues/mysamplequeue-250904123723260355": expected the account "" to use a domain suffix of "core.windows.net"
--- FAIL: TestAccStorageQueue_basic (123.86s)
FAIL
| _, err := queues.ParseQueueID(id, storageDomainSuffix) | ||
| return err |
There was a problem hiding this comment.
can this be removed since this will happen anyway on line 47 if the conditions aren't met?
There was a problem hiding this comment.
This is actually a bug that the L47 meant to parse the id as an ARM id. This is why the v5.0 enabled test cases are failing. Thanks for pointing this out!
| r.Schema["resource_manager_id"] = &pluginsdk.Schema{ | ||
| Type: pluginsdk.TypeString, | ||
| Computed: true, | ||
| Deprecated: "this property has been deprecated in favour of `id` and will be removed in version 5.0 of the Provider.", |
There was a problem hiding this comment.
| Deprecated: "this property has been deprecated in favour of `id` and will be removed in version 5.0 of the Provider.", | |
| Deprecated: "the `resource_manager_id` property has been deprecated in favour of `id` and will be removed in version 5.0 of the Provider.", |
There was a problem hiding this comment.
Done (for both managed resource and data source).
| } | ||
|
|
||
| resource "azurerm_storage_queue" "test" { | ||
| name = "queuedstest-%[1]s" |
There was a problem hiding this comment.
| name = "queuedstest-%[1]s" | |
| name = "acctestqueuedstest-%[1]s" |
|
@catriona-m Thank you for your review! I've merged from 5.0 Enabledterraform-provider-azurerm on storage_account_id_for_queue_and_table via 🐹 v1.25.0 took 2m29s
💤 ARM_FIVEPOINTZERO_BETA=true TF_ACC=1 go test -v -run='TestAccStorageQueue_|TestAccDataSourceStorageQueue_' ./internal/services/storage
=== RUN TestAccDataSourceStorageQueue_basic
=== PAUSE TestAccDataSourceStorageQueue_basic
=== RUN TestAccDataSourceStorageQueue_basicDeprecated
storage_queue_data_source_test.go:35: skipping as not valid in 5.0
--- SKIP: TestAccDataSourceStorageQueue_basicDeprecated (0.00s)
=== RUN TestAccStorageQueue_basic
=== PAUSE TestAccStorageQueue_basic
=== RUN TestAccStorageQueue_basicDeprecated
storage_queue_resource_test.go:43: skipping as not valid in 5.0
--- SKIP: TestAccStorageQueue_basicDeprecated (0.00s)
=== RUN TestAccStorageQueue_basicAzureADAuth
=== PAUSE TestAccStorageQueue_basicAzureADAuth
=== RUN TestAccStorageQueue_basicAzureADAuthDeprecated
storage_queue_resource_test.go:78: skipping as not valid in 5.0
--- SKIP: TestAccStorageQueue_basicAzureADAuthDeprecated (0.00s)
=== RUN TestAccStorageQueue_requiresImport
=== PAUSE TestAccStorageQueue_requiresImport
=== RUN TestAccStorageQueue_requiresImportDeprecated
storage_queue_resource_test.go:112: skipping as not valid in 5.0
--- SKIP: TestAccStorageQueue_requiresImportDeprecated (0.00s)
=== RUN TestAccStorageQueue_metaData
=== PAUSE TestAccStorageQueue_metaData
=== RUN TestAccStorageQueue_metaDataDeprecated
storage_queue_resource_test.go:153: skipping as not valid in 5.0
--- SKIP: TestAccStorageQueue_metaDataDeprecated (0.00s)
=== CONT TestAccDataSourceStorageQueue_basic
=== CONT TestAccStorageQueue_requiresImport
=== CONT TestAccStorageQueue_metaData
=== CONT TestAccStorageQueue_basicAzureADAuth
=== CONT TestAccStorageQueue_basic
--- PASS: TestAccDataSourceStorageQueue_basic (86.36s)
--- PASS: TestAccStorageQueue_requiresImport (95.65s)
--- PASS: TestAccStorageQueue_basic (102.32s)
--- PASS: TestAccStorageQueue_basicAzureADAuth (107.03s)
--- PASS: TestAccStorageQueue_metaData (131.09s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/storage 131.197s
5.0 Disabledterraform-provider-azurerm on storage_account_id_for_queue_and_table via 🐹 v1.25.0 took 3m35s 💤 TF_ACC=1 go test -v -run='TestAccStorageQueue_|TestAccDataSourceStorageQueue_' ./internal/services/storage === RUN TestAccDataSourceStorageQueue_basic === PAUSE TestAccDataSourceStorageQueue_basic === RUN TestAccDataSourceStorageQueue_basicDeprecated === PAUSE TestAccDataSourceStorageQueue_basicDeprecated === RUN TestAccStorageQueue_basic === PAUSE TestAccStorageQueue_basic === RUN TestAccStorageQueue_basicDeprecated === PAUSE TestAccStorageQueue_basicDeprecated === RUN TestAccStorageQueue_basicAzureADAuth === PAUSE TestAccStorageQueue_basicAzureADAuth === RUN TestAccStorageQueue_basicAzureADAuthDeprecated === PAUSE TestAccStorageQueue_basicAzureADAuthDeprecated === RUN TestAccStorageQueue_requiresImport === PAUSE TestAccStorageQueue_requiresImport === RUN TestAccStorageQueue_requiresImportDeprecated === PAUSE TestAccStorageQueue_requiresImportDeprecated === RUN TestAccStorageQueue_metaData === PAUSE TestAccStorageQueue_metaData === RUN TestAccStorageQueue_metaDataDeprecated === PAUSE TestAccStorageQueue_metaDataDeprecated === CONT TestAccDataSourceStorageQueue_basic === CONT TestAccStorageQueue_basicAzureADAuthDeprecated === CONT TestAccStorageQueue_basicDeprecated === CONT TestAccStorageQueue_basic === CONT TestAccStorageQueue_metaData === CONT TestAccStorageQueue_metaDataDeprecated === CONT TestAccStorageQueue_basicAzureADAuth === CONT TestAccStorageQueue_requiresImportDeprecated === CONT TestAccDataSourceStorageQueue_basicDeprecated === CONT TestAccStorageQueue_requiresImport --- PASS: TestAccDataSourceStorageQueue_basic (128.15s) --- PASS: TestAccDataSourceStorageQueue_basicDeprecated (136.80s) --- PASS: TestAccStorageQueue_requiresImport (143.45s) --- PASS: TestAccStorageQueue_requiresImportDeprecated (146.10s) --- PASS: TestAccStorageQueue_basicAzureADAuth (146.38s) --- PASS: TestAccStorageQueue_basicDeprecated (146.89s) --- PASS: TestAccStorageQueue_basic (150.56s) --- PASS: TestAccStorageQueue_basicAzureADAuthDeprecated (157.17s) --- PASS: TestAccStorageQueue_metaDataDeprecated (197.80s) --- PASS: TestAccStorageQueue_metaData (202.20s) PASS ok github.com/hashicorp/terraform-provider-azurerm/internal/services/storage 202.336s The upgrade document is also updated to mention the deprecations. |
catriona-m
left a comment
There was a problem hiding this comment.
Thanks @magodo I spotted a couple of minor things on having another look through but once those are addressed this should be good. Thanks!
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
|
@catriona-m Thank you for taking another look! I've applied all the suggested commits! |
catriona-m
left a comment
There was a problem hiding this comment.
Thanks for fixing this up @magodo - LGTM!
|
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. |
Community Note
Description
This PR introduces the
storage_account_idto supersede thestorage_account_nameproperty intoazurerm_storage_queue. This allows the provider to create and manage the resource via the Resource Manager API rather than the Data Plane.Existing resources using the
storage_account_nameproperty cannot be migrated directly, but can be removed and re-imported using the Resource Manager ID type.The
storage_account_nameproperty is now deprecated and will be removed in v5.0 of the provider.The
resource_manager_idproperty is now deprecated and will be removed in v5.0 of the provider, this value is available as id in resources usingstorage_account_id.PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_storage_queue- Supportstorage_account_id[GH-00000]This is a (please select all that apply):
Related Issue(s)
Relating to #27733
Fixes #28562
Note
If this PR changes meaningfully during the course of review please update the title and description as required.