Hello. I've been looking into `atmos generate` and...
# atmos
c
Hello. I've been looking into
atmos generate
and it seems it can't be specified under the global
terraform
key (like
backend
or
providers
). Am I missing something or is there a reason it must only be specified under a component? I guess if I wanted a file more globally generated I could try having all my components inherit from one that does the generation...
e
Seems reasonable; might have been overlooked.
If you open an issue, we can take a look
It should be supported, but I don't believe we have an example of setting it globally like that.
c
OK and I did try it and only saw the output from it being specified under a component. I'll open an issue in a bit. Thanks!
e
@Zack see this?
z
Shouldn't be related to my issue. Mine was moreso related to workdirs not being respected after generate put something under the vendoring base path
Could be an interesting idea though
c
Yeah I was wondering about using generate to make sure all components had a JIT
context.tf
since all of our components will likely be custom migrations of our more static terraform dirs. (until they get better). So then one less thing I need to tell people as they migrate/author components.
z
you could do something hacky in the meantime where you make an abstract mixin with all your component names (assuming they are generic) where you import the generate block
Copy code
yaml-language-server: $schema=<https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json>
components:
  terraform:
    eks/abstract:
      metadata:
        terraform_workspace_pattern: "black-hole"
        type: abstract
      generate:
        <http://locals_override.tf|locals_override.tf>: |
          # override file generated by atmos
          locals {
            name = "THISISANOVERRIDE"
          }
then basically every single stack where you run that component and import that mixin it gets the generate block
c
Yeah I was imagining I could probably do something with an generic abstract component
z
yeah using a generic
inherits:
probably better