{"action":"created","issue":{"url":"https://api.github.com/repos/gruntwork-io/terragrunt/issues/25","repository_url":"https://api.github.com/repos/gruntwork-io/terragrunt","labels_url":"https://api.github.com/repos/gruntwork-io/terragrunt/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/gruntwork-io/terragrunt/issues/25/comments","events_url":"https://api.github.com/repos/gruntwork-io/terragrunt/issues/25/events","html_url":"https://github.com/gruntwork-io/terragrunt/issues/25","id":175022665,"number":25,"title":"Add ability to choose .terragrunt file path or specify options on command line","user":{"login":"mildred","id":33804,"avatar_url":"https://avatars.githubusercontent.com/u/33804?v=3","gravatar_id":"","url":"https://api.github.com/users/mildred","html_url":"https://github.com/mildred","followers_url":"https://api.github.com/users/mildred/followers","following_url":"https://api.github.com/users/mildred/following{/other_user}","gists_url":"https://api.github.com/users/mildred/gists{/gist_id}","starred_url":"https://api.github.com/users/mildred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mildred/subscriptions","organizations_url":"https://api.github.com/users/mildred/orgs","repos_url":"https://api.github.com/users/mildred/repos","events_url":"https://api.github.com/users/mildred/events{/privacy}","received_events_url":"https://api.github.com/users/mildred/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gruntwork-io/terragrunt/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/gruntwork-io/terragrunt/labels/help%20wanted","name":"help wanted","color":"128A0C"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-05T08:42:05Z","updated_at":"2016-09-29T16:15:20Z","closed_at":"2016-09-16T14:11:23Z","body":"I am working on a special environment, and I would like the ability to choose a different `.terragrunt` file than the one on the current directory, or, even better, the ability to specify the options on the command line or environment variables. Currently, I'm automatically generating the `.terragrunt` file."},"comment":{"url":"https://api.github.com/repos/gruntwork-io/terragrunt/issues/comments/250514735","html_url":"https://github.com/gruntwork-io/terragrunt/issues/25#issuecomment-250514735","issue_url":"https://api.github.com/repos/gruntwork-io/terragrunt/issues/25","id":250514735,"user":{"login":"brikis98","id":711908,"avatar_url":"https://avatars.githubusercontent.com/u/711908?v=3","gravatar_id":"","url":"https://api.github.com/users/brikis98","html_url":"https://github.com/brikis98","followers_url":"https://api.github.com/users/brikis98/followers","following_url":"https://api.github.com/users/brikis98/following{/other_user}","gists_url":"https://api.github.com/users/brikis98/gists{/gist_id}","starred_url":"https://api.github.com/users/brikis98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brikis98/subscriptions","organizations_url":"https://api.github.com/users/brikis98/orgs","repos_url":"https://api.github.com/users/brikis98/repos","events_url":"https://api.github.com/users/brikis98/events{/privacy}","received_events_url":"https://api.github.com/users/brikis98/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T16:15:20Z","updated_at":"2016-09-29T16:15:20Z","body":"> The terraform files are already fully generic.\r\n\r\nIt seems like you're using Terraform in a somewhat non-standard way. Terraform is a declarative language, so typically, there is a one-to-one mapping between your Terraform files and what's actually deployed. For example, to deploy a single EC2 Instance to `us-east-1`, you'd put the following code in `main.tf`:\r\n\r\n```hcl\r\nprovider \"aws\" {\r\n  region = \"us-east-1\"\r\n}\r\n\r\nresource \"aws_instance\" \"example\" {\r\n  ami = \"ami-2d39803a\"\r\n  instance_type = \"t2.micro\"\r\n}\r\n```\r\n\r\nIf you wanted to deploy that code to `us-east-1` and `us-west-1`, the standard way to do that is NOT to run terraform twice on the same template, tweaking the `region` parameter in `provider.aws` each time, but to create two templates, one under `us-east-1/main.tf` and one under `us-west-1/main.tf`. \r\n\r\nTo avoid having to copy/paste all the EC2 Instance code into each environment, you could define that code in a [module](https://www.terraform.io/docs/modules/usage.html) and reuse that module in both `us-east-1/main.tf` and `us-west-1/main.tf`. Of course, you'd also have a separate `.terragrunt` file in each folder. \r\n\r\nWith this idiomatic and declarative approach, your Terraform templates actually represent the code deployed in production. On the other hand, if you just keep reusing the exact same templates by tweaking parameters and configuring different state files, then your code does NOT represent what's deployed, and you have to go digging through your AWS account and understand the full history of deployments to reason about what's actually running. Terraform's declarative nature is actually one of its biggest advantages, something I discuss more in depth [here](https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation-7989dad2865c).\r\n\r\nWhat exactly is your use case? Is there a reason you can't use the declarative approach with it?"}}
{"actor":{"display_login":"brikis98"}}