Don't have the apply be automatic after a review is approved; terraform apply's occasionally go sideways and need human intervention (remember: rollbacks are not automatic). A human should always kick off the apply and monitor state change activity.
And thanks for the suggestion. So far it's been on a someday maybe list, but if it really does help that much, maybe we'll bump it to someday maybe soon.
- Are you commenting with the output of show on the planfile to get human-readable version?
- Line by line commenting on comments?
- Do you have state-splits? Do you run plan on each individually for every PR?
Shameless plug, if anybody is looking for a guide on getting started with Terraform and Google Cloud Platform, I wrote a short blog post:
https://blog.elasticbyte.net/getting-started-with-terraform-...
I've run into another similar type issue now and I think that I'm going to have to do state surgery like you. I want to refactor some of my terraform resources into modules, but this changes the resource names. I can't see any way to do it without either standing up new infrastructure or modifying the state directly.
https://github.com/sevagh/goat
This way in Terraform I provision a group of volumes, a group of instances, and rely on `goat` to do the rest.
(Btw I think I know people you know... also in Montreal and I know a couple folks at AdGear!)
And yes this way I keep EBS and the rest of my recipes as far away as possible.
Something like:
``` kafka-volumes/ <ebs volumes> terraform.tfstate kafka/ (use local backend ../kafka-volumes/terraform.tfstate) <ec2 instances> ```
1) Update the launch configuration of your un-used ASG ( with the new AMI ID )
2) Apply terraform to deploy the new ASG
3) Make sure it's working ( your local app on your new instances )
4) Connect the ELB to your new ASG
5) Set the old ASG to 0 instances to drain the connections
[0] https://www.terraform.io/docs/configuration/resources.html#c...
https://robmorgan.id.au/posts/rolling-deploys-on-aws-using-t...
Is it possible to query information directly from a state file? Some interpolation would help. I ask this because I often refer to resource information from another project, and I don't see that modules are helpful.
I posted my work-around here [1] some days ago . The real code was not there because I haven't had permission for my company, but it's very short and easy to write by anyone.
Thanks for your reading.
[1] https://github.com/icy/oops/blob/master/terraform/problem_1_...
Disclaimer: ex-HashiCorp employee.
Terraform v0.9 only handles remote state and locking properly. Handling multiple applies of state is something scheduled for 0.10
Basically terragrunt handles some stuff today in a less robust, less portable, way that your team is likely to need today -- whilst waiting for core terraform support.
(disclaimer: I follow terragrunt and terraform very closely but do not actually use terragrunt in producution anymore).