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

--plugin none fails on new project #343

Open
3 tasks done
stiliajohny opened this issue Jan 10, 2024 · 0 comments
Open
3 tasks done

--plugin none fails on new project #343

stiliajohny opened this issue Jan 10, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@stiliajohny
Copy link

Checklist

  • Upgrade Terraspace: Are you using the latest version of Terraspace? This allows Terraspace to fix issues fast. There's an Upgrading Guide: https://terraspace.cloud/docs/misc/upgrading/
  • Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.boltops.com
  • Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.

My Environment

Software Version
Operating System MacOS Sanoma 14.3
Terraform v1.5.7
Terraspace 0.6.23
Ruby 2.6.10p210 (2022-04-12 revision 67958)

Expected Behaviour

$ terraspace new project infra --plugin none --examples
=> Creating new project called infra.
      create  infra
      create  infra/.gitignore
       exist  infra
      create  infra/config/terraform/backend.tf
      create  infra/config/terraform/provider.tf
=> Creating new module called example.
      create  infra/app/modules/example
      create  infra/app/modules/example/main.tf
      create  infra/app/modules/example/outputs.tf
      create  infra/app/modules/example/variables.tf
=> Creating new stack called demo.
      create  infra/app/stacks/demo
      create  infra/app/stacks/demo/main.tf
      create  infra/app/stacks/demo/outputs.tf
      create  infra/app/stacks/demo/variables.tf
$ cd infra # and start checking out the files

Current Behavior

➜  terraspace git:(main) ✗ terraspace new project infra --plugin none --examples                                                                                                                                                           git:(main|-13…4 
=> Creating new project called infra.
      create  infra
      create  infra/.gitignore
      create  infra/Gemfile
      create  infra/README.md
      create  infra/Terrafile
      create  infra/config/app.rb
LoadError: cannot load such file -- terraspace_plugin_none
ERROR: Unable to require plugin terraspace_plugin_none.
Are you sure you the plugin exists and you specified the right plugin option.
You specified --plugin none                                                                                                                                                                                                                           
➜  terraspace git:(main) ✗   

Step-by-step reproduction instructions

Install terraspace as per documentation.
I can do terraspace new project NAME and that works but when I need to terraspace init even after changing the provider to be a non AWS i get no AWS creds,
My project is not AWS, its more of a bare metal infra ( Cloudflare, k8s )
Following the docs from here

Code Sample

file tree
.
├── Gemfile
├── Gemfile.lock
├── README.md
├── Terrafile
├── app
│   ├── modules
│   └── stacks
│       └── demo
│           ├── main.tf
│           ├── outputs.tf
│           └── variables.tf
└── config
    ├── app.rb
    └── terraform
        ├── backend.tf
        └── provider.tf

7 directories, 10 files
backend.tf
terraform {
  backend "local" {
    path = "terraform.tfstate"
  }
}
provider.tf
terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = ">= 4.9.0"
    }
    random = {
      source = "hashicorp/random"
    }
  }
  required_version = ">= 0.13"
}

# Providers
provider "cloudflare" {
  api_token = "XXXXXX"
}

provider "random" {
}
terraspace init demo
 terraspace init demo                                                                                                                                                                                              git:(main|-13…4 
Building .terraspace-cache/us-east-1/dev/stacks/demo
INFO: You're missing AWS credentials. Only local services are currently available
/Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/plugin/expander/friendly.rb:7:in `friendly_name': undefined method `to_sym' for nil:NilClass (NoMethodError)
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar/layer.rb:93:in `block in plugins'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar/layer.rb:87:in `each'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar/layer.rb:87:in `plugins'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/layering.rb:11:in `main_layers'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/layering.rb:6:in `layers'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar/layer.rb:62:in `full_layering'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar/layer.rb:48:in `full_paths'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar/layer.rb:41:in `paths'
        from /Library/Ruby/Gems/2.6.0/gems/memoist-0.16.2/lib/memoist.rb:169:in `paths'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar.rb:24:in `layer_paths'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/strategy/tfvar.rb:9:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/builder.rb:30:in `build_tfvars'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/compiler/builder.rb:13:in `build'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/builder.rb:57:in `build_root_module'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/builder.rb:52:in `build_unresolved'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/builder.rb:22:in `block in run'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/hooks/builder.rb:25:in `run_hooks'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/hooks/concern.rb:6:in `run_hooks'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/builder.rb:20:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/cli/commander.rb:9:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/cli.rb:115:in `init'
        from /Library/Ruby/Gems/2.6.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /Library/Ruby/Gems/2.6.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/lib/terraspace/command.rb:61:in `dispatch'
        from /Library/Ruby/Gems/2.6.0/gems/thor-1.3.0/lib/thor/base.rb:584:in `start'
        from /Library/Ruby/Gems/2.6.0/gems/terraspace-0.6.23/exe/terraspace:14:in `<top (required)>'
        from /usr/local/bin/terraspace:23:in `load'
        from /usr/local/bin/terraspace:23:in `<main>'  

Solution Suggestion

@stiliajohny stiliajohny added the bug Something isn't working label Jan 10, 2024
@tongueroo tongueroo added the help wanted Extra attention is needed label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants