-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
storage
- allow azurerm_storage_account
to be used in Data Plane restrictive environments
#27818
Conversation
matches features being back-ported to 3.x to allow users to migrate more easily.
var e pollers.PollingDroppedConnectionError | ||
if errors.As(err, &e) { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other two availability pollers return the PollingDroppedConnectionError
based on whether resp.HttpResponse == nil
. Can we not use the same pattern for checking here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the API call GetServiceProperties
does not return the same struct, and does not contain HttpResponse
, it instead returns the details and an error type. We check that error type here via errors.As()
to take the appropriate action.
internal/services/storage/storage_account_queue_properties_resource.go
Outdated
Show resolved
Hide resolved
internal/services/storage/storage_account_queue_properties_resource.go
Outdated
Show resolved
Hide resolved
internal/services/storage/storage_account_queue_properties_resource.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jackofallops, provided the tests in both 4.0 and 5.0 mode pass this looks good to me 🫎
This only works for storage accounts created or imported after "data_plane_available = false" is set, for existing storage accounts (even if the TF code doesn't include any queue_properties{}) it will need to be removed from the state file and reimported. If this is working as designed, a note about this limitation in the https://registry.terraform.io/providers/hashicorp/azurerm/4.9.0/docs/resources/storage_account docs would be helpful. |
(I'd left a comment on #27750, but commenting here too) - needing to re-import existing storage accounts is extremely non ideal for managing long lived resources - the more manual fiddling with terraform state you do, the easier it is to break something, and we use terraform to manage some fairly critical infratructure. If it is possible to make this upgradable with no special state manipulation (maybe warnings about any queue_properties or static_website blocks that would be lost if not migrated to the new types) that would be vastly preferable. 😄 |
Hi @joakimlemb You are correct, this was intended to be for newly created accounts, however, it is not necessary to set for existing accounts as the API calls to the Data Plane endpoints failing for reasons relating to network connection availability will now not fail the Terraform operation (create/read/update). This tolerance does come at the expense of deployment time, in that we have to perform retries to help protect against temporary failures, but ultimately fire-walled deployments unable to reach Data Plane URLs will still succeed. The I can see that the storage feature block is missing from the features documentation, so we'll get that added with an explanation as above. I'll take a look at making the feature flag compatible with existing storage accounts too, but I suspect that may potentially end up with a Diff that would need to be added to Hope this helps! |
It does, thank you for the detailed explanation. |
@jackofallops Thanks for the clarification on in intended behaviour! To make sure I understand - you're saying that taking 4.9.0 should allow deployment of storage accounts with no change to definitions other than the provider version? Should that also apply to terraform plan? I've just attempted to test this out, and I'm still seeing errors on terraform plan operations unfortunately.
|
Hi @bethforsyth - Apologies for the delay in response, I didn't get a notification for some reason! Correct, in every scenario (customer and theoretical) this was tested, this was the case. I see from the error you provided that you're using a link-local address for DNS resolution? Do you have a local (in the meantime, I'll check why I didn't get notified of your mention, and I'll keep popping back to this issue to check for replies. Sorry again about that!) |
Hello @jackofallops ! I tried to use the
Shoud I have misunderstood the purpose? OR normally with Thanks for your reply! |
Hi @joakimlemb ! Thanks for the tips... But, how to know which management features is concerned? @jackofallops , I tried another time by
please @jackofallops , teach me how to use your feature! |
Community Note
Description
This PR introduces functionality to allow the
azurerm_storage_account
resource to be deployed in situations that prohibit data plane access, such as Terraform agents that are behind restrictive Enterprise Firewalls.To preserve the ability to configure Data Plane only sections of the configuration, 2 new resources are introduced, these are
azurerm_storage_account_queue_properties
andazurerm_storage_account_static_website
. These are intended to supersede the (now deprecated)queue_properties
andstatic_website
blocks on theazurerm_storage_account
resource, these deprecated blocks are planned to be removed inv5.0
of the provider.Also introduced is the
data_plane_available
Provider Feature flag. This allows the provider to be globally configured to not use the data plane APIs at all forazurerm_storage_account
. The caveats are that the availability guarantees for the Data endpoints being ready are not available, and thequeue_properties
andstatic_website
blocks become incompatible configuration, and will error onplan
andapply
. To allow these blocks to still be configured, The 2 new sub-resources mentioned above can allow users to configure these items post-creation of the account, and if necessary, after the creation of Private Endpoints. See below for example usage of the flag in conjunction with PE's: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_account
- can now be created and managed if Data Plane endpoints are blocked by a firewallazurerm_storage_account_queue_properties
azurerm_storage_account_static_website
data_plane_available
feature flagThis is a (please select all that apply):
Depends on #27733
Closes #27750
Closes #27310
Closes #10765