Skip to content

Simplify Terrform Backend configuration #66

@ankek

Description

@ankek

Current configuration of TF Backend.
backend "http" {
username = "hs2d21pk"
password = "pO(BwDTjs5ND"
address = "http://localhost:4000/client/clivern/monitoring/prod/state"
lock_address = "http://localhost:4000/client/clivern/monitoring/prod/lock"
unlock_address = "http://localhost:4000/client/clivern/monitoring/prod/unlock"
lock_method = "POST"
unlock_method = "POST"
}

Desired configuration of TF Backend.

terraform {
backend "remote" {
hostname = "http://localhost:4000/api_path"
organization = "company"
token = "tXXkgPPOYDk4Sx5wxWtrXT4qPZxYq72yqOe2HpUQNjedW"
workspaces {
name = "clivern-monitoring-prod" # ${project}-${workspace}-${environment}
}
}

Additional context
I want to propose you use "remote" backend instead of "http". There are a lot of benefits like:

  • No need to create unique username and password for each environment in Project. Mostly project managed by team and you can create "team" token for authentication and authorization within team creation. Segregation and isolation resources created in one project could be based on environment definition (or workspace+environment, if you would have a will/chance/etc. to do this (-: ).
  • No need to redefine it in back-end configurations each time.
  • This is very brief explanation. Feel free to ping me if you will needed more details.
    Please find more details in

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions