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

Azure Redis Cache can't be imported #602

Open
chaoscreater opened this issue Feb 19, 2025 · 1 comment
Open

Azure Redis Cache can't be imported #602

chaoscreater opened this issue Feb 19, 2025 · 1 comment
Labels
bug Something isn't working upstream-provider

Comments

@chaoscreater
Copy link

chaoscreater commented Feb 19, 2025

I'm getting the following error on Redis Cache and this error is consistently found across all RGs that have this resource type.

Error: generating Terraform configuration: converting from state to configurations: generating state for resource azurerm_redis_cache.res-2: tune template for azurerm_redis_cache: () tunning attributes: (redis_version) checking attribute value is default or zero: converting cty value 6 to Go: can't convert Go float64 to string

Image

Currently, I have to use the following to exclude certain resource types from being imported. If I don't do this, the main.tf file doesn't get generated for the rest of the resources in the same RG as those problematic resource types.

aztfexport query `
	-n `
	-f `
	-k `
	--include-role-assignment `
	--mask-sensitive `
	--hcl-only `
	--tfclient-plugin-path "$Plugin_Cache_Provider_Path\terraform-provider-azurerm_v$($LatestProviderVersion)_x5.exe" `
	--provider-name azurerm `
	--provider-version $LatestProviderVersion `
	--log-level $LogLevel `
	--parallelism 1 `
	--log-path "$ExportPath\tfexportlogs.log" `
	--output-dir "$ExportPath" `
	--client-id "$env:ARM_CLIENT_ID" `
	--client-secret "$env:ARM_CLIENT_SECRET" `
	--tenant-id "$env:ARM_TENANT_ID" `
	"resourceGroup =~ '$ResourceGroup' and tags !contains 'deployed_by_amba' and not(type =~ 'Microsoft.Cache/Redis') and not(type =~ 'Microsoft.OperationsManagement/solutions') and not(type =~ 'Microsoft.Logic/workflows/triggers') and not(type =~ 'Microsoft.Logic/workflows')"
@magodo
Copy link
Collaborator

magodo commented Feb 20, 2025

@chaoscreater Thanks for this report! We can fix that once the upstream PR above got merged. Meanwhile, you can use the --full-properties option to skip the property tuning step, hence get a full version of the configuration. You'll likely need to tune the config manually to make it valid then.

@magodo magodo added the bug Something isn't working label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream-provider
Projects
None yet
Development

No branches or pull requests

2 participants