Comments (12)
Can you give me a little more of the output - before and after.
from py-az2tf.
terraform validate Success! The configuration is valid. chmod: cannot access 'state.sh': No such file or directory state cleaned ls: cannot access '**stateimp.sh': No such file or directory imports completed Terraform fmt ... azure.tf Terraform Plan ... Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. ------------------------------------------------------------------------ No changes. Infrastructure is up-to-date.
from py-az2tf.
And can you share:
- The actually command line you are running ./az2tf.sh ......
- The output between that command and the terraform validate Success!
- are there any *.tf files being generated in the sub-directory generated/tf. ?
Thanks
from py-az2tf.
Its generating file but its empty, only contains terraform and provider 'azurerm'. Ive removed my subscription ID
./az2tf.sh -s
Subscription ID =
Azure Resource Group Filter =
Terraform Resource Type Filter =
Get Subscription Policies & RBAC = no
Extract Key Vault Secrets to .tf files (insecure) = no
Fast Forward = no
Validate Only = no
Debug = no
python2.7 ../../scripts/az2tf.py -s 2>&1 | tee -a import.log
./az2tf.sh: line 123: python2.7: command not found
terraform init
Initializing the backend...
Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "azurerm" (terraform-providers/azurerm) 1.31.0...
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
terraform validate
Success! The configuration is valid.
from py-az2tf.
Ah - here's the problem:
python2.7 ../../scripts/az2tf.py -s 2>&1 | tee -a import.log
./az2tf.sh: line 123: python2.7: command not found
It couldn't find python v 2.7 on your system - so the main bulk of the code that generates the terraform didn't run
I'll code in a test to drop out with a better error......
In the meantime - unless you can run "python2.7" - or alias that to python v2 on your system this isn't going to work for you....
from py-az2tf.
If i run python it works fine and shows that its version 2.7
$ python --version Python 2.7.16
from py-az2tf.
Hi,
There are many many ways python can get installed and be available on the command line.
I'll have to work some more logic in to cover all these cases.
In the meantime you should be able to work-around simple by changing that "python2.7" to "python" in the az2tf.sh file (line 91)
If you have the time could you please give that a try and let me know how you get on ?
Thanks
from py-az2tf.
Thanks! I'm now getting the following errors
python ../../scripts/az2tf.py -s 7e42623b-2051-4ab2-a66b-36b5866ac99b 2>&1 | tee -a import.log Get Access Token from CLI Subscription: 7e42623b-2051-4ab2-a66b-36b5866ac99b Traceback (most recent call last): File "../../scripts/az2tf.py", line 200, in r = requests.get(url, headers=headers, params=params) File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\api.py", line 75, in get return request('get', url, params=params, **kwargs) File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\sessions.py", line 519, in request prep = self.prepare_request(req) File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\sessions.py", line 462, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\models.py", line 314, in prepare self.prepare_headers(headers) File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\models.py", line 448, in prepare_headers check_header_validity(header) File "C:\Users\AppData\Roaming\Python\Python27\site-packages\reques ts\utils.py", line 942, in check_header_validity raise InvalidHeader("Invalid return character or leading space in header: %s " % name) requests.exceptions.InvalidHeader: Invalid return character or leading space in header: Authorization terraform init
from py-az2tf.
Hi,
Two things to try:
- sudo pip install requests
- have you logged in to azure via the CLI ?
Thanks
from py-az2tf.
The issue is with the request module. Couldnt get it to work but thanks
from py-az2tf.
When you fix that - it should be ok
from py-az2tf.
having the same issue. I have python 3 and installed pip requests and pip adal.
@zoemac11 How did you solve this error?
@andyt530 can't find line 91 on the az2tf.sh file
from py-az2tf.
Related Issues (20)
- Invalid escape sequence HOT 3
- Error in az2tf.py Unicode for Policy info HOT 3
- ValueError malformed string in ast.py HOT 5
- Support for other Azure Clouds HOT 3
- Support for Python 3 HOT 1
- Warning: "network_security_group_id": [DEPRECATED] Use the `azurerm_subnet_network_security_group_association` resource instead. HOT 1
- Traffic manager endpoint issue with app service as type HOT 23
- IndexError: list index out of range HOT 7
- Error HOT 17
- Error naming slots resources HOT 1
- The argument "fqdns" was already set at fqdns = ["x.x.x.x"] HOT 2
- Note in resource "azurerm_management_lock" HOT 22
- azurerm_virtual_network_gateway_connection issue HOT 7
- Azure Role Definition Import fails when role definition has no description HOT 1
- terraform validate fails because storage profile block is never created in vmss import HOT 1
- KeyError for loadBalancerBackendAddressPools in vmss HOT 1
- Invalid multi-line string error HOT 4
- Azurerm 2.0 fails to validate HOT 1
- Tool isnt working
- Still active? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-az2tf.