-1

Variables are not supported in S3 backend I need alternative way to do this can any one suggests I go through online some are saying terragrunt some are say like python, workspaces.environments.Actually we are built some Dev environment for clients from the app they will enter the details like for ec2 they will enter count, ami, type from here all are fine but with the backend state file issue which does not support variables I need to change every time bucket name,path.Can some one please explain me the structure and sample code to resolve this thanks in advance. #23208

venu d
  • 1

1 Answers1

0

You don't need to have different backends for every client, you need to have different tfstate. Then you can use terraform init --reconfigure "key=<client>", where <client> is an identifier you set for your clients.

  • Thanks for the responce Can you please help me with how to set identifier for clients and how the path vary for different I mean key value how it differ from provider profile.. – venu d Oct 28 '19 at 17:48
  • @venud how to identify the client is something actually up to you. You said they enter the ec2 details, but how? Are they signing in into something or whatever? The different path for different tfstates is just the ``. It can be `/foo/bar/client1` for example. –  Oct 28 '19 at 17:54
  • if they need vm with mandatory params they will log into portal and enter the details count,ami like that I am asking to store there state files by profile which they pick up from. aws/credentials folder I am asking about the state file storing for different accounts in different paths possibility – venu d Oct 28 '19 at 18:04