Skip to content

Updated flexible_server_sku_name.go to support Standard_DCads series#31004

Closed
tejeshwara1 wants to merge 1 commit intohashicorp:mainfrom
tejeshwara1:main
Closed

Updated flexible_server_sku_name.go to support Standard_DCads series#31004
tejeshwara1 wants to merge 1 commit intohashicorp:mainfrom
tejeshwara1:main

Conversation

@tejeshwara1
Copy link
Copy Markdown

Added support to DC series

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

Add support to DC series of VMs

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_resource - support for the azurerm_postgresql_flexible_server sku_name

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #0000

AI Assistance Disclosure

  • AI Assisted - This contribution was made by, or with the assistance of, AI/LLMs

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

Added support to DC series
@tejeshwara1 tejeshwara1 requested review from a team, WodansSon and magodo as code owners October 31, 2025 17:59
@tejeshwara1 tejeshwara1 changed the title Update flexible_server_sku_name.go Updated flexible_server_sku_name.go to support Standard_DC series Oct 31, 2025
@tejeshwara1 tejeshwara1 changed the title Updated flexible_server_sku_name.go to support Standard_DC series Updated flexible_server_sku_name.go to support Standard_DCads series Oct 31, 2025
@maxhro

This comment was marked as off-topic.

@toddgiguere toddgiguere self-assigned this Apr 2, 2026
}

if !regexp.MustCompile(`^((B_Standard_B((1|2|4|8|12|16|20)ms|2s))|(GP_Standard_D(((2|4|8|16|32|48|64)s_v3)|((2|4|8|16|32|48|64)ds_v4)|((2|4|8|16|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5)))|(MO_Standard_E((((2|4|8|16|20|32|48|64)s)_v3)|((2|4|6|8|16|20|32|48|64)ds_v4)|((2|4|8|16|20|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5))))$`).MatchString(v) {
if !regexp.MustCompile(`^((B_Standard_B((1|2|4|8|12|16|20)ms|2s))|(GP_Standard_D(((2|4|8|16|32|48|64)s_v3)|((2|4|8|16|32|48|64)ds_v4)|((2|4|8|16|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5)|(C(2|4|8|16|32|48|64|96)ads_v5)))|(MO_Standard_E((((2|4|8|16|20|32|48|64)s)_v3)|((2|4|6|8|16|20|32|48|64)ds_v4)|((2|4|8|16|20|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5))))$`).MatchString(v) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This new pattern should be added to the existing unit test here so that the regex pattern is properly tested.

Copy link
Copy Markdown
Contributor

@toddgiguere toddgiguere Apr 3, 2026

Choose a reason for hiding this comment

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

I'm also seeing a different pattern for the new AMD sku in the portal, I'll need to do some further research. Instead of the pattern DC4ds_v5 I'm seeing a pattern of D4ads_v5, with the "a" denoting AMD.

Disregard this previous comment. I now see this is less AMD and more a type of VM that is left off of the portal options. I do see this pattern when querying the postgres capabilities API, but only for a select few regions.

}

if !regexp.MustCompile(`^((B_Standard_B((1|2|4|8|12|16|20)ms|2s))|(GP_Standard_D(((2|4|8|16|32|48|64)s_v3)|((2|4|8|16|32|48|64)ds_v4)|((2|4|8|16|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5)))|(MO_Standard_E((((2|4|8|16|20|32|48|64)s)_v3)|((2|4|6|8|16|20|32|48|64)ds_v4)|((2|4|8|16|20|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5))))$`).MatchString(v) {
if !regexp.MustCompile(`^((B_Standard_B((1|2|4|8|12|16|20)ms|2s))|(GP_Standard_D(((2|4|8|16|32|48|64)s_v3)|((2|4|8|16|32|48|64)ds_v4)|((2|4|8|16|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5)|(C(2|4|8|16|32|48|64|96)ads_v5)))|(MO_Standard_E((((2|4|8|16|20|32|48|64)s)_v3)|((2|4|6|8|16|20|32|48|64)ds_v4)|((2|4|8|16|20|32|48|64|96)ds_v5)|((2|4|8|16|32|48|64|96)ads_v5))))$`).MatchString(v) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@tejeshwara1 Another thing we have discovered is that migration from "_D" to "_DC" will actually fail, and a manual migration needs to happen. More info here

We do not currently have sku_name change as requiring ForceNew, so if someone changes to a "_DC" they will get a failure condition that may not be clear. Since we are adding this new sku to open this possibility, we should probably have some way of alerting the user in a clear way that this is not allowed. Also this limitation should also be noted in the documentation for this resource.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can use this official documentation link in the docs to alert users that there are also some region limitations: https://learn.microsoft.com/en-us/azure/postgresql/security/security-confidential-computing#limitations-and-considerations

@toddgiguere
Copy link
Copy Markdown
Contributor

@tejeshwara1 the team thinks that we should put a check in a new CustomizeDiff function to check if the user is trying to update from non-confidential to the new confidential SKUs and throw an error if they try that, with a decent message explaining that the data migration is a manual process.

We decided that it would be best to NOT trigger a ForceNew in that case, which could result in loss of data.

If you are not familiar with this pattern, I can finish this up for you, but I'll probably do it in a new branch and PR, I don't want to push to this one which is tied to your fork's main branch.

@tejeshwara1
Copy link
Copy Markdown
Author

Hey @toddgiguere , thanks for the update. you can do it in a new branch and PR.

@toddgiguere
Copy link
Copy Markdown
Contributor

There is a new PR to expand on this change a bit further, also adding a validation to stop an upgrade from these new server types, as that is not supported in Azure currently and requires manual intervention.

We will review and test on this new PR, closing this one.

New PR: #32209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants