Search code examples
terraformtest-kitchen

kitchen terraform error - Could not load the 'terraform' driver. Error: undefined method `size' for nil:NilClass


I'm following https://newcontext-oss.github.io/kitchen-terraform/getting_started.html However, when I try and run: bundle exec kitchen converge

I get the following error:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'terraform' driver. Error: undefined method `size' for nil:NilClass
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Any ideas? Running TF 1.0.7


Solution

  • I had this bug too when following the official tutorial.

    I resolved it by updating the Gemfile to use the newest version of kitchen-terraform

    # Gemfile
    
    source "https://rubygems.org/"
    gem "kitchen-terraform", "6.0"
    

    Let me know if it solved your problem!