# Terraform support

**URL:** <https://forum.serverless.com/t/terraform-support/228>\
**Category:** Serverless Framework\
**Created:** [September 4, 2016, 9:09pm UTC](https://forum.serverless.com/t/terraform-support/228 "2016-09-04T21:09:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauriciomelo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/mauriciomelo/32/108_2.png) [@mauriciomelo](https://forum.serverless.com/u/mauriciomelo)\
**Post date:** [September 4, 2016, 9:09pm UTC](https://forum.serverless.com/t/terraform-support/228/1 "2016-09-04T21:09:48Z")

</div>

Is there a way to integrate with **Terraform** infrastructure management like what apex does?

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [September 4, 2016, 11:19pm UTC](https://forum.serverless.com/t/terraform-support/228/2 "2016-09-04T23:19:32Z")

</div>

Serverless uses CloudFormation under the hood, so using Terraform is not beneficial (since the infrastructure is already code).

---

<div class="post-metadata">

**Author:** ![flomotlik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/flomotlik/32/3_2.png) [@flomotlik](https://forum.serverless.com/u/flomotlik)\
**Post date:** [September 5, 2016, 5:30pm UTC](https://forum.serverless.com/t/terraform-support/228/3 "2016-09-05T17:30:18Z")

</div>

Yup as rowanu already mentioned we’re built completely on top of CF (decided on that in the beginning instead of Terraform to stay close to AWS).

If you want to manage other resources in Terraform and deploy Serverless resources through CF thats definitely possible, you then just need to make sure that your Serverless functions can access those other resources you’ve set up through Terraform (although I think this would lead to a lot of pain to be honest)

---

<div class="post-metadata">

**Author:** ![mauriciomelo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/mauriciomelo/32/108_2.png) [@mauriciomelo](https://forum.serverless.com/u/mauriciomelo)\
**Post date:** [September 7, 2016, 1:48am UTC](https://forum.serverless.com/t/terraform-support/228/4 "2016-09-07T01:48:36Z")

</div>

Thanks for the quick response!  
I asked because some coworkers prefer terraform over CF because of past problems they had with some instability and confiability of CF. Did you guys have problems regarding CF that is important to mention?

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [September 8, 2016, 6:09am UTC](https://forum.serverless.com/t/terraform-support/228/5 "2016-09-08T06:09:33Z")

</div>

Not sure what they’re talking about with regards to instability with CloudFormation; I work solely with AWS and CFN is **the** way you manage AWS resources, and it was actually one of the reasons I started using the Serverless Framework - because it’s backed by CFN.

When I see articles [like this](https://charity.wtf/2016/02/23/two-weeks-with-terraform/) about TF it makes me want to avoid it…

---

<div class="post-metadata">

**Author:** ![flomotlik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/flomotlik/32/3_2.png) [@flomotlik](https://forum.serverless.com/u/flomotlik)\
**Post date:** [September 8, 2016, 12:06pm UTC](https://forum.serverless.com/t/terraform-support/228/6 "2016-09-08T12:06:13Z")

</div>

We use Terraform in some of our internal Serverless projects as well (one of our engineers really likes it) and it has its up/downsides. For the main Serverless Services we want to go with the “provider native” configuration management system as any other system will simply not be used by larger companies, especially enterprises.

---

<div class="post-metadata">

**Author:** ![n44o](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@n44o](https://forum.serverless.com/u/n44o)\
**Post date:** [April 11, 2017, 4:07pm UTC](https://forum.serverless.com/t/terraform-support/228/7 "2017-04-11T16:07:26Z")

</div>

@rowanu  
I know this thread is pretty old, but I’m curious…  
Is Cloudformation used even when the provider is Azure or Openwhisk? I’m not sure how it all works under the hood, but it seems like there must be (or should be?) some sort of vendor-agnostic format (like terraform) for codifying my infrastructure.

Edit: Just read the above comment, I guess that answers my question!

> We use Terraform in some of our internal Serverless projects as well (one of our engineers really likes it) and it has its up/downsides. For the main Serverless Services we want to go with the “provider native” configuration management system as any other system will simply not be used by larger companies, especially enterprises.

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [April 11, 2017, 8:30pm UTC](https://forum.serverless.com/t/terraform-support/228/8 "2017-04-11T20:30:52Z")

</div>

Couldn’t have answered it better myself!

My day job is consulting enterprises, and the sentiment in that quote is  
spot on. TF also stores its state outside of the platform, which is  
something I’m not personally a fan of.

---

<div class="post-metadata">

**Author:** ![walterheck](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/walterheck/32/1068_2.png) [@walterheck](https://forum.serverless.com/u/walterheck)\
**Post date:** [September 23, 2017, 8:30pm UTC](https://forum.serverless.com/t/terraform-support/228/9 "2017-09-23T20:30:53Z")

</div>

adding my perspective as a non-serverless user just passing by: The comments in this thread are all understandable if the majority of what you do is serverless. However in larger organisations it’s rarely the case. Terraform is vastly superior to native CFN, and so lots and lots of businesses with over 6 figure monthly AWS bills use terraform. It’s a complete headache to have to listen to someone tell you that you need to deploy serverless infra using `sls deploy` while pretty much everything else is terraform.

Something to consider?

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [September 24, 2017, 8:27pm UTC](https://forum.serverless.com/t/terraform-support/228/11 "2017-09-24T20:27:02Z")

</div>

@walterheck @bill I’d address the points you raised in your posts, but both of you signed up to the forum just to to take pot shots, and it also doesn’t look like you have any actual Serverless Framework experience, so I’m probably not going to convince you of anything.

Have a great day!

---

<div class="post-metadata">

**Author:** ![dfischer](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/dfischer/32/1125_2.png) [@dfischer](https://forum.serverless.com/u/dfischer)\
**Post date:** [October 12, 2017, 8:32pm UTC](https://forum.serverless.com/t/terraform-support/228/12 "2017-10-12T20:32:10Z")

</div>

What would be helpful would be to reference Terraform variables in Serverless config just like you can do `${ssm:/foo/${opt:stage}/bar` like `${tf:/foo/${opt:stage}/bar` because in a large co, you’re likely going to have infrastructure that spans a wide variety of services (not just Serverless) and this would be very helpful.

---

<div class="post-metadata">

**Author:** ![hereandnow](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/hereandnow/32/1215_2.png) [@hereandnow](https://forum.serverless.com/u/hereandnow)\
**Post date:** [November 3, 2017, 8:40pm UTC](https://forum.serverless.com/t/terraform-support/228/13 "2017-11-03T20:40:20Z")

</div>

i stumbled upon that thread while searching for the best way of using serverless together with terraform because we decided to give terraform a shot.

i have one question: how are you using terraform? probably through some sort of CI-Tool? wouldnt it make sense to use the same tool for deploying serverless applications?

---

<div class="post-metadata">

**Author:** ![leopoldodonnell](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/leopoldodonnell/32/2632_2.png) [@leopoldodonnell](https://forum.serverless.com/u/leopoldodonnell)\
**Post date:** [October 9, 2018, 7:05pm UTC](https://forum.serverless.com/t/terraform-support/228/14 "2018-10-09T19:05:15Z")

</div>

Hmm - some not so informed responses WRT terraform above. Clearly, assuming that there’s just one hammer, CF or Terraform isn’t all that enlightened. We’re using terraform pretty heavily at WiserSolutions that offers us a lot of flexibility and control over QA and compliance across multiple providers for a variety of services, accounts etc.

Terraform has published a tutorial [Serverless Applications with Lambda…](https://www.terraform.io/docs/providers/aws/guides/serverless-with-aws-lambda-and-api-gateway.html). So, it wouldn’t be such a stretch to wonder if a Serverless Framework provider couldn’t be created to deliver awesome simplicity to the process.

Speaking for my team, it isn’t really a problem, we’ve got build tasks that can be parameterized per environment. We would appreciate a Terraform provider/plugin and I’m sure others would too.

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [October 9, 2018, 9:51pm UTC](https://forum.serverless.com/t/terraform-support/228/15 "2018-10-09T21:51:34Z")

</div>

It’s an open source project. If you want support for terraform then create an issue at the Github repo, discuss the implementation in the issue and create a PR to add it.

---

<div class="post-metadata">

**Author:** ![leopoldodonnell](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/leopoldodonnell/32/2632_2.png) [@leopoldodonnell](https://forum.serverless.com/u/leopoldodonnell)\
**Post date:** [October 9, 2018, 10:04pm UTC](https://forum.serverless.com/t/terraform-support/228/16 "2018-10-09T22:04:58Z")

</div>

Like I said, it would be nice. Nice to have is not worth the effort. Just pointing out that it’s not a rediculous request.
