#atmos (2022-02)
2022-02-01
@Erik Osterman (Cloud Posse) has joined the channel
@Lucky has joined the channel
@Leo Przybylski has joined the channel
@Ben Smith (Cloud Posse) has joined the channel
@Max Lobur (Cloud Posse) has joined the channel
@Steven Hopkins has joined the channel
@Hugo Samayoa has joined the channel
@Dan Meyers has joined the channel
@RB has joined the channel
@Yonatan Koren has joined the channel
@Andy Miguel has joined the channel
@Maxim Mironenko (Cloud Posse) has joined the channel
@johncblandii has joined the channel
@Jeremy G (Cloud Posse) has joined the channel
@Andriy Knysh (Cloud Posse) has joined the channel
@Matt Gowie has joined the channel
@Imran Hussain has joined the channel
@omry has joined the channel
@Stewart Henderson has joined the channel
@Matthew has joined the channel
@Mike Crowe has joined the channel
what is atmos?
That’s the Atmosphere Processor?”“Yep, that’s it. Remarkable piece of machinery, completely automated. You know, we manufacture those, by the way.Ripley and Burke, regarding the APP on LV-426…
lol
2022-02-02
I’m looking for some guidance for the local usage of Atmos with cloudposse/stack-config/yaml
(latest version) and terraform-provider-utils
.
Since using the newer version, I’m running into issues where Atmos is not able to find its config easily and requiring me to symlink (or copy) the YAML file to atmos.yaml
to ~/.atmos
and additionally set ATMOS_BASE_PATH
to the current directory otherwise the module won’t be able to find the stack config, because Terraform is executing within the component’s folder.
I’m not sure about configurability, but it would make sense to me to set that with Atmos before command execution. Unfortunately, my Go skills are more of the read-only variety, so I can’t really open a PR for that.
We were using a softlink for the atmos yaml file until the recent addition of the ATMOS_BASE_PATH
env var which we now set to $(pwd)
of the repo root
export ATMOS_BASE_PATH=$(pwd)
i havent noticed any issues since.
are you using the latest 1.3.26 of atmos?
That’s kind of what I ended up doing. I’ll do more tests to see if both are necessary, but setting ATMOS_BASE_PATH
is definitely required now.
the ENV var is required
otherwise there is no way to set the correct base path since it can be executed from ant=y folder (root of the repo, or any component folder). And the path needs to be absolute
the latest version of geodesic
sets ATMOS_BASE_PATH
automatically
or you can do export ATMOS_BASE_PATH=$(pwd)
in your Dockefile
Thanks Andriy! I haven’t had a look at geodesic
for a while because it wasn’t trivial to port to M1 and had some compatibility issues. Have just seen Erik’s comment on that issue so will give it another go.
geodesic should work now on M1
or just add export ATMOS_BASE_PATH=$(pwd)
to your Dockefile
Hey everyone, a quick question, in Atmos, I’m working on deploying a new organization with the account component utilizing atmos. Can anyone point in the atmos example repo, where the tenant
variable is defined?
while we are still working on good atmos
docs :slightly_smiling_face: , the example shows a complete solution using tenant
https://github.com/cloudposse/atmos/tree/master/examples/complete
Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc) - atmos/examples/complete at master · cloudposse/atmos
it also shows all new features like stack and components folders, component multiple inheritance , etc.
this config shows all the settings regarding tenant
https://github.com/cloudposse/atmos/blob/master/examples/complete/rootfs/usr/local/etc/atmos/atmos.yaml
Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc) - atmos/atmos.yaml at master · cloudposse/atmos
the stacks show folder structure with multiple stages (accounts) and multiple tenants https://github.com/cloudposse/atmos/tree/master/examples/complete/stacks
Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc) - atmos/examples/complete/stacks at master · cloudposse/atmos
then use commands like
atmos terraform plan test/test-component-override-3 -s tenant1-ue2-dev
@Andriy Knysh (Cloud Posse) – not sure a confluence link is helpful here?
deleted, I thought it was public
here is a list of atmos
commands that work with the example
atmos version
atmos describe config
atmos describe component test/test-component-override -s tenant1-ue2-dev
atmos describe component infra/infra-server -s tenant1-ue2-dev
atmos terraform plan test/test-component-override -s tenant1-ue2-dev
atmos terraform deploy top-level-component1 -s tenant1-ue2-dev
atmos terraform deploy top-level-component1 -s tenant1-ue2-dev --deploy-run-init=true
atmos terraform destroy top-level-component1 -s tenant1-ue2-dev
atmos terraform validate test/test-component-override -s tenant1-ue2-dev
atmos terraform output test/test-component-override -s tenant1-ue2-dev
atmos terraform graph test/test-component-override -s tenant1-ue2-dev
atmos terraform show test/test-component-override -s tenant1-ue2-dev
atmos terraform workspace test/test-component-override --stack=tenant1-ue2-dev
atmos terraform varfile test/test-component-override -s tenant1-ue2-dev
atmos terraform varfile test/test-component-override -s tenant1-ue2-dev -f ./varfile.json
atmos terraform generate backend test/test-component-override -s tenant1-ue2-dev
atmos terraform clean test/test-component-override -s=tenant1-ue2-dev
atmos terraform workspace test/test-component-override --stack=tenant1-ue2-dev
atmos terraform shell test/test-component-override -s=tenant1-ue2-dev
atmos helmfile diff infra/infra-server -s tenant1-ue2-dev
2022-02-03
There a good cookiecutter repo for starting a new atmos-driven project by chance?
It’s on our short term roadmap
We might take a slightly different approach though. I want the functionality built into atmos
Maybe we can do cookie cutter for the exposure
Cc @Andriy Knysh (Cloud Posse)
Since atmos is in go, cookie cutter in python, thinking to use one of the open source go projects
Go has a cookiecutter equiv? I’ve always just used cookiecutter to scaffold out example or template things like tf modules or starter projects for other languages like Go
I suppose gomplate with some clever flags/pipes could do much of the same
There is an abandoned project called boilr we may use for inspiration
No code ever dies
well, except the bad code hopefully I guess….
So you were thinking maybe just an atmos init
command instead?
it is an opinionated tool after all so that would make sense
2022-02-04
Where’s the right (or best?) place to put workspace_key_prefix
? I see examples with it in global.yaml
, others with it in the components
we don’t put any config for a component in globals.yaml
anymore (since it triggers all Spacelift stacks). All default config for a component goes into catalog/<component>.yaml
also, the latest atmos does not require setting workspace_key_prefix
see https://github.com/cloudposse/atmos/pull/77
what Detect ENV vars in YAML stack config and set them for command execution Make workspace_key_prefix config DRY Don't delete the generated terraform varfiles after each command Update tests …
you can override it if needed, but it’s set automatically now
I should be able to do this after the state is merged into s3, right?
atmos terraform plan tfstate-backend -s root
For some reason, plan is thinking it needs to recreate the same s3 bucket/dynamo db tables I’ve already done. Maybe I can’t do
so in cold-start, you first create it using local state
then add the backend config for s3 to the component
run the command, TF should ask you to move the state
and it will move it automatically
@Andriy Knysh (Cloud Posse) – is there a way to tell what backend will be used when you use atmos terraform plan
? After apply, I’m seeing the state in components/terraform/root-route53/terraform.tfstate.d/ue1-root/terraform.tfstate
but I don’t know how to show that I’m not setup correctly
(my assumption is that file should be blank like it is in tfstate-backend
)
you have to add the backend file to each component
in backend.tf.json
{
"terraform": {
"backend": {
"s3": {
"acl": "bucket-owner-full-control",
"bucket": "xxx-uw2-root-tfstate",
"dynamodb_table": "xxx-uw2-root-tfstate-lock",
"encrypt": true,
"key": "terraform.tfstate",
"region": "us-west-2",
"role_arn": "arn:aws:iam::xxxx:role/xxx-gbl-root-terraform",
"workspace_key_prefix": "xxxxx"
}
}
}
}
or even better:
Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc) - atmos/atmos.yaml at master · cloudposse/atmos
set it to true, and atmos will generate the backend automatically (from the component/stack config)
2022-02-08
hi there!
I’m just starting to learn Atmos but I already love the concept.
Is there any visual material I could look into? My brain doesn’t cope well with fresh code, but i’ve been trough the Infrastructure as Code book so have solid grounds.
also look at this working example https://github.com/cloudposse/atmos/tree/master/examples/complete - it shows how to organize/separate components (terraform code/logic) and stacks (configuration)
Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc) - atmos/examples/complete at master · cloudposse/atmos
you can just clone the repo and run these commands from the root of the repo
go run github.com/cloudposse/atmos version
go run github.com/cloudposse/atmos describe config
go run github.com/cloudposse/atmos terraform plan test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform apply test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform deploy test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform validate test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform output test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform graph test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform show test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform workspace test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos describe component test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos describe component test/test-component-override-3 -s tenant1-ue2-dev
go run github.com/cloudposse/atmos describe component infra/infra-server -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform generate backend test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform clean test/test-component-override -s tenant1-ue2-dev
go run github.com/cloudposse/atmos terraform shell test/test-component-override -s tenant1-ue2-dev
thank you, I’ve been down the rabbit hole but now I can start looking at these.
Thank you again!
2022-02-12
v1.3.27 Enhancements Fix component path prefix if base component provided @aknysh (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1134415228” data-permission-text=”Title is private” data-url=”https://github.com/cloudposse/atmos/issues/120“…
Enhancements Fix component path prefix if base component provided @aknysh (#120) what Fix component path prefix if base component is provided Update Go version why If a component config is…
aknysh has 210 repositories available. Follow their code on GitHub.
what Fix component path prefix if base component is provided Update Go version why If a component config is a derived component and a base component is specified (which points to the terraform …
2022-02-15
Hello! Can this component be used (dns-primary) when I’m setting up a sub-domain (eg. subdomain.xyz.com) and the primary domain (eg. xyz.com) already exists and is being managed outside this stack?
2022-02-16
Mineiros folks came out with their own Terraform Framework (similar to Atmos): https://github.com/mineiros-io/terramate
Interesting to check out.
Terramate is a tool for managing multiple terraform stacks
Everyone loves the term “stack” it seems. People can’t get enough of it.
Terramate is a tool for managing multiple terraform stacks
HCL Code Generation
Terramate supports the generation of arbitrary HCL code using
both <globals.md|globals> and <metadata.md|metadata>.
The generated code can then be composed/referenced by any Terraform code
inside a stack (or some other tool that uses HCL).
HCL code generation starts with the definition of a generate_hcl
block in a Terramate configuration file defining the code you
want to generate inside the block. The code may include:
• Blocks, sub blocks, etc • Attributes initialized by literals • Terramate Global references • Terramate Metadata references • Expressions using interpolation, functions, etc
Most of what you can do in Terraform can be done in a generate_hcl
block. References to Terramate globals and metadata are evaluated, but any
other reference is just transported to the generated code (partial evaluation).
Each generate_hcl
block requires a single label.
This label is the filename of the generated code.
Inside the generate_hcl
block a content
block is required.
All code inside content
is going to be used to generate the final code.
Now lets jump to some examples. Lets generate backend and provider configurations
for all stacks inside a project.
Given these globals defined on the root of the project:
globals {
backend_data = "backend_data"
provider_data = "provider_data"
provider_version = "0.6.6"
terraform_version = "1.1.3"
}
We can define the generation of a backend configuration for all
stacks by defining a generate_hcl
block in the root
of the project:
generate_hcl "[backend.tf](http://backend.tf)" {
content {
backend "local" {
param = global.backend_data
}
}
}
Which will generate code for all stacks using the filename [backend.tf](http://backend.tf)
:
backend "local" {
param = "backend_data"
}
To generate provider/terraform configuration for all stacks we can add
in the root configuration:
generate_hcl "[provider.tf](http://provider.tf)" {
content {
provider "name" {
param = global.provider_data
}
terraform {
required_providers {
name = {
source = "integrations/name"
version = global.provider_version
}
}
}
terraform {
required_version = global.terraform_version
}
}
}
Which will generate code for all stacks using the filename [provider.tf](http://provider.tf)
:
provider "name" {
param = "provider_data"
}
terraform {
required_providers {
name = {
source = "integrations/name"
version = "0.6.6"
}
}
}
terraform {
required_version = "1.1.3"
}
Hierarchical Code Generation
HCL code generation can be defined anywhere inside a project, from a specific
stack, which defines code generation only for the specific stack, to parent dirs
or even the project root, which then has the potential to affect code generation
to multiple or all stacks (as seen in the previous example).
There is no overriding or merging behavior for generate_hcl
blocks.
Blocks defined at different levels with the same label aren’t allowed, resulting
in failure for the overall code generation process.
seems like they’ve taken a terragrunt approach
adopted HCL
terramate run --changed terraform apply
interesting
Yeah definitely terragruntesque. I’m not actually sure how they differ honestly.
I may write up a post on the differences between the various Terra frameworks. I feel like folks would be interested in that.
That would be medium worthy!
I’d buy that for a dollar
2022-02-18
2022-02-21
v1.3.28 Enhancements Fix Terraform workspace for remote state for derived components in subfolders @aknysh (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1145193302” data-permission-text=”Title is private”…
Enhancements Fix Terraform workspace for remote state for derived components in subfolders @aknysh (#121) what Fix Terraform workspace for remote state for derived components in subfolders Ge…
aknysh has 210 repositories available. Follow their code on GitHub.
1.3.28: Fix Terraform workspace for remote state for derived components in su… …bfolders (#121)
Updates
Updates
Updates
Updates
Updates
Updates
Updates
Updates
Updates
Updates
Updates
Updates
Updates…
…bfolders (#121) Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates Updates …
what Fix Terraform workspace for remote state for derived components in subfolders General code improvements why Terraform workspace for remote state for derived components in subfolders was cal…
1.3.28 Fix Terraform workspace for remote state for derived components in su…
…bfolders (#121)
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Updates
-
Auto Format
-
Updates
-
Auto Format
Co-authored-by:…
@Andriy Knysh (Cloud Posse) Friendly suggestion to check out using git rebase --interactive
to cut down on the commit log. It can be a great way to clean up a long running set of changes like this with a succinct message.
something went wrong with the GH action for the release. We use “Squash and Merge” so usually we don’t see all those commits
Ah yeah that makes sense as Squash from GH UI should’ve solved this too.
v1.3.29 what & why Fix the failed releases https://github.com/cloudposse/atmos/releases/tag/v1.3.28 https://github.com/cloudposse/atmos/releases/tag/1.3.28
what & why Fix the failed releases https://github.com/cloudposse/atmos/releases/tag/v1.3.28 https://github.com/cloudposse/atmos/releases/tag/1.3.28
Enhancements Fix Terraform workspace for remote state for derived components in subfolders @aknysh (#121) what Fix Terraform workspace for remote state for derived components in subfolders Ge…
Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc) - Release 1.3.28 · cloudposse/atmos