Code Monkey home page Code Monkey logo

Comments (22)

andyt530 avatar andyt530 commented on August 22, 2024

it's the quotes around the Group causing the problem - I've committed an attempt to fix it, please try again.

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

Thanks I now get:

Traceback (most recent call last): File "../../scripts/az2tf.py", line 385, in <module> azurerm_virtual_machine_scale_set.azurerm_virtual_machine_scale_set(crf,cde,crg,headers,requests,sub,json,az2tfmess,cldurl) File "/py-az2tf/scripts/azurerm_virtual_machine_scale_set.py", line 247, in azurerm_virtual_machine_scale_set ddname = datadisks["name"] TypeError: list indices must be integers or slices, not str TypeError: list indices must be integers or slices, not str Error in az2tf.py

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

fix posted please give it another go

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

Getting there ;)
Traceback (most recent call last): File "../../scripts/az2tf.py", line 431, in <module> azurerm_function_app.azurerm_function_app(crf,cde,crg,headers,requests,sub,json,az2tfmess,cldurl) File "/py-az2tf/scripts/azurerm_function_app.py", line 143, in azurerm_function_app fr.write('\t version = "' + vers + '"\n') UnboundLocalError: local variable 'vers' referenced before assignment UnboundLocalError: local variable 'vers' referenced before assignment Error in az2tf.py

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

another fix posted :-)

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

Thanks for your efforts Andy,

fqdns again.

Error: Invalid number literal

on azurerm_application_gateway.grp.tf line 30, in resource "azurerm_application_gateway" "test__grp":
30: fqdns = x.x.x.x

Failed to recognize the value of this number literal.

Error: Attribute redefined

on azurerm_application_gateway.grp.tf line 31, in resource "azurerm_application_gateway" "test__grp":
31: fqdns = x.x.x.x

The argument "fqdns" was already set at
azurerm_application_gateway.grp.tf:30,3-8. Each argument may be
set only once.

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

will need the debug output on that one please

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

reproduced your issue here - fix posted

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

Sorry got bogged down in something else

[{'ipAddress': 'x.x.x.x'}, {'ipAddress': 'x.x.x.x'}]
Traceback (most recent call last):
  File "../../scripts/az2tf.py", line 361, in <module>
    azurerm_application_gateway.azurerm_application_gateway(crf,cde,crg,headers,requests,sub,json,az2tfmess,cldurl)
  File "/scripts/azurerm_application_gateway.py", line 205, in azurerm_application_gateway
    fr.write('\t path = "' + bhtpath + '"\n')
TypeError: can only concatenate str (not "NoneType") to str
TypeError: can only concatenate str (not "NoneType") to str
Error in az2tf.py

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

More complicated to fix than I thought - another attempt posted - thanks for your patience with this.

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

np u got nothing else todo on a Sunday ;)

Error: Error parsing /py-az2tf/generated/tf.8999dec3-0104-4a27-94ee-6588559729d1/azurerm_app_service_slot.bard-api-grp__bard-api-grp__staging.tf: At 5:25: Unknown token: 5:25 IDENT azurerm_resource_group.bard-api-grp.name

Error with terraform init

sorry not possible to upload debug
in that .tf file:

resource azurerm_app_service_slot bard-api-grp__bard-api-grp__test {
	 name = "test"
	...
	 resource_group_name = azurerm_resource_group.bard-api-grp.name

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

Think that one is a case issue with the resource group name could you do:

$ cd generated/tf.8999dec3-0104-4a27-94ee-6588559729d1
$ terraform state list | grep resource_group

and post the output of whatever it says for the resource group "bard-api-grp" or "BARD-API-GRP" or what ever else it lists

Thanks

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

Might also be worth clearing out (rm -rf tf.8999dec3-0104-4a27-94ee-6588559729d1) as - there shouldn't be any .tf files hanging around in there at the "terraform init" step.

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

re-cloned, get same error on tf state list
Failed to load backend: Error loading backend config: Error parsing /py-az2tf/generated/tf.8999dec3-0104-4a27-94ee-6588559729d1/azurerm_app_service_slot.bard-api-grp__bard-api-grp__test.tf:
At 5:25: Unknown token: 5:25 IDENT azurerm_resource_group.bard-api-grp.name

think this is the app service slot name?

in GUI it reads:
test (bard-api-grp/test)
App Service (Slot)
this is in RG: bard-api-grp

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

ok - backed out some of the name de-referencing of "name" values in app slots - simpler but not elegant. Lets see if that gets us past this issue in azurerm_app_service_slot

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

it does, agw again.

resource azurerm_application_gateway nom-net-prod__nom-net-prod {

gateway_ip_configuration {
name = "appGatewayIpConfig"
subnet_id = azurerm_subnet.main-inf-grp__nom-net.id <---- Unknown token: IDENT
}

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

id is:

"id": "[concat(parameters('virtualNetworks_main_inf_vnet_grp_externalid'), '/subnets/nom-net')]"

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

Hi,

I'm going to need the output of ./az2tf.sh -s xxxxx -v yes -d yes

To progress that one.

from py-az2tf.

nathan-clark avatar nathan-clark commented on August 22, 2024

no easy way to scrub output i'm afraid

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

Ok - how about:

terraform state list | grep azurerm_subnet
Look for the relevant subnet we're trying to reference in the gateway and paste that line here.

Then also look at the "source of truth" for az2tf - login to
https://resources.azure.com

select your subscription
& resource group
& providers
& Microsoft.Net
& applicationGateways
& your-gateway (nom-net-prod)

Look in there for the gatewayIPConfiguration block and
"subnet" : { within and on the next line
"id" : {

And paste the value of that id line here (you can remove the subscription id) - but I need to see the rest of it along with the terraform state list from above to see if they match and if not why not.

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

do the terraform state list from the generated/tf.xxxxxxxxxxxxxxxx directory

from py-az2tf.

andyt530 avatar andyt530 commented on August 22, 2024

Project archived with the release of the 2.0 azurerm providers

from py-az2tf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.