[User Guide] Upgrade from v2.4.1 to v3.0.0 - Azure/terraform-azurerm-caf-enterprise-scale GitHub Wiki
Overview
The v3.0.0 release marks an important update to the module, aimed primarily at reducing code changes needed when upgrading to latest releases.
Previously, any change to the schema of input variables with complex object types would result in a breaking change if not updated in the customer code.
This has been made possible with the GA release of optional() types in Terraform v1.3.1.
As a result of this change, we have increased the minimum supported Terraform version to v1.3.1.
To support other changes (as listed below), we have also bumped the minimum supported azurerm provider version to v3.35.0.
New features
- Added documentation for how to set parameters for Policy Assignments
- Updated GitHub Super-Linter to
v4.9.7for static code analysis - Updated the list of private DNS zones created by the module for private endpoints
- Removed deprecated policies for Arc monitoring (now included within VM monitoring built-in initiative)
- Added ability to set
sql_redirect_allowedandtls_certificateproperties on Azure Firewall policies - Update logic for Azure Firewall public IPs to ensure correct availability zone mapping when only 2 zones are specified
- Added support for
optional()types in input variables - Updated policies with the latest fixes from the upstream Azure/Enterprise-Scale repository
- Updated tag evaluation for connectivity and management resources, so
default_tagsare now merged with scope-specific tags - Updated the module upgrade guidance
- Updated
Deny-Public-IPpolicy assignment to use the built-in policy forNot allowed resource types
Fixed issues
- Fix #445 (azurerm v4 compatibility)
- Fix #359 (Specifying parameters in policy assignment loses Log Analytics ID)
- Fix #186 (Policies incompatible with Terraform)
- Fix #444 (Error received when running custom network connectivity deployment)
- Fix #508 (Bug Report: Advanced VPN revoke_certifcate fails to apply)
- Fix #513 (Feature Request: Azure Firewall: Specify TLS Certificate Location in Azure Keyvault)
- Fix #447 (Azure Firewall - Availability Zones)
- Fix #524 (Missing private DNS zone for private endpoint - Azure Data Health Data Services)
- Fix #521 (Feature Request - ExpressRoute Gateway VPN_Type is Hardcoded, parameterise.)
Breaking changes
- :warning: Updated the minimum supported Terraform version to
0.15.1 - :warning: Updated the minimum supported
azurermprovider version to3.0.2 - :warning: Terraform will replace the
Deny-Public-IPpolicy assignment, resulting in loss of compliance history
IMPORTANT: Please also carefully review the planned changes following an upgrade, as the introduction of
optional()settings may result in unexpected changes from your current configuration where recommended new features are enabled by default.
Required actions
IMPORTANT: The introduction of
optional()types should reduce the need to make changes to your code when upgrading, as long as you are happy with the default values specified for new inputs. Before runningterraform apply, please carefully review the proposed plan to ensure you are happy with the proposed changes.
Anyone using this module should be aware of the following when planning to upgrade from release v2.4.1 to v3.0.0:
-
Please review the updates listed above, especially in regard to the Breaking changes.
-
A select number of policies provided as part of this module have changed. Please carefully review Resource changes provided below and the output of
terraform planto ensure there are no issues with any custom configuration within your root module. -
If you are using a custom library, the following library template types will need checking for references to updated policies as listed in the resource changes section below:
- Archetype Definitions
- Policy Definitions
- Policy Set Definitions
- Policy Assignments
-
Before making changes to your configuration, we recommend to update the module version and run
terraform init -upgradefollowed byterraform planto see what changes are needed in the code. Fix any errors before reviewing the plan output to see whether any unexpected resource changes are going to happen. Review the additional guidance below to better understand what is likely to need changing, and please don't hesitate to log a GitHub Issue if you're unclear on any of the required steps.
IMPORTANT: As with any Terraform upgrade, please carefully review the output of
terraform planto ensure there are no issues with any custom configuration within your root module or unexpected changes to your environment before applying.
Resource changes
The following changes have been made within the module which should be reviewed carefully before running terraform apply:
Resource type: azurerm_policy_definition
- The following Policy Definition changes have been included in the
es_rootarchetype definition:Deny-PublicIPdeprecatedDeploy-DDoSProtectionupdatedDeploy-Diagnostics-AAupdatedDeploy-Diagnostics-ACIupdatedDeploy-Diagnostics-ACRupdatedDeploy-Diagnostics-AnalysisServiceupdatedDeploy-Diagnostics-ApiForFHIRupdatedDeploy-Diagnostics-APIMgmtupdatedDeploy-Diagnostics-ApplicationGatewayupdatedDeploy-Diagnostics-AVDScalingPlansupdatedDeploy-Diagnostics-BastionupdatedDeploy-Diagnostics-CDNEndpointsupdatedDeploy-Diagnostics-CognitiveServicesupdatedDeploy-Diagnostics-CosmosDBupdatedDeploy-Diagnostics-DatabricksupdatedDeploy-Diagnostics-DataExplorerClusterupdatedDeploy-Diagnostics-DataFactoryupdatedDeploy-Diagnostics-DLAnalyticsupdatedDeploy-Diagnostics-EventGridSubupdatedDeploy-Diagnostics-EventGridSystemTopicupdatedDeploy-Diagnostics-EventGridTopicupdatedDeploy-Diagnostics-ExpressRouteupdatedDeploy-Diagnostics-FirewallupdatedDeploy-Diagnostics-FrontDoorupdatedDeploy-Diagnostics-FunctionupdatedDeploy-Diagnostics-HDInsightupdatedDeploy-Diagnostics-iotHubupdatedDeploy-Diagnostics-LoadBalancerupdatedDeploy-Diagnostics-LogicAppsISEupdatedDeploy-Diagnostics-MariaDBupdatedDeploy-Diagnostics-MediaServiceupdatedDeploy-Diagnostics-MlWorkspaceupdatedDeploy-Diagnostics-MySQLupdatedDeploy-Diagnostics-NetworkSecurityGroupsupdatedDeploy-Diagnostics-NICupdatedDeploy-Diagnostics-PostgreSQLupdatedDeploy-Diagnostics-PowerBIEmbeddedupdatedDeploy-Diagnostics-RedisCacheupdatedDeploy-Diagnostics-RelayupdatedDeploy-Diagnostics-SignalRupdatedDeploy-Diagnostics-SQLElasticPoolsupdatedDeploy-Diagnostics-SQLMIupdatedDeploy-Diagnostics-TimeSeriesInsightsupdatedDeploy-Diagnostics-TrafficManagerupdatedDeploy-Diagnostics-VirtualNetworkupdatedDeploy-Diagnostics-VMupdatedDeploy-Diagnostics-VMSSupdatedDeploy-Diagnostics-VNetGWupdatedDeploy-Diagnostics-WebServerFarmupdatedDeploy-Diagnostics-WebsiteupdatedDeploy-Diagnostics-WVDAppGroupupdatedDeploy-Diagnostics-WVDHostPoolsupdatedDeploy-Diagnostics-WVDWorkspaceupdatedDeploy-Nsg-FlowLogsdeprecatedDeploy-Nsg-FlowLogs-to-LAdeprecatedDeploy-Sql-SecurityAlertPoliciesupdatedDeploy-Sql-Tdeupdated
These will result in a change to the resources deployed by the module.
Resource type: azurerm_policy_set_definition
- The following Policy Set Definition changes have been included in the
es_rootarchetype definition:Deploy-MDFC-Configupdated
These will result in a change to the resources deployed by the module.
Resource type: azurerm_policy_assignment
- The following Policy Assignment changes have been included in the
es_rootarchetype definition:Deploy-LX-Arc-Monitoringremoved (now included within theDeploy-VM-MonitoringPolicy Assignment)Deploy-WS-Arc-Monitoringremoved (now included within theDeploy-VM-MonitoringPolicy Assignment)Deny-Public-IPupdated (custom policy definition replaced with built-in)
These will result in a change to the resources deployed by the module.
Resource type: azurerm_role_definition
No changes.
Resource type: azurerm_role_assignment
No changes.
Management resources
Management resources will now inherit tags from the default_tags input variable, and combined with those set by configure_management_resources.tags.
No other changes are expected to management resources.
Connectivity resources
Connectivity resources will now inherit tags from the default_tags input variable, and combined with those set by configure_connectivity_resources.tags.
The following changes were made to the configure_connectivity_resources.settings.dns.config.enable_private_link_by_service object:
azure_api_managementaddedazure_arcaddedazure_batch_accountaddedazure_bot_service_botaddedazure_bot_service_tokenaddedazure_cache_for_redis_enterpriseaddedazure_data_exploreraddedazure_data_health_data_servicesaddedazure_digital_twinsaddedazure_hdinsightsaddedazure_iot_dpsaddedazure_key_vault_managed_hsmaddedazure_media_servicesaddedazure_migrateaddedazure_purview_accountaddedazure_purview_studioaddedazure_synapse_analytics_devaddedazure_synapse_analytics_sqlserverremovedazure_synapse_studioaddedazure_web_apps_static_sitesaddedmicrosoft_power_biaddedsignalr_webpubsubadded
NOTE: Due to the introduction of
optional()types, this will not require a code change unless you want to disable creation of the newly added private DNS zones controlled by these inputs.
Additional changes were made to the underlying DNS zone mapping to support the latest required configuration. This may result in changes to the private DNS zones being managed by the module.
No other changes are expected to connectivity resources.
:rocket: Advanced configuration
If you are using create_duration_delay or destroy_duration_delay custom inputs but have only partially defined the list of available resource types, you may observe a change in the default values being applied by the module. This is because the optional() type allows us to correctly merge custom and default values without a "fallback" value, as previously implemented.
For any customers using the advanced configuration blocks within configure_connectivity_resources and configure_management_resources, we have made a few updates to add new functionality.
These are not breaking changes and can be identified by reviewing the full change log v2.4.1...v3.0.0.
Next steps
Take a look at the latest User Guide documentation and our Examples to understand the latest module configuration options, and review your implementation against the changes documented on this page.
Need help?
If you're running into problems with the upgrade, please let us know via the GitHub Issues. We will do our best to point you in the right direction.