简体   繁体   中英

Share AWS resources between Terraform and CDK

My team has two completely different environments: a Terraform one (which allow us to create and manage some AWS resources as databases) and a CDK one, with contains API resources and its logics as well.

We would like to use databases resources created with Terraform in the CDK app.

I was looking for some simple way to import outputs or tfstate from Terraform into CDK app, but I've found nothing.

I'd like to know how'd you achieve something like that?

So, I finally solved this issue by using the tfstate file on CDK: our Remote Backend is AWS, so the tfstate is stored on S3. When we run the CDK app we fetch this file from S3 and we inject its outputs into an application service.

It allows to always get the updated outputs from resources generated with Terraform.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM