Skip to content

Allow passing custom arguments from Atlantis command to Atlantis.yaml - use case for custom init arguments. #113

@mechastorm

Description

@mechastorm

Problem

This feature will help my team integrate our existing terraform projects with Atlantis with minimal changes.

We currently use the env/{env}.tfvars project structure with the addition of a env/{env}.backend.tfvars for unique remote backend configs per environments.

.
├── env
│   ├── production.tfvars
│   ├── production.backend.tfvars
│   ├── staging.tfvars
│   └── staging.backend.tfvars
└── main.tf

In our workflow, when we do terraform init, it will be

terraform init -backend-config=production.backend.tfvars

Currently Atlantis does not seem to able to support this structure.

Wish

Be able to initialize a custom backend config file from the atlantis command.

Suggestion

Utilizing the atlantis.yaml config, I could in theory have a config like

extra_arguments:
  - command_name: init
    arguments:
    - "-backend-config=env/${MY_ENV_NAME}.backend.tfvars "
  - command_name: plan
    arguments:
    - "-var-file=env/${MY_ENV_NAME}.tfvars "

Then in an MR/PR, I can run the atlantis command (in theory)

atlantis plan --extra-args="MY_ENV_NAME=staging"

I believe this feature would allow users extra flexibility as well in doing additional custom hooks with the atlantis.yaml config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions