#atmos (2023-07)

2023-07-05

Release notes from atmos avatar
Release notes from atmos
05:24:32 PM

v1.39.0 what Make Atmos understand Terraform configurations and dependencies Update atmos describe component command Update atmos describe affected command Add Atmos custom commands to atmos.yaml Update docs for atmos describe component and atmos describe affected commands why

Atmos now understands Terraform configurations and dependencies! (using a Terraform parser from HashiCorp) This is useful to detect component dependencies when a Terraform component in the components/terraform folder uses…

Release v1.39.0 · cloudposse/atmos

what

Make Atmos understand Terraform configurations and dependencies Update atmos describe component command Update atmos describe affected command Add Atmos custom commands to atmos.yaml Update d…

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse), on #office-hours, @Hans D shared he is dabbling with Cuelang to generate atmos configs

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i like Cue (even more than OPA :)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

would like to see that @Hans D

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the only issue with Cue is that almost nobody knows it, so it’s not easy for people to start using it

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

it can be used for configuration, generation and validation ( the nice part is that the configuration schema is used for validation automatically)

Hans D avatar

some small experiments re the component vendering:

package root

import (
	"github.com/hans-d/cue-atmos/lib:atmos"
)

_CloudPosse_AWS: atmos.#NamedVendorConfig & {
	name: string
	source: {
		uri: "github.com/cloudposse/terraform-aws-components.git//modules/\(name)?ref={{.Version}}"
		version: string | *"1.239.0"
	}
}

VendoredComponents: [Tool=_]: [Name=_]: atmos.#NamedVendorConfig & { name: string | *Name }
VendoredComponents: terraform: {
	"account-map":  _CloudPosse_AWS & {}
	"vpc": _CloudPosse_AWS & {}
	"vpc-flow-logs": _CloudPosse_AWS & {}
}


RenderedVendorConfig: [
	for tool_component,tool_config in VendoredComponents
		for cmp_name,cmp_config in tool_config {
			_tmp: atmos.#RenderVendorConfig & { params: {
				tool: tool_component
				config: cmp_config
			}}
			_tmp.result
	}
]
Hans D avatar

to spit out the various components.yaml files

Hans D avatar

still rough, but gets the job done atm

Hans D avatar

Still experimenting to get some decent stack config (without needing the various imports in the resulting yaml)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

that looks super, thanks for sharing

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i wanted to use Cue long time ago, but the fact that people don’t know it (and it’s not easy to read for sure) has stopped us

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
// ValidateWithCue validates the data structure using the provided CUE document
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

maybe after looking at what you are doing we’ll finish the Cue integration

Hans D avatar

Cue for validation should be quite easy and can be done without most people knowing cue is involved.

Hans D avatar

Using cue for the actual config is a different ball game (but would be great if supported natively)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i always wanted it

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

but was hesitating because of completely new language

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

it’s definitely better than yaml

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

but more complicated

Hans D avatar

I can assist.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

would be nice, thanks

Hans D avatar

For the stack, currently at:

stack: acme: core: test: {
	"us-east-2": {
		components: vpc: {
				vpc_1: baseline.vpc.default & { enabled: true }
		}
	}
	"eu-west-1": {
		components: vpc: {
				vpc_1: baseline.vpc.default & { enabled: true }
		}
	}
}

Includes various inheritance, region specific mixins, eg

stack: [NS=_]: [Tenant=_]: [Stage=_]: [Environment=_]: components?: [Component=_]: [Name=_]: {
	name: Name
	region: Environment
	if baseline[Component].region[Environment] != _|_ { baseline[Component].region[Environment] }
}

with the vpc component:

package baseline

import (
	cp "github.com/hans-d/cue-atmos/lib:cloudposse"
)

#vpc: cp.#aws_vpc

vpc: region: {
		"eu-west-1": {
			availability_zones: [ "eu-west-1a", "eu-west-1b", "eu-west-1c" ]
		}
		"us-east-2": {
			availability_zones: [ "us-east-2a", "us-east-2b", "us-east-2c" ]
		}
}

vpc: default: #vpc & {
		max_subnet_count: int | *3
		ipv4_primary_cidr_block: "10.8.0.0/18"
		nat_gateway_enabled: false
		nat_instance_enabled: false
		public_subnets_enabled: false
		subnet_type_tag_key: "acme/subnet/type"
		vpc_flow_logs_enabled: false
		vpc_flow_logs_log_destination_type: "s3"
		vpc_flow_logs_traffic_type: "ALL"
}
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

you are a Cue hero :) with your help we’ll eventually support Cue in Atmos

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I have to admit, that looks pretty darn clean.

Hans D avatar

Cue support within atmos doenst have to be fancy. The code above doesnt even have to be part of the go code. Those would be “sample”. Only thing needed is a way to execute cue and feed the output to atmos, could even be as simple as cue export my-config.cue --out yaml | atmos .... -f - where the -f - allows for supplying the whole config as 1 giant yaml file, or just redirect it to 1 or more yaml files (can be generated by cue), and having atmos process those normal yaml files.

Hans D avatar

Bonus would be having the module inputs available as schema, eg by some command to generate that from the variables.tf (in the case of cloudposse modules)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

all those cue commands can be Atmos custom commands, e.g. atmos cue …..

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
# Custom CLI commands
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
Atmos Subcommands | atmos

Atmos can be easily extended to support any number of custom commands, what we call “subcommands”.

sheldonh avatar
sheldonh

Dagger.io started with cue but moved towards SDK approach for pipeline as code. I think they experienced the same challenge of learning curve and adoption. It’s very confusing initially.

1
Hans D avatar

That is the difference between requiring cue, like dagger did, or using it as an option. For atmos i would say cue should (must?) be optional for the user

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i guess we could support both YAML (as it is now, and many people know it), and Cue (for advanced usage by advanced users)

2023-07-06

Release notes from atmos avatar
Release notes from atmos
10:44:35 PM

v1.40.0 what Documentation pages for GitHub Actions for Terraform Plan and Apply why Documented the two new GitHub actions for Terraform Plan and Apply

Release v1.40.0 · cloudposse/atmosattachment image

what

Documentation pages for GitHub Actions for Terraform Plan and Apply

why

Documented the two new GitHub actions for Terraform Plan and Apply

Matt Gowie avatar
Matt Gowie

Hey folks – How did the Atmos + Atlantis support end up turning out? Are there any users of that workflow? @jose.amengual maybe you?

We have a project coming up where the client is set on using Terragrunt. We were going to just accept that and use Atlantis with them so we didn’t need to write TF pipes, but now we’re finding out TG + Atlantis isn’t really that great of a combo? So I’m wondering if we can push them in another direction on the TF framework side, but wanted some more info on how Atlantis is working with Atmos.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

we’ve added a lot of atlantis functionality to atmos and created all the docs

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

but yes, @jose.amengual was the main driver of all of that

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
Atlantis Integration | atmos

Atmos natively supports Atlantis for Terraform Pull Request Automation.

jose.amengual avatar
jose.amengual

it is awesome

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@jose.amengual I know you asked for many improvements, and we did it, but maybe not everything

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

let us know if you have/had any issues that need to be fixed

jose.amengual avatar
jose.amengual

yes there is a few thing maybe I asked but I believe there is a lot covered for advance users/basic users

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

let us know if anything else, we’ll improve it as you tell us, you are the main Atlantis+Atmos person here

jose.amengual avatar
jose.amengual

Matt it works really well, I used without touching the Atlantis image because the customer was afraid of locking themself in to atmos and they wanted a away out, so my github action pushed varfiles and backendfiles for the PRs ( that is a bit annoying) to trigger atlantis runs

jose.amengual avatar
jose.amengual

so Atlantis had no idea atmos existed

jose.amengual avatar
jose.amengual

but I think you get far more by adding atmos to the atlantis image

jose.amengual avatar
jose.amengual

any question you might have, please do not hesitate to ask

Matt Gowie avatar
Matt Gowie

Awesome stuff – Great to know as I like having this as an option in our back pocket. Thanks the quick feedback @jose.amengual + @Andriy Knysh (Cloud Posse). If we do end up going this route, I’ll be sure to reach out!

1
1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

As an aside, we just launched native GitHub Actions support for Atmos. No atlantis needed.

https://atmos.tools/integrations/github-actions/atmos-terraform-plan

Atmos Terraform Plan | atmos

The Cloud Posse GitHub Action for “Atmos Terraform Plan” simplifies provisioning Terraform from within GitHub using workflows. Understand precisely what to expect from running a terraform plan from directly within the GitHub UI for any Pull Request.

cool-doge1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Atmos Terraform Apply | atmos

The Cloud Posse GitHub Action for “Atmos Terraform Apply” simplifies provisioning Terraform entirely within GitHub Action workflows. It makes it very easy to understand exactly what happened directly within the GitHub UI.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
jose.amengual avatar
jose.amengual

well Erik you broke my

jose.amengual avatar
jose.amengual

if you are using github this is awesome , if not well…Atlantis is definitely an option

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Yep, just an alternative.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Atlantis will work better with BitBucket, GitLab, etc. Also, we’ve only tested the GHAs so far with AWS.

Matt Gowie avatar
Matt Gowie

Yeah – I think we’d be an early user of the GHAs, but this client is on BitBucket, so we’ll likely be going that route.

Matt Gowie avatar
Matt Gowie

Thanks for sharing though Erik! Glad to see it released – I’m sure it’ll be a hit!

Release notes from atmos avatar
Release notes from atmos
11:04:34 PM

v1.40.0 what Documentation pages for GitHub Actions for Terraform Plan and Apply why Documented the two new GitHub actions for Terraform Plan and Apply

2023-07-07

2023-07-08

2023-07-10

Ion avatar

Hey all, I m trying to create admin stack for spacelift and getting this error message:

│ Error: the stack name pattern '{tenant}-{environment}-{stage}' specifies 'tenant`, but the stack 'catalog/account' does not have a tenant defined in the stack file 'catalog/account'
│ 
│   with module.child_stacks_config.module.spacelift_config.data.utils_spacelift_stack_config.spacelift_stacks,
│   on .terraform/modules/child_stacks_config.spacelift_config/modules/spacelift/main.tf line 1, in data "utils_spacelift_stack_config" "spacelift_stacks":
│    1: data "utils_spacelift_stack_config" "spacelift_stacks" {

I m running my command in geodesic container locally:

atmos terraform apply spacelift/admin-stack -s core-gbl-auto

Also, my file structure is like this :

stacks
   catalog
   core
   infra
   mixins

Any help will be highly appreciated!

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

run

atmos describe component spacelift/admin-stack -s core-gbl-auto
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

you should have tenant in vars

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if you don’t, then tenant is not defined in your stack files

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if you need tenant, then you have to define it in YAML config

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if you don’t use tenant, then in atmos.yaml you need to update the stack name pattern to {environment}-{stage}

Ion avatar

I do see tenant and we do use it

  stage: auto
  tenant: core
  terraform_version: 1.3.9
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

what do you have in atmos.yaml for this

stacks:
  # Can also be set using `ATMOS_STACKS_BASE_PATH` ENV var, or `--config-dir` and `--stacks-dir` command-line arguments
  # Supports both absolute and relative paths
  base_path: "stacks"
  # Can also be set using `ATMOS_STACKS_INCLUDED_PATHS` ENV var (comma-separated values string)
  # Since we are distinguishing stacks based on namespace, and namespace is not part
  # of the stack name, we have to set `included_paths` via the ENV var in the Dockerfile
  included_paths:
    - "orgs/**/*"
  # Can also be set using `ATMOS_STACKS_EXCLUDED_PATHS` ENV var (comma-separated values string)
  excluded_paths:
    - "**/_defaults.yaml"
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

included_paths must include all top-level stacks

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

excluded_paths must exclude all component-related config

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

in your case

stacks
   catalog
   core
   infra
   mixins
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
included_paths:
    - "core/**/*"
  # Can also be set using `ATMOS_STACKS_EXCLUDED_PATHS` ENV var (comma-separated values string)
  excluded_paths:
    - "**/_defaults.yaml"
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

what is in infra folder?

Ion avatar

infra is our infrastructure OU which has all workloads stages such as prod, staging etc

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

then it should be

included_paths:
    - "core/**/*"
    - "infra/**/*"
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

taking into account that both core and infra contains top-level stacks (and not other YAML files like components config, mixins etc)

Ion avatar

same issue, this is how my atmos.yaml looks like

base_path: ""
components:
  terraform:
    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_BASE_PATH' ENV var, or '--terraform-dir' command-line argument
    # Supports both absolute and relative paths
    base_path: "components/terraform"
    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE' ENV var
    apply_auto_approve: false
    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT' ENV var, or '--deploy-run-init' command-line argument
    deploy_run_init: true
    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE' ENV var, or '--init-run-reconfigure' command-line argument
    init_run_reconfigure: true
    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE' ENV var, or '--auto-generate-backend-file' command-line argument
    auto_generate_backend_file: false
stacks:
  # Can also be set using 'ATMOS_STACKS_BASE_PATH' ENV var, or '--config-dir' and '--stacks-dir' command-line arguments
  # Supports both absolute and relative paths
  base_path: "stacks"
  # Can also be set using 'ATMOS_STACKS_INCLUDED_PATHS' ENV var (comma-separated values string)
  included_paths:
    - "core//*"
    - "infra//"
  # Can also be set using 'ATMOS_STACKS_EXCLUDED_PATHS' ENV var (comma-separated values string)
  excluded_paths:
    - "/_defaults.yaml"
    - "catalog/**/*"

  # Can also be set using 'ATMOS_STACKS_NAME_PATTERN' ENV var
  name_pattern: "{tenant}-{environment}-{stage}"

workflows:
  # Can also be set using 'ATMOS_WORKFLOWS_BASE_PATH' ENV var, or '--workflows-dir' command-line arguments
  # Supports both absolute and relative paths
  base_path: "stacks/workflows"

logs:
  verbose: false
  colors: true
Ion avatar

and my file structure

Ion avatar

its weird because everything works for other components, I can deploy all my aws components and it works. The only one is not working is the admin-stack for spacelift

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

try

included_paths:
    - "core/**/*"
    - "infra/**/*"
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

not

included_paths:
    - "core//*"
    - "infra//"
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

and

excluded_paths:
    - "/_defaults.yaml"
    - "catalog/**/*"
    - "mixins/**/*"
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if still not working, you can DM me your repo and I’ll take a look

2023-07-11

Bisshwajit Samanta avatar
Bisshwajit Samanta

Hi Team,, I am looking for 1 help about atmos tool. We are seeing that some tag name change through spacelift for drift detection.. My question was how to know where the values are passing to it.. My question is like where the value syca-plat-use2-dev in the below example comes from.. any pointers is helpful

 # module.store_write.aws_ssm_parameter.default["/platform/syca-plat-use2-dev-eks-cluster/_metadata/kube_version"] will be updated in-place
  ~ resource "aws_ssm_parameter" "default" {
        id          = "/platform/syca-plat-use2-dev-eks-cluster/_metadata/kube_version"
        name        = "/platform/syca-plat-use2-dev-eks-cluster/_metadata/kube_version"
      ~ tags        = {
            "Environment" = "xx"
          ~ "Name"        = "syca-plat-use2-dev" -> "syca-plat-use2-dev-platform"
            "Namespace"   = "xx"
            "Stage"       = "xx"
            "Tenant"      = "xx"
        }
      ~ tags_all    = {
          ~ "Name"        = "syca-plat-use2-dev" -> "syca-plat-use2-dev-platform"
            # (4 unchanged elements hidden)
        }
        # (9 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

this is not related to Atmos. This looks like the Spacelift component was updated and the new version tries to use diff Spacelift stack names

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

please ask this question in CloudPosse Slack

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

cc @Jeremy White (Cloud Posse)

Bisshwajit Samanta avatar
Bisshwajit Samanta

ok..

Linda Pham (Cloud Posse) avatar
Linda Pham (Cloud Posse)

I moved it to our general channel in Cloud Posse

2023-07-12

2023-07-13

Imran Hussain avatar
Imran Hussain

is there a way to template a workflow ?to have it rendered before it is run

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

currently not

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

and this is not that straightforward b/c to execute a Go template you need to provide a context (all the variables defined in the template). So to implement this, all those variables will have to be provided somehow, possibly on the command line. This looks too complicated (and we need to think about it)

jose.amengual avatar
jose.amengual

How do you guys are managing the interface for custom policies being pass as inputs in Atmos? I just do not like much the fact users need to pass this huge blob of text in the stack, I’m trying to think how to organize it

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

write the policy to a file in the folder policies in the component’s folder, update the component to accept a file name, read from the file in TF

jose.amengual avatar
jose.amengual

I c ok, I have done that for other components

jose.amengual avatar
jose.amengual

I was trying to think of maybe using the iam-policy module and pass actions, principals and such to create ehe policy instead

2023-07-14

Release notes from atmos avatar
Release notes from atmos
05:24:36 PM

v1.41.0 what Add exampes and tests for validation of components with multiple hierarchical inheritance why

Show that the settings.validation section is inherited all the way down the inheritance chain, even when using multiple abstract bae components, and atmos validate component command executes the validation policies placed at any level of the inheritance hierarchy base-component-1 is an abstract component, and it has the settings.validation section defined using an OPA policy base-component-3 is…

Release v1.41.0 · cloudposse/atmosattachment image

what

Add exampes and tests for validation of components with multiple hierarchical inheritance

why

Show that the settings.validation section is inherited all the way down the inheritance chain,…

Release notes from atmos avatar
Release notes from atmos
05:44:36 PM

v1.41.0 what Add exampes and tests for validation of components with multiple hierarchical inheritance why

Show that the settings.validation section is inherited all the way down the inheritance chain, even when using multiple abstract bae components, and atmos validate component command executes the validation policies placed at any level of the inheritance hierarchy base-component-1 is an abstract component, and it has the settings.validation section defined using an OPA policy base-component-3 is…

2023-07-19

Brian avatar

Is it possible to rename files when vendoring? I know it is possible via mixins . How can it be done via source?

Brian avatar

I want all pulled file to be have a modified name.

# example
main.tf  -> main.vendored.tf

… from this config…

apiVersion: atmos/v1
kind: ComponentVendorConfig
metadata:
  name: tfstate-backend
spec:
  source:
    uri: github.com/cloudposse/terraform-aws-components.git//modules/tfstate-backend?ref={{.Version}}
    version: 1.256.0
    included_paths:
      - "**/*.tf"
      - "**/*.tfvars"
      - "**/*.md"
    excluded_paths:
      - "**/context.tf"
    mixins:
      - uri: <https://raw.githubusercontent.com/cloudposse/terraform-null-label/0.25.0/exports/context.tf>
        filename: context.tf
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

not possible using source

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the whole purpose of vendoring is to bring your repo up to date with the upstream repo

Brian avatar

Ah… Okay. I understand.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if we start changing and renaming files, it will be not possible to compare anything

Brian avatar

Yeah… I guess it also could lead to colision too. eg, If the same file was vendored with different names.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

you can always use https://developer.hashicorp.com/terraform/language/files/override to add your own files and override the upstream configuration (leaving the upstream files untouched)

Override Files - Configuration Language | Terraform | HashiCorp Developerattachment image

Override files merge additional settings into existing configuration objects. Learn how to use override files and about merging behavior.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

there is a way of doing it using source thou

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

exclude a file that you don’t want to vendor

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

and vendor the file in mixins under a diff name

1
Brian avatar

Thanks. Not being able to rename when vending is no big deal.

I have used atmos for the past 2+ years. But today was the first time I decided to use the feature (and will continue to do so).

You have explained the problem vendoring is solving, so I will adjust.

1
jose.amengual avatar
jose.amengual

@Erik Osterman (Cloud Posse) I was watching the office hours and I hear the question about monorepo modules

jose.amengual avatar
jose.amengual

we are creating a big monorepo project with like 300+ modules

jose.amengual avatar
jose.amengual

we have been thinking on a few different ways ( using atmos)

jose.amengual avatar
jose.amengual

one is to do releases for every single component change

jose.amengual avatar
jose.amengual

another was to create tags per components 1.1.1-vpc ( for the vpc module release)

jose.amengual avatar
jose.amengual

the tag per component is nice since you have a lot of granular control

jose.amengual avatar
jose.amengual

that is why I asked @Andriy Knysh (Cloud Posse) about adding atmos the ability to do Vendoring of specific version of component versions based on some metadata like:

components:
  terraform:
    vpc:
      metadata:
          component: vpc
          version: `1.1.1-vpc`
      vars:
        name: vpc
jose.amengual avatar
jose.amengual

and by defining that and adding some setting on atmos.yaml

jose.amengual avatar
jose.amengual

atmos could automatically do a atmos vendor pull inside the component folder, and if no component.yaml ( vendoring file) exist then it will pull all the files or it just reads the component.yaml and does the pull

jose.amengual avatar
jose.amengual

basically is like adding a init cycle in atmos as how like terraform init does

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Yea, we’ve considered that too. So far, we haven’t yet decided on the path forward.

jose.amengual avatar
jose.amengual

another thing to add is that this pattern is known to everyone that uses terraform , so is easy to understand

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

The hard part is knowing what the next version of a component should be

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I think we would need to couple it with a file based versioning approach

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

So each component defines it’s version. When it’s merged, that version gets tagged. But that way there’s not a global version moving forward.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We need a sane way to release multiple components at the same time that are part of a release too.

jose.amengual avatar
jose.amengual

global as for all components ?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I don’t know how to say… just that the vpc might be at 1.0.0 and eks might be at 5.0.0

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

the next “patch” release of the VPC is not 1.0.0 –> 5.0.1 for example. It’s 1.0.1

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

That means we have to know what the previous release was

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

It could be calculated from the tags, or it could be a version file.

jose.amengual avatar
jose.amengual

wait, you can have 1.0.2-vpc, 5.0.2-eks component tags and you keep going that way but the whole components repo can have the releases , which will include every time the latest version of each component

jose.amengual avatar
jose.amengual

meaning that you do not create a release for the individual components, you just create tags

jose.amengual avatar
jose.amengual

but those are treated as independent component releases

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

But what about when vpc reaches 5.0.2 6 months later.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

There was a 5.0.2 release already.

jose.amengual avatar
jose.amengual

why that does it matter? the terraform-aws-components could be in version 3.0.1 and that will included the vpc component that is happen to be at tag 5.0.6-vpc

jose.amengual avatar
jose.amengual

so you will endup with version not aligned for sure

jose.amengual avatar
jose.amengual

and millions of tags

jose.amengual avatar
jose.amengual

the release of terraform-aws-components at version 3.0.1 does not even have to look at the latest tags of the vpc component, you just always merge the individual component tags to main and do not delete the tags after it

jose.amengual avatar
jose.amengual

which in a way is the same as file versioning? but instead of using a commit hash you use a tag

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

The problem is if you cut a release for 5.0.2, and that release created 5.0.2-eks; then months later, it’s time to release the vpc 5.0.2, if you use a “github release” it will now be in conflict.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

keep in mind, i’m not saying a github release of 5.0.2-vpc

jose.amengual avatar
jose.amengual

why? 5.0.2 can only be used for the whole repo, 5.0.2-eks can only be use for the eks release tag

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

anyways, my point is you can’t use releases.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

you can use tags.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

or releases that equal the tags

jose.amengual avatar
jose.amengual

I think we are saying the same thing

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

ok

jose.amengual avatar
jose.amengual

I will jump to the next office hours since is a problem we are trying to solve too

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Cool, please do

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

(also, our incentives might be a little bit different; we’re solving this for components and need a way to keep them stable at various major releases while also not inhibit new development)

jose.amengual avatar
jose.amengual

same here

2023-07-28

Release notes from atmos avatar
Release notes from atmos
02:04:34 PM

v1.42.0 what Add Sprig functions to Atmos Go templates in imports Various fixes and improvements for atmos describe component and component dependencies calculation Update docs https://atmos.tools/cli/commands/describe/component/ why

Sprig functions in Atmos Go templates in imports provide…

Release v1.42.0 · cloudposse/atmosattachment image

what

Add Sprig functions to Atmos Go templates in imports Various fixes and improvements for atmos describe component and component dependencies calculation Update docs https://atmos.tools/cli/com

Sprig Function Documentation

Useful template functions for Go templates.

atmos describe component | atmos

Use this command to describe the complete configuration for an Atmos component in an Atmos stack.

Release notes from atmos avatar
Release notes from atmos
02:24:36 PM

v1.42.0 what Add Sprig functions to Atmos Go templates in imports Various fixes and improvements for atmos describe component and component dependencies calculation Update docs https://atmos.tools/cli/commands/describe/component/ why

Sprig functions in Atmos Go templates in imports provide…

    keyboard_arrow_up