# Import existing CFN template

**URL:** <https://discuss.hashicorp.com/t/import-existing-cfn-template/27097>\
**Category:** CDK for Terraform\
**Created:** [July 21, 2021, 9:33am UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097 "2021-07-21T09:33:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jur-harry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jur-harry/32/20928_2.png) [@jur-harry](https://discuss.hashicorp.com/u/jur-harry)\
**Post date:** [July 21, 2021, 9:33am UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/1 "2021-07-21T09:33:45Z")

</div>

Hi,

I’d like to import an existing CloudFormation template. I came across a tutorial [1] to do this for CloudFormation. I was wondering, is there something similar for Terraform?

[1] [Import or migrate an existing AWS CloudFormation template - AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/use_cfn_template.html)

---

<div class="post-metadata">

**Author:** ![ansgarm](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ansgarm/32/18680_2.png) [@ansgarm](https://discuss.hashicorp.com/u/ansgarm)\
**Post date:** [July 21, 2021, 9:47am UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/2 "2021-07-21T09:47:33Z")

</div>

Hi @jur-harry,

there is the a Terraform resource for deploying a Cloud Formation stack in the AWS provider[1]. You can use that one with the AWS provider bindings in the CDK for Terraform (as possible with any Terraform provider and module).

Is that what you were looking for?

[1] [https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation\_stack](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack)

---

<div class="post-metadata">

**Author:** ![jur-harry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jur-harry/32/20928_2.png) [@jur-harry](https://discuss.hashicorp.com/u/jur-harry)\
**Post date:** [July 21, 2021, 1:36pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/3 "2021-07-21T13:36:29Z")

</div>

Will give that a shot. Thank you for the reply

---

<div class="post-metadata">

**Author:** ![jur-harry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jur-harry/32/20928_2.png) [@jur-harry](https://discuss.hashicorp.com/u/jur-harry)\
**Post date:** [July 21, 2021, 2:03pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/4 "2021-07-21T14:03:59Z")

</div>

How can I use this with the AWS CDK?

---

<div class="post-metadata">

**Author:** ![ansgarm](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ansgarm/32/18680_2.png) [@ansgarm](https://discuss.hashicorp.com/u/ansgarm)\
**Post date:** [July 21, 2021, 2:16pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/5 "2021-07-21T14:16:27Z")

</div>

Currently there is no interoperability between the AWS CDK and the CDK for Terraform.  
What are you trying to achieve?

---

<div class="post-metadata">

**Author:** ![jur-harry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jur-harry/32/20928_2.png) [@jur-harry](https://discuss.hashicorp.com/u/jur-harry)\
**Post date:** [July 21, 2021, 2:19pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/6 "2021-07-21T14:19:48Z")

</div>

I want to automate the set up of my AWS BeanStalk app.

I’d like to have a template to deploy everything automatically. But in future might want to use Azure, etc so have chosen to use Terraform.

Any advice?

---

<div class="post-metadata">

**Author:** ![jur-harry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jur-harry/32/20928_2.png) [@jur-harry](https://discuss.hashicorp.com/u/jur-harry)\
**Post date:** [July 21, 2021, 2:20pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/7 "2021-07-21T14:20:18Z")

</div>

Not sure if you get notified for messages so I’ve replied above. Thanks

---

<div class="post-metadata">

**Author:** ![jsteinich](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jsteinich/32/9502_2.png) [@jsteinich](https://discuss.hashicorp.com/u/jsteinich)\
**Post date:** [July 21, 2021, 2:57pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/8 "2021-07-21T14:57:38Z")

</div>

In theory you can use AWS CDK to generate a Cloudformation template that can then be used by the Cloudformation Terraform resource, but at this point you’ll be mostly on your own for getting that setup. It would also have issues if you were using any custom resources via AWS CDK.

There have been experiments done with further integration, but I don’t believe anything has come from them since.

---

<div class="post-metadata">

**Author:** ![jur-harry](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jur-harry/32/20928_2.png) [@jur-harry](https://discuss.hashicorp.com/u/jur-harry)\
**Post date:** [July 21, 2021, 2:59pm UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/9 "2021-07-21T14:59:08Z")

</div>

Thanks for the reply. Since the app is simple I might try using Terraform directly

---

<div class="post-metadata">

**Author:** ![ansgarm](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ansgarm/32/18680_2.png) [@ansgarm](https://discuss.hashicorp.com/u/ansgarm)\
**Post date:** [July 22, 2021, 7:10am UTC](https://discuss.hashicorp.com/t/import-existing-cfn-template/27097/10 "2021-07-22T07:10:24Z")

</div>

I get notified for both, but thanks for thinking of that 🙂👍  
And yeah, Jon already answered it perfectly, I’ve got nothing to add to that 😄
