terramate icon indicating copy to clipboard operation
terramate copied to clipboard

[BUG] `terramate generate` doesn't honor the `--tags` option

Open n-my opened this issue 6 months ago • 2 comments

Describe the bug

To Reproduce

Create 2 stacks, only one with a tag

terramate create stacks/vpc --tags aws
terramate create stacks/vpc2

Add the code generate file stacks/main.tm.hcl with the content

generate_hcl "_generate_main.tf" {
  content {
    resource "aws_vpc" "main" {
      cidr_block = "10.0.0.0/16"
    }
  }
}

Run the generate command only on the 1st stack using the --tags option

terramate generate --tags aws

Expected behavior

I would expect the code generation to be applied only to the 1st stack and not to all. The help page of the terramate generate commands indicates that it supports the --tags=TAGS option to filter stacks by tags.

Log Output

The code generation runs for all stacks

Code generation report
Successes:
- /stacks/vpc
	[+] _generate_main.tf
- /stacks/vpc2
	[+] _generate_main.tf

Environment (please complete the following information):

  • OS: Amazon Linux 2
  • Git Version: 2.40.1
  • Terramate Version: 0.10.1

n-my avatar Aug 21 '24 13:08 n-my