Hi there, can someone please clarify atmos vendors...
# atmos
b
Hi there, can someone please clarify atmos vendors feature? It looks similar to the terrafrom/source block from terragrunt where terragrunt can pull the module from the registry/github at runtime and feed your values/inputs keeping your component directory folder clean in source control. However, it seems atmos needs an
atmos vendor pull
run before I run plan/apply commands right?
no reason I'd need to run the pull locally before I commit to source control right?
e
We support both methods
vendor pull
is more about explicitly pulling in dependencies. Think of it like
npm install
. Vendoring dependencies.
Source provisioning is more like
terragrunt
Only it's more configurable
I realize we need to update our terragrunt migration guide.
Copy code
components:
  terraform:
    # REMOTE source - vendors from GitHub
    ipinfo:
      source:
        uri: "<http://github.com/cloudposse/atmos//examples/demo-library/ipinfo|github.com/cloudposse/atmos//examples/demo-library/ipinfo>"
        version: "main"
      provision:
        workdir:
          enabled: true
      vars:
        ip_address: "8.8.8.8"
It also supports a ttl parameter, for how long it will cache
When using source provisioning, make sure you also enable
workdir
b
thank you, so it's source-provisioning I'm looking for, how does it work with generated files like context and provider?
and the provider lock file?
e
Yes, the workflow is 1. create workdir 2. pull down the remote source 3. generate 4. continue as usual
b
what about the provider lock file?
e
Good question.
Terragrunt lets Terraform create/update
.terraform.lock.hcl
during init in the cached source directory, then copies that file back next to the folder containing the
terragrunt.hcl
so you can commit it. I believe that's how it works.
Atmos workdir/source provisioning runs Terraform in
.workdir
, so the lock file is naturally created/used there. If we want exact Terragrunt parity, the missing behavior would be copying
.terraform.lock.hcl
back from the workdir to the component/source location.
If this is something you'd like, can you create a github issue?
As a stop-gap, the newly announced
hooks
can probably be used for something post-terraform init
(note we haven't yet cut a release for that)
ETA today/tomorrow