<@UB2EH889X> ok - I think this is ready to get int...
# atmos-dev
z
@Erik Osterman (Cloud Posse) ok - I think this is ready to get into your branch github.com/cloudposse/atmos/pull/2816
I've kind of come to terms that I am trying to do too much templating at atmos initialization time. I will utilize more mixins to keep things dry-ish.
e
What were the tail end of the problems you were chasing down?
z
Tried to demo this to someone and seem to still be running into some issues with it trying to read from my other account Trying to add multiple labels to components to represent different layers of resources, one label works fine, the other label throws and s3 backend error for the other account
I think I'm going to split my monorepo
atleast into two different atmos.yaml files
e
I would still be open to trying to figure out why
Do you know which function is getting executed against the out-of-scope stack?
z
Copy code
in YAML function:  !terraform.state cloudposse-s3-bucket
   ".bucket_id // ""default"""  failed to read Terraform state for component  cloudposse-kms-key  in stack
It's different basically every time, because atmos seems to be trying to hydrate everything still
the stack it's referencing is not in any of the stacks or components that I've tagged
I've basically made two different `atmos.yaml`s at this point and it seems to be better
This seems to be working as expected at this point. Might just be due to my different atmos configs honestly
lol
Copy code
fatal error: concurrent map read and map write

goroutine 2221 [running]:
internal/runtime/maps.fatal({0x106cbf4ab?, 0x100854a10?})
e
've basically made two different `atmos.yaml`s at this point and it seems to be better
What about atmos profiles?
z
can I set this in an atmos profile?
Copy code
stacks:
  base_path: "stacks"
  included_paths:
    - "deploy/**/*"
e
Yes, it should work
THe idea is profiles to be able to set overrides for anything in
atmos.yaml
z
Copy code
Error

   Error: decoding failed due to the following error(s):

   'default' expected type 'bool', got unconvertible type 'map[string]interface {}' 'version' expected a map or struct, got "string"
😭
Getting that when trying to use a profile
e
what happens if you run
atmos config validate
z
Copy code
Error

   Error: decoding failed due to the following error(s):

   'default' expected type 'bool', got unconvertible type 'map[string]interface {}' 'version' expected a map or struct, got "string"
e
Ok, will fix that separately; what i think is going on is you have
version
defined somewhere
like
version: "1.2.3"
which is invalid
z
don't have it anywhere in my
atmos.yaml
files
and no env variables 🫠
e
are you saying
grep "^version:" -R .
would return nothing
z
wow - I had a
.workdir
next to my profile directory and that broke it
e
ok, that's interesting
z
It was catching a release-please version
file
e
still sounds like a bug in atmos
Have enough to probably reproduce
z
version*:* 0.3.0 *#* _x-release-it-version_
this was in a .workdir, inside of my profiles directory, in a
version.yaml
file
anyway - idk - I think the stuff in this branch is good... I can't seem to replicate that fatal error again after sorting some stuff out with my local binary
I can run my agent over it again
e
Do you have
base_path: .
z
Nope - it think I just had a bunch of junk in the directory where atmos was looking for profiles
e
Right, but the
.workdir
comes from atmos source provisioning
At some point you probably ran
atmos terraform ...
from that folder
z
Yeah I was running with a different atmos.yaml file previously. I turned those into my profiles
Exactly. JITd some workdirs
e
So if
base_path
is unset (or
""
), then it will default to the
!git.root
So it will always be relative to the the root of your repo, so that
.workdir
couldn't get created randomly like that in a profile dir
My concern is it could happen again and is a footgun 😃
z
Nah it only happened, because I was using, essentially a subdirectory pattern for multiple atmos.yaml files instead of the config files
And then I took that subdirectory, and those atmos.yamls, turned them into profiles without cleaning up
Pointed the main atmos.yaml at the directory with profiles and a .workdir in it. Inside the workdir there were release please manifest files lol
e
So if we merge these PRs you're basically good?
z
I think so ?
Looks like CI succeeded. Will probably have to run again in your branch 😁