Skip to content

Allow providing ATLANTIS_REPO_CONFIG_JSON as a YAML file #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nitrocode opened this issue May 3, 2021 · 5 comments
Closed

Allow providing ATLANTIS_REPO_CONFIG_JSON as a YAML file #204

nitrocode opened this issue May 3, 2021 · 5 comments

Comments

@nitrocode
Copy link
Member

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

The problem is that people think the only way to provide this information is by using a json file which is untrue. Something like this can be used.

server-atlantis.yaml

repos:
  - id: /.*/
    # allow repo level custom workflows
    allow_custom_workflows: true
    # allow repo level configs to override the following
    allowed_overrides:
      - apply_requirements
      - workflow
    apply_requirements:
      - approved
    workflow: default

main.tf

module "atlantis" {
  source  = "terraform-aws-modules/atlantis/aws"
  version = "~> 2.30.0"

  custom_environment_variables = [
    # Override server config
    {
      "name" : "ATLANTIS_REPO_CONFIG_JSON",
      "value" : jsonencode(yamldecode(file("${path.module}/server-atlantis.yaml"))),
    },
  ]

  # ...
}

Describe the solution you'd like.

We could provide a couple inputs

  • atlantis_repo_config_json
  • atlantis_repo_config_yaml_file

Describe alternatives you've considered.

We could simply document the jsonencode(yamldecode(file( method

Additional context

#116

@antonbabenko
Copy link
Member

Agree, PR is welcome :)

@nitrocode
Copy link
Member Author

Great! I just wanted to open discussion for the different methods to do this.

Documenting it would be easy but an input variable would probably be better. If no one has an opinion, then I'd like to put in a PR for an input var.atlantis_repo_config_yaml_file.

@antonbabenko
Copy link
Member

I think it will be fine if we ask users to pass it like this:

atlantis_repo_config_yaml_file  = jsonencode(yamldecode(file("${path.module}/server-atlantis.yaml")))

@antonbabenko
Copy link
Member

Fixed in #205

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants