boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

allow.envs deny.envs doesn't work as expected #228

Open mgzenitech opened 2 years ago

mgzenitech commented 2 years ago

Checklist

My Environment

Software Version
Operating System
Terraform
Terraspace
Ruby

Expected Behaviour

config/app.rb:

Terraspace.configure do |config|
  config.allow.envs = [
     "dev",
     "devops",
     "qa",
     "prep",
     "prod"
  ]
  config.deny.envs = []
end

TS_ENV=aaa terraspace all up wouldn't run.

Current Behavior

TS_ENV=aaa terraspace all up:

Will run:
    terraspace up app     # batch 1
    terraspace up db      # batch 1
    terraspace up dns     # batch 1
    terraspace up network # batch 1
    terraspace up other   # batch 1
Are you sure? (y/N) y
Batch Run 1:
Running: terraspace up app Logs: log/up/app.log
Running: terraspace up db Logs: log/up/db.log
Running: terraspace up other Logs: log/up/other.log
Running: terraspace up network Logs: log/up/network.log
Running: terraspace up dns Logs: log/up/dns.log
terraspace up app:  No changes. Your infrastructure matches the configuration.
terraspace up app:  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
terraspace up db:  No changes. Your infrastructure matches the configuration.
terraspace up db:  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
terraspace up dns:  No changes. Your infrastructure matches the configuration.
terraspace up dns:  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
terraspace up network:  No changes. Your infrastructure matches the configuration.
terraspace up network:  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
terraspace up other:  No changes. Your infrastructure matches the configuration.
terraspace up other:  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Time took: 13s

Step-by-step reproduction instructions

Code Sample

Solution Suggestion

johnlister commented 1 year ago

I can confirm the using the "all" option doesn't work as expected. Planning/applying a single stack does respect the allow list