#geodesic (2022-03)

geodesic https://github.com/cloudposse/geodesic

Discussions related to https://github.com/cloudposse/geodesic

Archive: https://archive.sweetops.com/geodesic/

2022-03-08

Michael Dizon avatar
Michael Dizon

hey everyone! i’m going through the README in the atmos repo, and I’m not sure how to run the example using docker. The README mentions going into the example directory and running make all there’s no make file in that directory.

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

can you link to the readme you’re referring to?

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

If you use this tutorial, it should work

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

But it should be cleared up…

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

also you’ll need to run make init first

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

cc @Andriy Knysh (Cloud Posse)

Michael Dizon avatar
Michael Dizon

@Erik Osterman (Cloud Posse) are we supposed to just clone tf components into the components/terraform directory manually now? i was using vendir with the last version of atmos

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
# Geodesic: <https://github.com/cloudposse/geodesic/>
ARG GEODESIC_VERSION=0.152.2
ARG GEODESIC_OS=debian
# atmos: <https://github.com/cloudposse/atmos>
ARG ATMOS_VERSION=1.3.30
# Terraform
ARG TF_VERSION=1.1.4

FROM cloudposse/geodesic:${GEODESIC_VERSION}-${GEODESIC_OS}

# Geodesic message of the Day
ENV MOTD_URL="<https://geodesic.sh/motd>"

# Some configuration options for Geodesic
ENV AWS_SAML2AWS_ENABLED=false
ENV AWS_VAULT_ENABLED=false
ENV AWS_VAULT_SERVER_ENABLED=false
ENV GEODESIC_TF_PROMPT_ACTIVE=false
ENV DIRENV_ENABLED=false

# Enable advanced AWS assume role chaining for tools using AWS SDK
# <https://docs.aws.amazon.com/sdk-for-go/api/aws/session/>
ENV AWS_SDK_LOAD_CONFIG=1
ENV AWS_DEFAULT_REGION=us-east-2

# Install specific version of Terraform
ARG TF_VERSION
RUN apt-get update && apt-get install -y -u --allow-downgrades \
  terraform-1="${TF_VERSION}-*" && \
  update-alternatives --set terraform /usr/share/terraform/1/bin/terraform

ARG ATMOS_VERSION
RUN apt-get update && apt-get install -y --allow-downgrades \
  atmos="${ATMOS_VERSION}-*"

COPY rootfs/ /

# Geodesic banner message
ENV BANNER="atmos"

WORKDIR /

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

So as far as atmos is concerned, the components must “exist”. How they get there is flexible.

  1. Copy them in manually and commit to VCS (which is what we do)
  2. Use vendir to pull them in from remote sources. We want to get there, we will be building this into atmos natively. vendir is the best alternative today.
  3. Use git submodules and make sure to run git clone --recurse-submodules
1
Michael Dizon avatar
Michael Dizon

@Andriy Knysh (Cloud Posse) what am i supposed to pass when running docker run ?

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

nothing to pass, everything is defined in the dockerfile

Michael Dizon avatar
Michael Dizon

@Andriy Knysh (Cloud Posse) i think i’m missing a step. here’s what I get when i run

Michael Dizon avatar
Michael Dizon
########################################################################################            
# No filesystem is mounted at /localhost which limits Geodesic functionality.
# EXIT THIS SHELL and on your host computer,
# run the following to install the script that runs 
# Geodesic with all its features (the recommended way to use Geodesic):
#
#   docker run --rm cloudposse/geodesic:latest-debian init | bash
#
# After that, you should be able to launch Geodesic just by typing
#
#   geodesic
#

`

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

do you see the prompt? Execute any shell command

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

try docker exec or docker attach https://docs.docker.com/engine/reference/commandline/attach/ (attach is what I do in IntelliJ IDEA)

docker attachattachment image

docker attach: Use docker attach to attach your terminal’s standard input, output, and error (or any combination of the three) to a running container using the container’s ID or name….

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

@Michael Dizon did you get past your problems?

Michael Dizon avatar
Michael Dizon

@Erik Osterman (Cloud Posse) yep! thanks for following up. i have project that I built with the previous atmos release. trying to get it moved over!

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

@Michael Dizon let us know if you have any questions

Michael Dizon avatar
Michael Dizon

@Andriy Knysh (Cloud Posse) def!

Michael Dizon avatar
Michael Dizon

@Andriy Knysh (Cloud Posse) running into an issue with the latest version of account-map in the terraform-aws-components repo. when i run atmos terraform plan account-map -s tenant1-ue1-dev i get the following error:

│ Error: open ../../../stacks/tenant1-ue1-dev.yaml: no such file or directory
│ 
│   with module.accounts.module.backend_config.data.utils_stack_config_yaml.config,
│   on .terraform/modules/accounts/modules/backend/main.tf line 8, in data "utils_stack_config_yaml" "config":
│    8: data "utils_stack_config_yaml" "config" {
│ 
Michael Dizon avatar
Michael Dizon

atmos.yml, stacks and components are in the same directory level

Michael Dizon avatar
Michael Dizon

it seems like it’s looking for a single yaml file derived from the name_pattern, but my stacks follow the directory/file pattern defined in the examples

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

this looks like an error from the utils provider which is used in remote-state - we’ll have to look at terraform-aws-components component’s files

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

also, we usually deploy account and account-map in gbl environment (not in ue1) since those are global and not region-specific

1
Michael Dizon avatar
Michael Dizon

@Andriy Knysh (Cloud Posse) i just saw the latest release on the atmos repo. will adding stack_name_pattern to the config for account-map resolve the issue i’m encountering?

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

stack_name_pattern is just for Spacelift, to name Spacelift stacks (not related to anything else)

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

what issues are you facing now?

Michael Dizon avatar
Michael Dizon

@Andriy Knysh (Cloud Posse) running into an issue with the latest version of account-map in the terraform-aws-components repo. when i run atmos terraform plan account-map -s tenant1-ue1-dev i get the following error:

│ Error: open ../../../stacks/tenant1-ue1-dev.yaml: no such file or directory
│ 
│   with module.accounts.module.backend_config.data.utils_stack_config_yaml.config,
│   on .terraform/modules/accounts/modules/backend/main.tf line 8, in data "utils_stack_config_yaml" "config":
│    8: data "utils_stack_config_yaml" "config" {
│ 
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

I think you need to look at atmos.yaml config https://github.com/cloudposse/atmos/blob/master/atmos.yaml#L1

# CLI config is loaded from the following locations (from lowest to highest priority):
Michael Dizon avatar
Michael Dizon

am i supposed to have a yaml file that follows that naming convention?

Michael Dizon avatar
Michael Dizon

my stacks are set up to use directories for tenants and environments eg tenant1/ue1/dev.yaml

Michael Dizon avatar
Michael Dizon

not tenant1-ue1-dev.yaml

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

``atmos.yaml` is the CLI config (not related to stacks). You need to have it in one of the supported locations

Michael Dizon avatar
Michael Dizon

yes, i have atmos.yaml in the same location as in the example

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

if you run atmos describe config, you should see the config defined in your atmos.yaml

Michael Dizon avatar
Michael Dizon

the same level as components and stacks, you mentioned last week that it looks like there’s an error in the utils provider, and i’m wondering if that’s still the case. I see that the remote-state module is referencing 0.19.0 is that the correct version for the latest version of atmos?

Michael Dizon avatar
Michael Dizon

here’s the output of atmos describe config

{
  "base_path": "",
  "Components": {
    "Terraform": {
      "base_path": "./components/terraform",
      "apply_auto_approve": false,
      "deploy_run_init": true,
      "auto_generate_backend_file": true
    },
    "Helmfile": {
      "base_path": "components/helmfile",
      "kubeconfig_path": "/dev/shm",
      "helm_aws_profile_pattern": "{namespace}-{tenant}-gbl-{stage}-helm",
      "cluster_name_pattern": "{namespace}-{tenant}-{environment}-{stage}-eks-cluster"
    }
  },
  "Stacks": {
    "base_path": "./stacks",
    "included_paths": [
      "**/*"
    ],
    "excluded_paths": [
      "globals/**/*",
      "catalog/**/*",
      "**/*globals*"
    ],
    "name_pattern": "{tenant}-{environment}-{stage}"
  },
  "Workflows": {
    "base_path": "./workflows"
  },
  "Logs": {
    "verbose": false,
    "colors": true
  }
}
Michael Dizon avatar
Michael Dizon

i appreciate your answering my questions btw . it’s not obvious to me where exactly I’m missing something

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


I see that the remote-state module is referencing 0.19.0 is that the correct version for the latest version of atmos?

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

no, you should use 0.22.1

Michael Dizon avatar
Michael Dizon

i am thinking of bumping the version of remote-state to 0.22.1

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

you can send me your code (or open a PR), I’ll review

Michael Dizon avatar
Michael Dizon

ok, i’ll be able to work on that tomorrow

Michael Dizon avatar
Michael Dizon
module "accounts" {
  source  = "cloudposse/stack-config/yaml//modules/remote-state"
  version = "0.19.0"

  component               = "account"
  privileged              = true
  stack_config_local_path = "../../../stacks"

  context = module.this.context
}

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

when bumping to 0.22.1, remove stack_config_local_path = "../../../stacks"

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

it gets automatically calculated by atmos using atmos.yaml

Michael Dizon avatar
Michael Dizon

ok i can try that now. are there any other things i’ll need to update?

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

for the remote state, it should be enough (given that the provider can find atmos.yaml in one of the supported locations

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

oh, for the provider… it runs from the component folder

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

so atmos.yaml can’t be in the root of the repo

Michael Dizon avatar
Michael Dizon

oh..

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

it should be in /usr/local/etc/atmos/atmos.yaml

Michael Dizon avatar
Michael Dizon

is that last part a typo?

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

fixed

1
Michael Dizon avatar
Michael Dizon

I had to create the atmos directory in etc . After moving atmos.yaml to that directory, I’m ran into the following error

╷
│ Error:
│ No stack config files found in the provided paths:
│ - /localhost/Code/xxx/testing/components/terraform/account-map/stacks/**/*
│
│
│ Check if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config files or ENV vars.
│
│   with module.accounts.data.utils_component_config.config,
│   on .terraform/modules/accounts/modules/remote-state/main.tf line 1, in data "utils_component_config" "config":
│    1: data "utils_component_config" "config" {
Michael Dizon avatar
Michael Dizon

i just updated the base_path. looks like that made some progress

Michael Dizon avatar
Michael Dizon

i’ll be able to continue on this tomorrow. hopefully this was helpful for you guys as well.

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

this is usually what we use

# Base path for components and stacks configurations.
# Can also be set using `ATMOS_BASE_PATH` ENV var, or `--base-path` command-line argument.
# Supports both absolute and relative paths.
# If not provided or is an empty string, `components.terraform.base_path`, `components.helmfile.base_path` and `stacks.base_path`
# are independent settings (supporting both absolute and relative paths).
# If `base_path` is provided, `components.terraform.base_path`, `components.helmfile.base_path` and `stacks.base_path`
# are considered paths relative to `base_path`.
base_path: ""

components:
  # Settings for all terraform 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"
1
Michael Dizon avatar
Michael Dizon

what

• account-map/modules/iam-roles, account-map/remote-state - updated remote-state version to 0.22.1 • added arn_format variable to tfstate-backend, account-map/modules/iam-roles, and account-settings

why

• updating remote state to 0.22.1 from 0.19.0 resolves issue with latest version of atmos • adding arn_format to support deployment in GovCloud regions

Michael Dizon avatar
Michael Dizon

my lucky number

2022-03-09

2022-03-11

2022-03-22

Release notes from geodesic avatar
Release notes from geodesic
11:00:19 PM

v0.152.3 Included Tools Update AWS CLI packages @renovate (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1160152700” data-permission-text=”Title is private” data-url=”https://github.com/cloudposse/geodesic/issues/776” data-hovercard-type=”pull_request”…

Release v0.152.3 · cloudposse/geodesicattachment image

Included Tools Update AWS CLI packages @renovate (#776) This PR contains the following updates: Package Change Age Adoption Passing Confidence awscli (source, changelog) ==1.22.63 -> ==…

renovate - Overview

renovate has one repository available. Follow their code on GitHub.

Update AWS CLI packages by renovate[bot] · Pull Request #776 · cloudposse/geodesicattachment image

This PR contains the following updates: Package Change Age Adoption Passing Confidence awscli (source, changelog) ==1.22.63 -> ==1.22.79 boto3 ==1.21.8 -> ==1.21.24 Release Not…

2022-03-23

2022-03-26

Release notes from geodesic avatar
Release notes from geodesic
12:20:19 AM

v0.152.4 Included Tools Update AWS CLI packages @renovate (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1181395345” data-permission-text=”Title is private” data-url=”https://github.com/cloudposse/geodesic/issues/778” data-hovercard-type=”pull_request”…

Release v0.152.4 · cloudposse/geodesicattachment image

Included Tools Update AWS CLI packages @renovate (#778) This PR contains the following updates: Package Change Age Adoption Passing Confidence awscli (source, changelog) ==1.22.79 -> ==…

renovate - Overview

renovate has one repository available. Follow their code on GitHub.

Update AWS CLI packages by renovate[bot] · Pull Request #778 · cloudposse/geodesicattachment image

This PR contains the following updates: Package Change Age Adoption Passing Confidence awscli (source, changelog) ==1.22.79 -> ==1.22.82 boto3 ==1.21.24 -> ==1.21.27 Release No…

2022-03-27

    keyboard_arrow_up