Slackbot
02/16/2024, 4:00 PMChris Denneen
02/16/2024, 4:24 PMversion: 3 to this file... so it ran but those variables don't seem to be added to the plan so getting No value for required variable still in the atlantis plan outputDylan Page
02/16/2024, 8:22 PMChris Denneen
02/16/2024, 8:23 PMChris Denneen
02/16/2024, 8:23 PMDylan Page
02/16/2024, 8:24 PMChris Denneen
02/16/2024, 8:24 PMChris Denneen
02/16/2024, 8:25 PMChris Denneen
02/16/2024, 8:26 PMDylan Page
02/16/2024, 8:26 PMDylan Page
02/16/2024, 8:27 PMDylan Page
02/16/2024, 8:27 PMChris Denneen
02/16/2024, 8:28 PMDylan Page
02/16/2024, 8:28 PMenv step won't do anything, and I'm guessing that workflow isn't being used properlyChris Denneen
02/16/2024, 8:29 PMChris Denneen
02/16/2024, 8:36 PMChris Denneen
02/16/2024, 8:42 PMChris Denneen
02/16/2024, 8:43 PMPePe Amengual
02/16/2024, 8:48 PMPePe Amengual
02/16/2024, 8:48 PMChris Denneen
02/20/2024, 5:40 PMChris Denneen
02/20/2024, 5:41 PMversion: 3
workflows:
default:
plan:
steps:
- env:
name: TF_VAR_aws_account_id
value: "1111111111111"
- env:
name: TF_VAR_gitlab_token
command: 'echo "$ATLANTIS_GITLAB_TOKEN"'
- env:
name: TF_VAR_aws_region
value: "us-east-1"
- env:
name: TF_VAR_account_name
value: "awsdev"
and none of these are available when atlantis runs the plan complains about missing variables aws_account_id, gitlab_token, aws_region and account_nameChris Denneen
02/20/2024, 5:48 PMrepos:
- id: /.*/
allow_custom_workflows: true
allowed_overrides:
- apply_requirements
- workflow
apply_requirements:
- approved
workflow: default
so based on the docs that altantis.yaml which is setting those 4 environment variables should be working when the project MR is sent to the webhookPePe Amengual
02/20/2024, 6:03 PMPePe Amengual
02/20/2024, 6:03 PMPePe Amengual
02/20/2024, 6:03 PMChris Denneen
02/20/2024, 6:04 PMChris Denneen
02/20/2024, 9:00 PM. workspace: default
running "/home/atlantis/.atlantis/bin/terraform1.7.3 plan -input=false -refresh -out \"/home/atlantis/.atlantis/repos/gitops/infra/eks_cluster/24/default/default.tfplan\"" in "/home/atlantis/.atlantis/repos/gitops/infra/eks_cluster/24/default": exit status 1
β·
β Error: No value for required variable
β
β on <http://variables.tf|variables.tf> line 27:
β 27: variable "account_name" {
β
β The root module input variable "account_name" is not set, and has no
β default value. Use a -var or -var-file command line argument to provide a
β value for this variable.
β΅
β·
β Error: No value for required variable
β
β on <http://variables.tf|variables.tf> line 30:
β 30: variable "aws_account_id" {
β
β The root module input variable "aws_account_id" is not set, and has no
β default value. Use a -var or -var-file command line argument to provide a
β value for this variable.
β΅
β·
β Error: No value for required variable
β
β on <http://variables.tf|variables.tf> line 38:
β 38: variable "gitlab_token" {
β
β The root module input variable "gitlab_token" is not set, and has no
β default value. Use a -var or -var-file command line argument to provide a
β value for this variable.
β΅
β·
β Error: No value for required variable
β
β on <http://variables.tf|variables.tf> line 58:
β 58: variable "aws_region" {
β
β The root module input variable "aws_region" is not set, and has no default
β value. Use a -var or -var-file command line argument to provide a value for
β this variable.
β΅Chris Denneen
02/20/2024, 9:08 PMatlantis.yamlPePe Amengual
02/20/2024, 9:41 PMChris Denneen
02/20/2024, 9:42 PMversion: 3
workflows:
default:
plan:
steps:
- env:
name: TF_VAR_aws_account_id
value: "11111111111"
- env:
name: TF_VAR_gitlab_token
command: 'echo "$ATLANTIS_GITLAB_TOKEN"'
- env:
name: TF_VAR_aws_region
value: "us-east-1"
- env:
name: TF_VAR_account_name
value: "capdev"PePe Amengual
02/20/2024, 9:51 PMChris Denneen
02/20/2024, 10:04 PMPePe Amengual
02/20/2024, 10:14 PMPePe Amengual
02/20/2024, 10:15 PMPePe Amengual
02/20/2024, 10:16 PMChris Denneen
02/20/2024, 10:18 PMdefault but if I add the following to make a custom workflow it seems to not complain about the variables missing:
version: 3
projects:
- name: eks_cluster
dir: .
workflow: terraform
workflows:
terraform:
plan:
steps:
- env:
name: TF_VAR_aws_account_id
value: "11111111111"
- env:
name: TF_VAR_gitlab_token
command: 'echo "$ATLANTIS_GITLAB_TOKEN"'
- env:
name: TF_VAR_aws_region
value: "us-east-1"
- env:
name: TF_VAR_account_name
value: "capdev"
- init
- plan
so only thing I did different was add a projects block and change default to terraform and then add an init and plan at bottom... now my error is slightly different due to an STS assume thing but that's something I can work out... but if this should work for default then it doesn't make much sense to me as to why it wasn't working with what I had beforePePe Amengual
02/20/2024, 10:50 PMPePe Amengual
02/20/2024, 10:50 PMDylan Page
02/20/2024, 10:51 PMPePe Amengual
02/20/2024, 10:57 PMPePe Amengual
02/20/2024, 10:58 PMPePe Amengual
02/20/2024, 10:58 PM# allowed_overrides specifies which keys can be overridden by this repo in
# its atlantis.yaml file.
allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge, repo_locking, custom_policy_check]PePe Amengual
02/20/2024, 10:59 PMallowed_overrides: [ workflow]PePe Amengual
02/20/2024, 10:59 PMPePe Amengual
02/20/2024, 11:00 PMChris Denneen
02/21/2024, 2:56 PMDylan Page
02/21/2024, 3:17 PMChris Denneen
02/21/2024, 3:18 PMPePe Amengual
02/21/2024, 6:12 PMPePe Amengual
02/21/2024, 6:12 PMPePe Amengual
02/21/2024, 6:15 PMatlantis server --config=atlantis-server-config.yamlPePe Amengual
02/21/2024, 6:17 PM#atlantis-url: "localhost"
gh-user: jamengual
gh-token: "SDFSFGSFSDGSDFGSDFGSDFGSDFGSDFG"
repo-allowlist: "*"
gh-webhook-secret: "#$%%$$%$%#%#$%%#"
repo-config: atlantis-repo-config.yaml
enable-diff-markdown-format: true
silence-vcs-status-no-plans: true
hide-prev-plan-comments: true
log-level: debug
atlantis-url: "<http://localhost:4141>"
api-secret: "$%^$%^$%^$^DFGDFGDFGDFG"
# enable-regexp-cmd: truePePe Amengual
02/21/2024, 6:17 PMatlantis-repo-config.yamlPePe Amengual
02/21/2024, 6:17 PMrepos:
- id: /.*/
allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge]
allow_custom_workflows: true
apply_requirements: [mergeable]PePe Amengual
02/21/2024, 6:18 PMatlantis-server-config.yaml could be pass all as flags to the container definition