4 ms·
Terraform is great because it lets you treat infrastructure as code, but I don't think it makes any promises about cloud agnosticism. In fact it's the opposite,
by dantiberian 8y ago
Terraform is great because it lets you treat infrastructure as code, but I don't think it makes any promises about cloud agnosticism. In fact it's the opposite, each provider is specific to the service that they are offering.
Rather than Terraform offering a lowest common denominator set of resource definitions, each provider can be designed to work in a way that most naturally maps to their offerings and API.
In theory you could write modules that provide abstractions over multiple cloud providers, but I don't know how good a result that would give.
- scarface74 8y agoIn that case, if you're on AWS, then why not just use CloudFormation? CloudFormation is a lot more powerful on AWS than TF.
- geggam 8y agoBecause editing yaml or json sucks.
- scarface74 8y agoLinked from Hashicorp’s Getting Started page... https://github.com/terraform-providers/terraform-provider-aws/blob/master/examples/two-tier/main.tf https://github.com/terraform-providers/terraform-provider-aw...
- marcinzm 8y agoWhich is neither json or yaml...
- scarface74 8y agoIt's yet another semi-json format that doesn't have widespread support by any other parsers. Even Hashicorp recommends JSON if you want something that is machine readable.
- KajMagnus 8y agoI think it looks lovely :- ) having used Puppet a bit in the past. Look how simple: `inline = ["sudo apt-get -y update", ... install nginx ...` Terraform seems to be. .... hmm, apparently one can use things like Chef & Puppet etc together with Terraform, I eventually noticed.
- geggam 8y agothe nice way to do this is to pass the chef role to the user data template in the autoscale group vars { ROLE = "bastion" Then append this to the user_data.tpl file chef-client --audit-mode enabled -R -E ${chef_environment} -r role[${ROLE}] Allows you to use the same user_data.tpl file for multiple autoscale groups
- jasonlotito 8y agoCloudFormation is just for AWS Services. We use terraform for more than just AWS Services. HCL is also much nicer to work with than CF. I've also never found anything CF can do that TF can't. I have, however, found many things TF can do that CF can't.
- scarface74 8y agoI admittedly live in an AWS bubble when it comes to infrastructure and netops. I’m mostly a developer whose only expertise at modern netops and infrastructure is AWS. I could see where TF would be a better solution for infrastructure that spans providers. As far as what CF can’t do with respect to AWS, most if not all of the missing pieces can be remedied with custom lambda backed resources and/or Python scripting with troposphere.
- wichert 8y agoWhile CloudFormation is lovely, it has a couple of real downsides: - very often something new is introduced on AWS without any CloudFormation support, so you will either need to write custom resources with lambda functions, or be prepared to wait a long time. From the few times I checked TF is actually faster to support new services / features. - CloudFormation has extensive documentation, but very often you end up having to also read AWS API documentation and going through a dozen trial & error attempts before you get something working. - occasionally CloudFormation can get stuck and leave you in a state you can not recover from. Luckily AWS support tends to be very responsive and can help you here, and it hasn't been happening as much as 1-2 years ago - CloudFormation has very little support for reusing things: no macro support, very limited include support, no support for YAML aliases (unless you use "aws cloudformation package" as a workaround) - CloudFormation changesets are nice, but do not work if you use sub-stacks (which you should use) Just like Zope there is a bit of a Z-shaped learning curve: there is a pretty steep learning curve to start, after which a lot of things become easy. But when you get to more complex things suddenly everything becomes frustratingly difficult again. That may come with the territory; I have not used other tools such as TF so I can't tell if that is a problem-space specific thing.
- scarface74 8y agoFor context, I’m both relatively new with CF and the CF “expert” at my company - in the land of the blind, the one eyed man is king. occasionally CloudFormation can get stuck and leave you in a state you can not recover from. Luckily AWS support tends to be very responsive and can help you here, and it hasn't been happening as much as 1-2 years ago I had just the opposite experience with AWS support. CloudFormation was stuck because I had a syntax error in my Node based custom resource so of course it waited for a response from the lambda that it wasn’t getting and then when I tried to cancel the stack creation, it again called the same broken lambda to delete the resource and hilarity ensued. This was after I corrected the lambda and ran it successful to create another stack. I did a live chat with AWS support and all they did was quote the user documentation - after trying to explain that I am not trying to create a lambda resource and it’s not trying to delete an ENI. I finally just gave up and waited 4-5 hours for the rollback to time out. Just like Zope there is a bit of a Z-shaped learning curve: there is a pretty steep learning curve to start, after which a lot of things become easy. I’m very much at the second valley on the Z. I spent quite awhile getting the hang of CF just to make my code deployments easier (creating parameters, autoscaling groups, launch configurations, lambdas, etc.) but I haven’t had to do anything especially complicated.