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

azurerm_subnet_service_endpoint_policy - add support for service property #21865

Merged

Conversation

bubbletroubles
Copy link
Contributor

@bubbletroubles bubbletroubles commented May 20, 2023

Fixes #14852

  • Adds a new property "service" to specify if it's a Microsoft.Storage or Global service type.
  • new property is optional and defaults to Microsoft.Storage to ensure it's not a breaking change
  • Updated documentation
  • Added new tests to validate that Storage or Global (e.g. Aliases) or both can be assigned.

@bubbletroubles
Copy link
Contributor Author

Tests are passing

2023-05-21T11:55:49.6288955Z ========================== Starting Command Output ===========================
2023-05-21T11:55:49.6309675Z [command]/usr/bin/bash /home/vsts/work/_temp/cdcd9b85-c805-4530-870f-60ddcd4f3a16.sh
2023-05-21T11:55:49.6418916Z ==> Checking that code complies with gofmt requirements...
2023-05-21T11:55:53.4153720Z ==> Checking that Custom Timeouts are used...
2023-05-21T11:55:59.6109793Z ==> Checking that acceptance test packages are used...
2023-05-21T11:56:01.0537335Z TF_ACC=1 go test -v ./internal/services/network -run=TestAccSubnetServiceEndpointStoragePolicy -timeout 600m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
2023-05-21T12:05:29.2385802Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_basic
2023-05-21T12:05:29.2468592Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_basic
2023-05-21T12:05:29.2468939Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_complete
2023-05-21T12:05:29.2469134Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_complete
2023-05-21T12:05:29.2469550Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_alias
2023-05-21T12:05:29.2469959Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_alias
2023-05-21T12:05:29.2494120Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_storage
2023-05-21T12:05:29.2494323Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_storage
2023-05-21T12:05:29.2498411Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_update_complete
2023-05-21T12:05:29.2498670Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_update_complete
2023-05-21T12:05:29.2498875Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_update_alias
2023-05-21T12:05:29.2499127Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_update_alias
2023-05-21T12:05:29.2499379Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_update_storage
2023-05-21T12:05:29.2499578Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_update_storage
2023-05-21T12:05:29.2499833Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_requiresImport
2023-05-21T12:05:29.2500085Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_requiresImport
2023-05-21T12:05:29.2500275Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_basic
2023-05-21T12:05:29.2500649Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_update_complete
2023-05-21T12:06:34.1181566Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_basic (64.93s)
2023-05-21T12:06:34.1182290Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_requiresImport
2023-05-21T12:07:36.3235951Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_requiresImport (62.21s)
2023-05-21T12:07:36.3236340Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_update_storage
2023-05-21T12:09:49.6681173Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_update_storage (133.35s)
2023-05-21T12:09:49.6682184Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_update_alias
2023-05-21T12:10:14.0184144Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_update_complete (284.84s)
2023-05-21T12:10:14.0194292Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_alias
2023-05-21T12:11:24.4499404Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_alias (70.43s)
2023-05-21T12:11:24.4499923Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_storage
2023-05-21T12:11:44.5465521Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_update_alias (114.88s)
2023-05-21T12:11:44.5466445Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_complete
2023-05-21T12:12:53.6146295Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_storage (89.17s)
2023-05-21T12:13:08.5561750Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_complete (84.01s)
2023-05-21T12:13:08.5562085Z PASS
2023-05-21T12:13:08.5716524Z ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/network	459.402s
2023-05-21T12:13:09.9427702Z ##[section]Finishing: make acctests

@bubbletroubles bubbletroubles marked this pull request as ready for review May 21, 2023 12:16
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.

thanks for the pr @bubbletroubles, overall this looks good with one minor comment that needs addressing. once done this should be good to merge

serviceResource = []interface{}{}
)
if b := e.ServiceEndpointPolicyDefinitionPropertiesFormat; b != nil {
if b.Description != nil {
description = *b.Description
}
serviceResource = utils.FlattenStringSlice(b.ServiceResources)
service = *b.Service
Copy link
Collaborator

Choose a reason for hiding this comment

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

we'll need to nil check this to prevent a possible panic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @katbyte , I've updated the PR to include the nil check. Ready for re-review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also tests are passing with the new change

2023-05-24T20:45:17.9407850Z TF_ACC=1 go test -v ./internal/services/network -run=TestAccSubnetServiceEndpointStoragePolicy -timeout 600m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
2023-05-24T20:54:06.5311822Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_basic
2023-05-24T20:54:06.5381341Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_basic
2023-05-24T20:54:06.5381709Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_complete
2023-05-24T20:54:06.5388551Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_complete
2023-05-24T20:54:06.5388837Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_alias
2023-05-24T20:54:06.5389080Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_alias
2023-05-24T20:54:06.5408502Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_storage
2023-05-24T20:54:06.5408713Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_storage
2023-05-24T20:54:06.5413236Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_update_complete
2023-05-24T20:54:06.5416648Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_update_complete
2023-05-24T20:54:06.5416911Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_update_alias
2023-05-24T20:54:06.5421280Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_update_alias
2023-05-24T20:54:06.5421535Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_update_storage
2023-05-24T20:54:06.5421737Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_update_storage
2023-05-24T20:54:06.5425504Z === RUN   TestAccSubnetServiceEndpointStoragePolicy_requiresImport
2023-05-24T20:54:06.5425781Z === PAUSE TestAccSubnetServiceEndpointStoragePolicy_requiresImport
2023-05-24T20:54:06.5425975Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_complete
2023-05-24T20:54:06.5428658Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_basic
2023-05-24T20:55:16.9782811Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_basic (70.55s)
2023-05-24T20:55:16.9783535Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_requiresImport
2023-05-24T20:55:44.4541566Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_complete (96.94s)
2023-05-24T20:55:44.4589388Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_update_storage
2023-05-24T20:56:10.8374144Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_requiresImport (53.86s)
2023-05-24T20:56:10.8374904Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_update_alias
2023-05-24T20:57:54.2944634Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_update_storage (130.93s)
2023-05-24T20:57:54.2945014Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_update_complete
2023-05-24T20:58:08.6247642Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_update_alias (117.79s)
2023-05-24T20:58:08.6290260Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_storage
2023-05-24T20:59:31.7616736Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_storage (83.14s)
2023-05-24T20:59:31.7617452Z === CONT  TestAccSubnetServiceEndpointStoragePolicy_alias
2023-05-24T21:00:06.6398108Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_update_complete (132.35s)
2023-05-24T21:00:39.3536489Z --- PASS: TestAccSubnetServiceEndpointStoragePolicy_alias (67.59s)
2023-05-24T21:00:39.3537168Z PASS
2023-05-24T21:00:39.3641724Z ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/network	392.953s
2023-05-24T21:00:40.8266243Z ##[section]Finishing: make acctests

@bubbletroubles bubbletroubles requested a review from katbyte May 25, 2023 22:51
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.

Thanks @bubbletroubles - LGTM 🏖️

@katbyte katbyte changed the title azurerm_subnet_service_endpoint_policy - add support for Aliases azurerm_subnet_service_endpoint_policy - add support for service property May 26, 2023
@katbyte katbyte merged commit 2d65726 into hashicorp:main May 26, 2023
@github-actions github-actions bot added this to the v3.58.0 milestone May 26, 2023
katbyte added a commit that referenced this pull request May 26, 2023
@bubbletroubles bubbletroubles deleted the storage_service_endpoint_policy_release branch May 26, 2023 00:28
@github-actions
Copy link

This functionality has been released in v3.58.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

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 May 29, 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 alias definitions in service endpoint policies
2 participants