Import existing CFN template

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)

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

Will give that a shot. Thank you for the reply

How can I use this with the AWS CDK?

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

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?

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

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.

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

I get notified for both, but thanks for thinking of that :slight_smile::+1:
And yeah, Jon already answered it perfectly, I’ve got nothing to add to that :grinning_face_with_smiling_eyes: