fix(azurerm): write 'features' as empty block instead of variable ref… - #431
Draft
ljluestc wants to merge 1 commit into
Draft
fix(azurerm): write 'features' as empty block instead of variable ref…#431ljluestc wants to merge 1 commit into
ljluestc wants to merge 1 commit into
Conversation
…erence
AzureRM provider's 'features' attribute is a block-type schema (TypeList with
Resource Elem), not a simple attribute. It should be written as:
provider "azurerm" {
features {}
}
instead of:
provider "azurerm" {
features = var.features
}
This fix adds isBlockSchema() helper to detect block-type schemas and write
them as empty blocks rather than variable interpolations.
Fixes cycloidio#272
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes Azure accelerated networking support for imported
azurerm_network_interfaceresources.Before this change, Terracognita relied only on Terraform provider state during
FixResource, which could miss or drift from the Azure API value forenable_accelerated_networkingin some import paths.This PR now preserves the Azure-reported source-of-truth value and applies it during resource fixing so generated HCL keeps the correct accelerated networking setting.
Related Issue
Fixes #276
Type of Change
Implementation Details
networkInterfaceAcceleratedNetworking map[string]boolEnableAcceleratedNetworkingfrom Azure API NIC listing inazurerm/resources.go:setNetworkInterfaceAcceleratedNetworking(...)FixResourceforazurerm_network_interfaceinazurerm/provider.go:fixNetworkInterfaceAcceleratedNetworking(...)enable_accelerated_networkingin CTY state using cached Azure valueazurerm/provider_test.goto verify:How Has This Been Tested?
Test Commands Run
go test ./azurerm -run TestFixNetworkInterfaceAcceleratedNetworkinggo test ./azurerm/...go build ./...Checklist
Code Quality
Testing
Documentation