Is it a bug in documentation? store name is not m...
# atmos-dev
s
Is it a bug in documentation? store name is not mentioned
Copy code
# Get the `key` from the store of a `component` in the current stack
  !store <component> <key>

  # Get the `key` from the store of a `component` in a different stack
  !store <component> <stack> <key>
...
while in test store name present: https://github.com/cloudposse/atmos/blob/845aeb56cf9b530457856f64b8641328e8b888d1/internal/exec/yaml_func_store_test.go#L57
Copy code
{
			name:         "basic lookup cross-stack",
			input:        "!store redis dev vpc cidr",
			currentStack: "prod",
			expected:     "10.0.0.0/16",
		},
e
@Matt Calhoun
@Dan Miller (Cloud Posse)
d
the store is configured separately with atmos, then you can choose which store to use for a stack or for a component via inheritance https://atmos.tools/core-concepts/projects/configuration/stores/
s
is it valid to set store in atmos.yaml if I want to use it to define shared secrets across stacks?
Copy code
stores:
  gsm:
    type: google-secret-manager
    options:
      project_id: secret-manager
d
Yes absolutely. Then you'll just need to tell the stacks which store to use like this: for example in stacks/orgs/_defaults.yaml
Copy code
terraform:
  hooks:
    store-outputs:
      name: gsm
      events:
        - after-terraform-apply
      command: store
then for any component, you can do this to store output:
Copy code
components:
  terraform:
    foo:
      hooks:
        store-outputs:
          outputs:
            my_id: .my_id
then finally you can pull it somewhere else like you have:
Copy code
components:
  terraform:
    bar:
      var:
        foo_id: !store foo my_id
s
ok, thanks was using store with store name, is it a bad practice?
Copy code
terraform:
    kinde/foo:
      metadata:
        component: kinde
      vars:
        service_name: foo
        kinde_client_id:  !store gsm atmos shared kinde_client_id
        kinde_client_secret:  !store gsm atmos shared kinde_client_secret
d
it's good if you have many stores, but otherwise it's redundant. It doesnt hurt though
generally I would recommend setting the store with defaults and inheriting the settings. Makes for DRY-er code, but ultimately it's no different
s
anyway here is google secret manager store implementation: https://github.com/cloudposse/atmos/pull/1034 anyone interested to have a look?
d
@Matt Calhoun could you please review?
✅ 1
e
We should get back to this on Monday
s
addressed 🐰 comments 🥕
m
Is it a bug in documentation?
Yes, it was. I've corrected it on the https://atmos.tools website
s
@Matt Calhoun can you pls review again https://github.com/cloudposse/atmos/pull/1034/
👀 1
@Erik Osterman (Cloud Posse) or @Matt Calhoun ☝️ can you pls trigger rerun of the tests. Hope that it should fix CI finally 🙈
✅ 1
e
Great, I just kicked it off
s
finally 🟢
🎉 1
e
Awesome! So we have our nightly builds coming any day now
We will merge this as soon as we get those going
🙌 1
s
@Erik Osterman (Cloud Posse) addressed errors handling to follow recent changes in main
e
I retriggered the tests
s
fixed conflicts
@Erik Osterman (Cloud Posse) can you pls retrigger againg 🙏