Carlo Schizzo
04/25/2023, 9:53 AM├── prod
│ ├── bucket
│ │ └── terragrunt.hcl
│ ├── common_vars.yaml
│ └── terragrunt.hcl
└── stage
├── bucket
│ └── terragrunt.hcl
├── common_vars.yaml
└── terragrunt.hcl
my `repo_config.json`:
{
"repos": [
{
"id": "<http://bitbucket.workday.com/Build|bitbucket.workday.com/Build> Engineering/terraform-gcp",
"branch": "/master/",
"allowed_overrides": [
"workflow"
],
"allow_custom_workflows": true,
"apply_requirements": [
"approved",
"mergeable"
],
"pre_workflow_hooks": [
{
"run": "cp atlantis/config/atlantis-dev.yaml ./atlantis.yaml",
"description": "getting atlantis configuration for terraform-gcp project"
}
]
}
]
}
finally my atlantis.yaml
version: 3
automerge: false
parallel_apply: false
parallel_plan: false
projects:
- dir: test-atlantis/prod/bucket
workflow: terragrunt
- dir: test-atlantis/stage/bucket
workflow: terragrunt
workflows:
terragrunt:
plan:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: printenv
- run: terragrunt plan -out $PLANFILE
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt apply $PLANFILE
atlantis.yaml
which comes from the Atlantis documentation I get this error:
...
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.[0m
Error: Too many command line arguments
To specify a working directory for the plan, use the global -chdir flag.
For more help on using this command, run:
terraform plan -help
...
$PLANFILE
with the following:
version: 3
automerge: false
parallel_apply: false
parallel_plan: false
projects:
- dir: test-atlantis/prod/bucket
workflow: terragrunt
- dir: test-atlantis/stage/bucket
workflow: terragrunt
workflows:
terragrunt:
plan:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt plan-all --terragrunt-non-interactive -no-color -out default.tfplan
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt apply-all "default.tfplan" --terragrunt-non-interactive -no-color
It works, but I'm confused as the official documentation says to use $PLANFILE
and help?PePe Amengual
04/25/2023, 3:35 PM