#geodesic (2022-03)
Discussions related to https://github.com/cloudposse/geodesic
Archive: https://archive.sweetops.com/geodesic/
2022-03-08
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.
can you link to the readme you’re referring to?
If you use this tutorial, it should work
But it should be cleared up…
also you’ll need to run make init
first
cc @Andriy Knysh (Cloud Posse)
@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
run this Dockerfile https://github.com/cloudposse/atmos/blob/master/examples/complete/Dockerfile
# 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 /
So as far as atmos
is concerned, the components must “exist”. How they get there is flexible.
- Copy them in manually and commit to VCS (which is what we do)
- 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. - Use git submodules and make sure to run
git clone --recurse-submodules
@Andriy Knysh (Cloud Posse) what am i supposed to pass when running docker run
?
nothing to pass, everything is defined in the dockerfile
@Andriy Knysh (Cloud Posse) i think i’m missing a step. here’s what I get when i run
########################################################################################
# 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
#
`
do you see the prompt? Execute any shell command
try docker exec
or docker attach
https://docs.docker.com/engine/reference/commandline/attach/ (attach
is what I do in IntelliJ IDEA)
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….
@Michael Dizon did you get past your problems?
@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!
@Michael Dizon let us know if you have any questions
@Andriy Knysh (Cloud Posse) def!
@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" {
│
atmos.yml
, stacks
and components
are in the same directory level
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
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
also, we usually deploy account and account-map in gbl
environment (not in ue1) since those are global and not region-specific
@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?
stack_name_pattern
is just for Spacelift, to name Spacelift stacks (not related to anything else)
what issues are you facing now?
the same as above with the utils
provider in remote-state
https://sweetops.slack.com/archives/CB84E9V54/p1648415337485669?thread_ts=1646770874.240219&cid=CB84E9V54
@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" {
│
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):
am i supposed to have a yaml file that follows that naming convention?
my stacks are set up to use directories for tenants and environments eg tenant1/ue1/dev.yaml
not tenant1-ue1-dev.yaml
``atmos.yaml` is the CLI config (not related to stacks). You need to have it in one of the supported locations
yes, i have atmos.yaml
in the same location as in the example
if you run atmos describe config
, you should see the config defined in your atmos.yaml
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?
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
}
}
i appreciate your answering my questions btw . it’s not obvious to me where exactly I’m missing something
I see that the remote-state
module is referencing 0.19.0
is that the correct version for the latest version of atmos?
no, you should use 0.22.1
i am thinking of bumping the version of remote-state to 0.22.1
you can send me your code (or open a PR), I’ll review
ok, i’ll be able to work on that tomorrow
the code i am referencing is here https://github.com/cloudposse/terraform-aws-components/blob/master/modules/account-map/remote-state.tf
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
}
when bumping to 0.22.1, remove stack_config_local_path = "../../../stacks"
it gets automatically calculated by atmos using atmos.yaml
ok i can try that now. are there any other things i’ll need to update?
for the remote state, it should be enough (given that the provider can find atmos.yaml
in one of the supported locations
oh, for the provider… it runs from the component folder
so atmos.yaml
can’t be in the root of the repo
oh..
it should be in /usr/local/etc/atmos/atmos.yaml
is that last part a typo?
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" {
i just updated the base_path. looks like that made some progress
i’ll be able to continue on this tomorrow. hopefully this was helpful for you guys as well.
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"
@Andriy Knysh (Cloud Posse) https://github.com/cloudposse/terraform-aws-components/pull/404
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
my lucky number
2022-03-09
2022-03-11
2022-03-22
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”…
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 has one repository available. Follow their code on GitHub.
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
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”…
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 has one repository available. Follow their code on GitHub.
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…