-
Notifications
You must be signed in to change notification settings - Fork 83
Ubuntu-18.04-Missing-Resource-Invalid-block-definition #27
Comments
Hi, Could you post some of the debug output please using: ./az2tf.sh -s yoursub -r automation_account -v yes -d yes This will help me see what's going on in your case. |
Please see below python2.7 ../../scripts/az2tf.py -s 9acaa416-e542-46e1-855d-e207e2582998 -r automation_account -d yes 2>&1 | tee -a import.log azurerm_automation_account 8{ File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__Automation { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__Automation2 { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__Automation3 { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__Automation4 { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__Automation5 { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__automation-NM { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account kickstart__Kickstart { { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_automation_account 123__efewfefe { terraform init The Terraform configuration must be valid before initialization so that Error: Missing name for resource on azurerm_automation_account.123__Automation.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__Automation.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource on azurerm_automation_account.123__Automation2.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__Automation2.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource on azurerm_automation_account.123__Automation3.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__Automation3.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource on azurerm_automation_account.123__Automation4.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__Automation4.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource on azurerm_automation_account.123__Automation5.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__Automation5.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource on azurerm_automation_account.123__automation-NM.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__automation-NM.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource on azurerm_automation_account.123__efewfefe.tf line 2: All resource blocks must have 2 labels (type, name). Error: Invalid block definition on azurerm_automation_account.123__efewfefe.tf line 2: Either a quoted string block label or an opening brace ("{") is expected here. Error: Missing name for resource |
This seems to be down to your resource group name starting with a number If I change it so it starts with a letter: It validates ok. I'll have to check the terraform docs to see it this is a bug or expected behaviour for resource names. |
started posting fixes for this - I have to change every provider. But I started with the ones you are seeing errors on. |
should be in better shape for you now. Let me know how you get on |
This looks loads better, ran a fuller lookup. If I only have numbers, these resource groups still fail. These are testing resource groups, so I would not normally deploy them like this. I am seeing issues with an interpolation expression terraform init The Terraform configuration must be valid before initialization so that Error: Extra characters after interpolation expression on azurerm_network_interface.rg_123__test01938.tf line 8, in resource "azurerm_network_interface" "rg_123__test01938": Expected a closing brace to end the interpolation expression, but found extra Error: Extra characters after interpolation expression { File generated by py-az2tf see: https://github.com/andyt530/py-az2tfresource azurerm_network_interface rg_123__test01938 { |
working on fixes for that ..... |
posted up some fixes - please give it another go - will test more thoroughly later. |
Thanks, tested and just the expected warnings for NSG and route association. I will test this across some other subscriptions and let you know If I find anything else. |
Tested this on 6 other subs no other issues found |
Seems to be an issue with some of the terraform files when doing a validate.
Ubuntu-18.04
Terraform v0.12.9
azure-cli 2.0.73
The resource Type and Name are missing been surrounded by ""
Azure Automation accounts - Multiple
Error: Missing name for resource
Error: Invalid block definition
azurerm_log_analytics_solution - Multiple
Error: Missing name for resource
Error: Invalid block definition
azurerm_managed_disk - Multiple
Error: Missing name for resource
-azurerm_managed_disk
Error: Invalid block definition
azurerm_network_interface - Multiple
Error: Missing name for resource
-azurerm_network_interface
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Invalid resource name
Error: Invalid resource name
Error: Invalid resource name
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Invalid resource name
Error: Invalid resource name
Error: Invalid resource name
Error: Invalid resource name
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error: Missing name for resource
Error: Invalid block definition
Error with terraform init
The text was updated successfully, but these errors were encountered: